From 2ec4c366e613aa7b81aab6d0c9facb9d85d191f2 Mon Sep 17 00:00:00 2001 From: gziolo Date: Mon, 11 Apr 2022 12:04:30 +0000 Subject: [PATCH] Build: Update webpack to v5.x Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: https://github.com/WordPress/gutenberg/pull/33818. Props walbo, desrosj, mukesh27. Fixes #51750. Built from https://develop.svn.wordpress.org/trunk@53135 git-svn-id: http://core.svn.wordpress.org/trunk@52724 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/assets/script-loader-packages.php | 2 +- wp-includes/blocks/file/view.asset.php | 2 +- wp-includes/blocks/file/view.js | 107 +- wp-includes/blocks/file/view.min.asset.php | 2 +- wp-includes/blocks/file/view.min.js | 2 +- wp-includes/blocks/navigation/view.asset.php | 2 +- wp-includes/blocks/navigation/view.js | 107 +- .../blocks/navigation/view.min.asset.php | 2 +- wp-includes/blocks/navigation/view.min.js | 2 +- wp-includes/js/dist/a11y.js | 190 +- wp-includes/js/dist/a11y.min.js | 2 +- wp-includes/js/dist/annotations.js | 904 +- wp-includes/js/dist/annotations.min.js | 2 +- wp-includes/js/dist/api-fetch.js | 200 +- wp-includes/js/dist/api-fetch.min.js | 2 +- wp-includes/js/dist/autop.js | 140 +- wp-includes/js/dist/autop.min.js | 2 +- wp-includes/js/dist/blob.js | 146 +- wp-includes/js/dist/blob.min.js | 2 +- wp-includes/js/dist/block-directory.js | 1000 +- wp-includes/js/dist/block-directory.min.js | 2 +- wp-includes/js/dist/block-editor.js | 86409 +++++----- wp-includes/js/dist/block-editor.min.js | 23 +- wp-includes/js/dist/block-library.js | 10773 +- wp-includes/js/dist/block-library.min.js | 16 +- .../block-serialization-default-parser.js | 138 +- .../block-serialization-default-parser.min.js | 2 +- wp-includes/js/dist/blocks.js | 15573 +- wp-includes/js/dist/blocks.min.js | 4 +- wp-includes/js/dist/components.js | 133140 +++++++-------- wp-includes/js/dist/components.min.js | 35 +- wp-includes/js/dist/compose.js | 7318 +- wp-includes/js/dist/compose.min.js | 4 +- wp-includes/js/dist/core-data.js | 5468 +- wp-includes/js/dist/core-data.min.js | 2 +- wp-includes/js/dist/customize-widgets.js | 3256 +- wp-includes/js/dist/customize-widgets.min.js | 4 +- wp-includes/js/dist/data-controls.js | 216 +- wp-includes/js/dist/data-controls.min.js | 2 +- wp-includes/js/dist/data.js | 874 +- wp-includes/js/dist/data.min.js | 2 +- wp-includes/js/dist/date.js | 1386 +- wp-includes/js/dist/date.min.js | 6 +- wp-includes/js/dist/deprecated.js | 144 +- wp-includes/js/dist/deprecated.min.js | 2 +- wp-includes/js/dist/dom-ready.js | 128 +- wp-includes/js/dist/dom-ready.min.js | 2 +- wp-includes/js/dist/dom.js | 326 +- wp-includes/js/dist/dom.min.js | 2 +- wp-includes/js/dist/edit-post.js | 17084 +- wp-includes/js/dist/edit-post.min.js | 4 +- wp-includes/js/dist/edit-site.js | 19011 +- wp-includes/js/dist/edit-site.min.js | 4 +- wp-includes/js/dist/edit-widgets.js | 4541 +- wp-includes/js/dist/edit-widgets.min.js | 4 +- wp-includes/js/dist/editor.js | 5475 +- wp-includes/js/dist/editor.min.js | 6 +- wp-includes/js/dist/element.js | 324 +- wp-includes/js/dist/element.min.js | 2 +- wp-includes/js/dist/escape-html.js | 154 +- wp-includes/js/dist/escape-html.min.js | 2 +- wp-includes/js/dist/format-library.js | 932 +- wp-includes/js/dist/format-library.min.js | 2 +- wp-includes/js/dist/hooks.js | 202 +- wp-includes/js/dist/hooks.min.js | 2 +- wp-includes/js/dist/html-entities.js | 138 +- wp-includes/js/dist/html-entities.min.js | 2 +- wp-includes/js/dist/i18n.js | 610 +- wp-includes/js/dist/i18n.min.js | 2 +- wp-includes/js/dist/is-shallow-equal.js | 148 +- wp-includes/js/dist/is-shallow-equal.min.js | 2 +- wp-includes/js/dist/keyboard-shortcuts.js | 869 +- wp-includes/js/dist/keyboard-shortcuts.min.js | 2 +- wp-includes/js/dist/keycodes.js | 244 +- wp-includes/js/dist/keycodes.min.js | 2 +- wp-includes/js/dist/list-reusable-blocks.js | 272 +- .../js/dist/list-reusable-blocks.min.js | 2 +- wp-includes/js/dist/media-utils.js | 282 +- wp-includes/js/dist/media-utils.min.js | 2 +- wp-includes/js/dist/notices.js | 204 +- wp-includes/js/dist/notices.min.js | 2 +- wp-includes/js/dist/nux.js | 769 +- wp-includes/js/dist/nux.min.js | 2 +- wp-includes/js/dist/plugins.js | 381 +- wp-includes/js/dist/plugins.min.js | 2 +- wp-includes/js/dist/primitives.js | 469 +- wp-includes/js/dist/primitives.min.js | 4 +- wp-includes/js/dist/priority-queue.js | 142 +- wp-includes/js/dist/priority-queue.min.js | 2 +- wp-includes/js/dist/redux-routine.js | 1289 +- wp-includes/js/dist/redux-routine.min.js | 2 +- wp-includes/js/dist/reusable-blocks.js | 410 +- wp-includes/js/dist/reusable-blocks.min.js | 2 +- wp-includes/js/dist/rich-text.js | 691 +- wp-includes/js/dist/rich-text.min.js | 2 +- wp-includes/js/dist/server-side-render.js | 372 +- wp-includes/js/dist/server-side-render.min.js | 2 +- wp-includes/js/dist/shortcode.js | 899 +- wp-includes/js/dist/shortcode.min.js | 2 +- wp-includes/js/dist/token-list.js | 143 +- wp-includes/js/dist/token-list.min.js | 2 +- wp-includes/js/dist/url.js | 256 +- wp-includes/js/dist/url.min.js | 2 +- wp-includes/js/dist/vendor/lodash.min.js | 133 +- wp-includes/js/dist/vendor/react-dom.min.js | 238 +- wp-includes/js/dist/vendor/react.min.js | 24 +- .../js/dist/vendor/regenerator-runtime.min.js | 2 +- .../dist/vendor/wp-polyfill-dom-rect.min.js | 2 +- .../js/dist/vendor/wp-polyfill-fetch.min.js | 2 +- .../dist/vendor/wp-polyfill-formdata.min.js | 21 +- .../dist/vendor/wp-polyfill-object-fit.min.js | 2 +- .../js/dist/vendor/wp-polyfill-url.min.js | 2 +- wp-includes/js/dist/vendor/wp-polyfill.js | 2 +- wp-includes/js/dist/vendor/wp-polyfill.min.js | 8 +- wp-includes/js/dist/viewport.js | 284 +- wp-includes/js/dist/viewport.min.js | 2 +- wp-includes/js/dist/warning.js | 334 +- wp-includes/js/dist/warning.min.js | 2 +- wp-includes/js/dist/widgets.js | 754 +- wp-includes/js/dist/widgets.min.js | 4 +- wp-includes/js/dist/wordcount.js | 178 +- wp-includes/js/dist/wordcount.min.js | 2 +- wp-includes/js/media-audiovideo.js | 1143 +- wp-includes/js/media-audiovideo.min.js | 2 +- wp-includes/js/media-grid.js | 1073 +- wp-includes/js/media-grid.min.js | 2 +- wp-includes/js/media-models.js | 1073 +- wp-includes/js/media-models.min.js | 2 +- wp-includes/js/media-views.js | 15371 +- wp-includes/js/media-views.min.js | 2 +- wp-includes/version.php | 2 +- 131 files changed, 165632 insertions(+), 179486 deletions(-) diff --git a/wp-includes/assets/script-loader-packages.php b/wp-includes/assets/script-loader-packages.php index 15b1030694..0ade2a0ff0 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', 'wp-polyfill'), 'version' => '68e470cf840f69530e9db3be229ad4b6'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '8ef116cbb8beed8bc1da7eeb6c6e4602'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '17766b2bf644140bbb233ce86db2174c'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e5e1c1378bcb34e073986566ac756500'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4eca38a62df5f0145a5f1a78858581e7'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => '3deb079b0e2403bde3764a3ee22c2d59'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', '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-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '54657317be78fb1c246c72b38dc2ed0e'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'wp-a11y', '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-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'fb8cfd789616fa32f70090a33b3e6be5'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '2fc6dec19af6d4c5e5fec8f6fdc1a10b'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '28d5b8f8805a22435cbdc51927067812'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '796933f78811baa51a86b257df543749'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '058697a4c5024045c81954f411ff6dba'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'a2bea1a5333f4e9d2ea07429a9924da0'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', '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-plugins', 'wp-polyfill', 'wp-primitives', 'wp-viewport', 'wp-widgets'), 'version' => 'e38d3f45f9736b7a2a5f8de86137dbca'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => 'c5f9378263e5eea9d870764c8fc1dd1b'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => '8f1ca4c9b8ce97569364f3595781e718'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => 'a9a5af167fc60fa1bfda62582a7beb3c'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '8778985ac0dfb16f24f8ef86d0718f43'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'ba466ff86449b948bf89b1d25c2ad20e'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'ecda74de0221e1c2ce5c57cbb5af09d5'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => 'e39d7d6fd4bb0895e642d448e76793d7'), 'edit-site.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport'), 'version' => '403e01f2b098b6a656118a51787581cb'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', '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-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '7ac5bb27bb662c888b918bc66c0a0a65'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '8d4a298f55ea5a97c9e5147f9e132d82'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'fb9def72b4f6427aa79ce1c534a205cc'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'ce66e0f9acf6802317399656243ffbc4'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '5179b7561f0153d3127cffc2fc6d4a26'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => '1e58c8c5a32b2e97491080c5b10dc71c'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '544a76db37139ce991197ce1c0e8a601'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '30fcecb428a0e8383d3776bcdd3a7834'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '77450ab7b4e5185ab453093061332216'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '77c30626bb8cf4f5306643107664a1ae'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '9fd5d44710365c520fb15d397154271b'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'bdf52284155ed3fcf2d6999604be6b35'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '18fe8dfbb471a4ef452f5032317b2627'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => '5a82ca49493728103b070722b35c3c21'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'e456a944f50b52b51bd573db28db83ac'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => 'a192d765378319e49e7d3ba821e8afa3'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '31ccba505ebf4a66b299970fad62423c'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '8800e995455b762f0853c3b3abee6781'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '6c3ab278bc9641b6f62731e018a4449e'), 'reusable-blocks.js' => array('dependencies' => array('lodash', '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' => '0c555ff9c438801c104eea79e73f5769'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => 'a3e3616311fad456179e52a7528ec7fd'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'eb4890f695e6a7a0560506060a152632'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '7e026aec9ee5f844fe239b66b54b8865'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'ea7b368befe497077dbfdf1bb6bf609d'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '52ebb5d46ceac12c583cc27606583f7a'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => 'ad7c7de26ddc2341a6a3cf458c2c19dc'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '1f17121f9d6d7d4961e1345d847b2122'), 'widgets.js' => array('dependencies' => array('lodash', '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' => '18fe49a5f3a015c9be8cd325d3e64924'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '6a22341ec4203372b399ccf210f7cc7a')); \ No newline at end of file + array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'a38319d7ba46c6e60f7f9d4c371222c5'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'e103c345829d2b4da838b701a4dff236'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '0dba4ee96ad3d569997a3864aa593cd8'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '21d1d6c005241b908b592f52ad684a28'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '87cf2365cd719a6954f1e2bb8bcc692a'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => '0412215c1a30acacdab8c5c47546e4c1'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', '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-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '93be2c137c860a2d500985c9edae58f4'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'wp-a11y', '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-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'f8140fb86052cec4a7bf477cab749dd5'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '3f185f3bce2588a74d43034847c508e7'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '44910a8b8797da3722009721a8140dfc'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => 'f92475d274706ed3459d56cf1d500a96'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'ad740592e2b558c2c39fe2ffd5ae9f4e'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '696f64c66d4aa2f873aa61e9c41c314f'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', '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-primitives', 'wp-widgets'), 'version' => '74ca422e60c1961fa9e3d66dd4d78cf9'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '6c8d1d2f5fd3a0dd0f690b388be62075'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => '6a75067d86cf9ab901a4646595575446'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '558f09b690d1af995c044a6e534af741'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '96593d5d272d008fbcb6912fa0b86778'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'db303ea2ff11bbb161b19a3b0cc200fe'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd996b53411d1533a84951212ab6ac4ff'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '9b0320774da0e50a5655c66ff3271e4d'), 'edit-site.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport'), 'version' => 'fcbb8ebcf9e53b0e3d49e3d37a9ba141'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', '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-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'ea60dda005c09871a3f19ac638e4554b'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => 'e7d4b7e0195c7beb0ea91634b4fe6f78'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'aa7fa64d714e1bfb2783c767a090406d'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '00a5735837e9efe13da1d979f16a7105'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '70b1875c9f8d08d0725c2d29c27c5c53'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => '6f1c406015dcc134f2736b9aa66d7e92'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'aceb867c6fcca6a7ffbac9e7b5294327'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '2e6b2408ec717223c7a94cee48bb35e3'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '649feec00389556f8015a6b97efc1cb1'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '418fddac042f08102c4110f70e13cd47'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '84a0e6bbcf0b9e1ea0184c3f2bf28022'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '1ec5b0bdf9e6c2ea47f117db16155197'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'f03b83a599fc30ed40756ad5fcef15e4'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'e44820c667bf205cacdfc48cbeb3c2e6'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '4872896fe3c9656bc21e3a9f6cfe38f3'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '065e2abcdf28fe132eac4a5e0498e5ff'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'e55f3757d6aa7c23451d147b00329b13'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'efad6460ae6b28406d39866cb10731e0'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5156478c032ea85a2bbdceeb7a43b0c1'), 'reusable-blocks.js' => array('dependencies' => array('lodash', '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' => '5ad087c37455ce414015aff816a4e350'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '0c2ca335c85c5c680181f1fd6d06a884'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '1f0b4e9b7d975cf4fbaf0c2a606d38b2'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'd6964e945049b6190adc8770cda168c4'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '4ebce6423dfff99d40033fd33ce52cc9'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'cd20bb21dbf4896d55a0f0def110ed6e'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => 'f5b7d6832c98057c4f6fdedf2c2c0227'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'babb99706f43063fa0925fd1a0fd775a'), 'widgets.js' => array('dependencies' => array('lodash', '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' => 'bd5ba1332feaa7da969664b49295f3a7'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '56960c4d13e9d7a315dffd43fdce921c')); \ No newline at end of file diff --git a/wp-includes/blocks/file/view.asset.php b/wp-includes/blocks/file/view.asset.php index 5ac3943c32..a618faa1a8 100644 --- a/wp-includes/blocks/file/view.asset.php +++ b/wp-includes/blocks/file/view.asset.php @@ -1 +1 @@ - array(), 'version' => '650904f3ca9fdeab18131aab66cea896'); \ No newline at end of file + array(), 'version' => '395f76892cc61236cc5436776be90499'); \ No newline at end of file diff --git a/wp-includes/blocks/file/view.js b/wp-includes/blocks/file/view.js index 479d33238e..7919624d0f 100644 --- a/wp-includes/blocks/file/view.js +++ b/wp-includes/blocks/file/view.js @@ -1,99 +1,8 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "DP2F"); -/******/ }) -/************************************************************************/ -/******/ ({ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +var __webpack_exports__ = {}; -/***/ "DP2F": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js /** * Uses a combination of user agent matching and feature detection to determine whether * the current browser supports rendering PDFs inline. @@ -157,14 +66,12 @@ const hidePdfEmbedsOnUnsupportedBrowsers = () => { } }; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/view.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/view.js /** * Internal dependencies */ hidePdfEmbedsOnUnsupportedBrowsers(); - -/***/ }) - -/******/ }); \ No newline at end of file +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/blocks/file/view.min.asset.php b/wp-includes/blocks/file/view.min.asset.php index 3c640496af..9442413901 100644 --- a/wp-includes/blocks/file/view.min.asset.php +++ b/wp-includes/blocks/file/view.min.asset.php @@ -1 +1 @@ - array(), 'version' => 'e8d668b8e69d9bf1c99dc250d92f2b72'); \ No newline at end of file + array(), 'version' => 'c7ee2db603af4ed37bd6b1d2bb4a51bf'); \ No newline at end of file diff --git a/wp-includes/blocks/file/view.min.js b/wp-includes/blocks/file/view.min.js index 9d268a8bd8..12ef9ad51f 100644 --- a/wp-includes/blocks/file/view.min.js +++ b/wp-includes/blocks/file/view.min.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="DP2F")}({DP2F:function(e,t,n){"use strict";n.r(t);const r=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t};(()=>{if(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!r("AcroPDF.PDF")&&!r("PDF.PdfCtrl")){const e=document.getElementsByClassName("wp-block-file__embed");Array.from(e).forEach(e=>{e.style.display="none"})}})()}}); \ No newline at end of file +!function(){"use strict";const n=n=>{let i;try{i=new window.ActiveXObject(n)}catch(n){i=void 0}return i};(()=>{if(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!n("AcroPDF.PDF")&&!n("PDF.PdfCtrl")){const n=document.getElementsByClassName("wp-block-file__embed");Array.from(n).forEach((n=>{n.style.display="none"}))}})()}(); \ No newline at end of file diff --git a/wp-includes/blocks/navigation/view.asset.php b/wp-includes/blocks/navigation/view.asset.php index 7a8b842921..910fe29af1 100644 --- a/wp-includes/blocks/navigation/view.asset.php +++ b/wp-includes/blocks/navigation/view.asset.php @@ -1 +1 @@ - array(), 'version' => '87b1b146f654698824fabc51262fa860'); \ No newline at end of file + array(), 'version' => '2961774fadf00b77b1ba3f439386c681'); \ No newline at end of file diff --git a/wp-includes/blocks/navigation/view.js b/wp-includes/blocks/navigation/view.js index 848a5b6a69..32c1dc3c1b 100644 --- a/wp-includes/blocks/navigation/view.js +++ b/wp-includes/blocks/navigation/view.js @@ -1,102 +1,11 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "kVj6"); -/******/ }) -/************************************************************************/ -/******/ ({ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +var __webpack_exports__ = {}; -/***/ "kVj6": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// CONCATENATED MODULE: ./node_modules/micromodal/dist/micromodal.es.js +;// CONCATENATED MODULE: ./node_modules/micromodal/dist/micromodal.es.js function e(e,t){for(var o=0;oe.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&this.registerTriggers.apply(this,t(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var i,a,r;return i=o,(a=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(n);return Array.apply(void 0,t(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&e(i.prototype,a),r&&e(i,r),o}(),a=null,r=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},s=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var o in t)r(o);return!0},{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=t(document.querySelectorAll("[".concat(o.openTrigger,"]"))),r=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(n,o.openTrigger);if(!0!==o.debugMode||!1!==s(n,r))for(var l in r){var c=r[l];o.targetModal=l,o.triggers=t(c),a=new i(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===r(e)||(a&&a.removeEventListeners(),(a=new i(o)).showModal())},close:function(e){e?a.closeModalById(e):a.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=l);/* harmony default export */ var micromodal_es = (l); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/view.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/view.js /** * External dependencies */ @@ -180,7 +89,5 @@ window.addEventListener('load', () => { }); }); - -/***/ }) - -/******/ }); \ No newline at end of file +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/blocks/navigation/view.min.asset.php b/wp-includes/blocks/navigation/view.min.asset.php index a47e07872f..39101e3e79 100644 --- a/wp-includes/blocks/navigation/view.min.asset.php +++ b/wp-includes/blocks/navigation/view.min.asset.php @@ -1 +1 @@ - array(), 'version' => '3776ea67846b3bb10fe8f7cdd486b0ba'); \ No newline at end of file + array(), 'version' => '009e29110e016c14bac4ba0ecc809fcd'); \ No newline at end of file diff --git a/wp-includes/blocks/navigation/view.min.js b/wp-includes/blocks/navigation/view.min.js index a654139b15..aaa7d9140d 100644 --- a/wp-includes/blocks/navigation/view.min.js +++ b/wp-includes/blocks/navigation/view.min.js @@ -1 +1 @@ -!function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s="kVj6")}({kVj6:function(e,t,o){"use strict";function n(e,t){for(var o=0;oe.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&this.registerTriggers.apply(this,i(r)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var t,o;return t=e,(o=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(a);return Array.apply(void 0,i(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&n(t.prototype,o),e}(),s=null,c=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},d=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var o in t)c(o);return!0},{init:function(e){var t=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),o=i(document.querySelectorAll("[".concat(t.openTrigger,"]"))),n=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(o,t.openTrigger);if(!0!==t.debugMode||!1!==d(o,n))for(var r in n){var a=n[r];t.targetModal=r,t.triggers=i(a),s=new l(t)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===c(e)||(s&&s.removeEventListeners(),(s=new l(o)).showModal())},close:function(e){e?s.closeModalById(e):s.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=u);var f=u;function h(e){const t=e.querySelector(".wp-block-navigation__responsive-dialog"),o="true"===e.getAttribute("aria-hidden");e.classList.toggle("has-modal-open",!o),t.toggleAttribute("aria-modal",!o),o?(t.removeAttribute("role"),t.removeAttribute("aria-modal")):(t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"));document.documentElement.classList.toggle("has-modal-open")}function v(e){e.querySelectorAll('[aria-expanded="true"]').forEach((function(e){e.setAttribute("aria-expanded","false")}))}function g(e){const t=e.target.closest("[aria-expanded]");if("true"===t.getAttribute("aria-expanded"))v(t.closest(".wp-block-navigation-item"));else{const e=t.closest(".wp-block-navigation-item");t.closest(".wp-block-navigation__submenu-container, .wp-block-navigation__container, .wp-block-page-list").querySelectorAll(".wp-block-navigation-item").forEach((function(t){t!==e&&v(t)})),t.setAttribute("aria-expanded","true")}}window.addEventListener("load",()=>{f.init({onShow:h,onClose:h,openClass:"is-menu-open"});document.querySelectorAll(".wp-block-navigation-submenu__toggle").forEach((function(e){e.addEventListener("click",g)})),document.addEventListener("click",(function(e){document.querySelectorAll(".wp-block-navigation").forEach((function(t){t.contains(e.target)||v(t)}))})),document.addEventListener("keyup",(function(e){document.querySelectorAll(".wp-block-navigation-item.has-child").forEach((function(t){t.contains(e.target)||v(t)}))}))})}}); \ No newline at end of file +!function(){"use strict";function e(e,t){for(var o=0;oe.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&this.registerTriggers.apply(this,t(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var i,a;return i=o,(a=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(n);return Array.apply(void 0,t(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&e(i.prototype,a),o}(),a=null,r=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},l=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var o in t)r(o);return!0},{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=t(document.querySelectorAll("[".concat(o.openTrigger,"]"))),r=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(n,o.openTrigger);if(!0!==o.debugMode||!1!==l(n,r))for(var s in r){var c=r[s];o.targetModal=s,o.triggers=t(c),a=new i(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===r(e)||(a&&a.removeEventListeners(),(a=new i(o)).showModal())},close:function(e){e?a.closeModalById(e):a.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=s);var c=s;function d(e){const t=e.querySelector(".wp-block-navigation__responsive-dialog"),o="true"===e.getAttribute("aria-hidden");e.classList.toggle("has-modal-open",!o),t.toggleAttribute("aria-modal",!o),o?(t.removeAttribute("role"),t.removeAttribute("aria-modal")):(t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"));document.documentElement.classList.toggle("has-modal-open")}function u(e){e.querySelectorAll('[aria-expanded="true"]').forEach((function(e){e.setAttribute("aria-expanded","false")}))}function f(e){const t=e.target.closest("[aria-expanded]");if("true"===t.getAttribute("aria-expanded"))u(t.closest(".wp-block-navigation-item"));else{const e=t.closest(".wp-block-navigation-item");t.closest(".wp-block-navigation__submenu-container, .wp-block-navigation__container, .wp-block-page-list").querySelectorAll(".wp-block-navigation-item").forEach((function(t){t!==e&&u(t)})),t.setAttribute("aria-expanded","true")}}window.addEventListener("load",(()=>{c.init({onShow:d,onClose:d,openClass:"is-menu-open"});document.querySelectorAll(".wp-block-navigation-submenu__toggle").forEach((function(e){e.addEventListener("click",f)})),document.addEventListener("click",(function(e){document.querySelectorAll(".wp-block-navigation").forEach((function(t){t.contains(e.target)||u(t)}))})),document.addEventListener("keyup",(function(e){document.querySelectorAll(".wp-block-navigation-item.has-child").forEach((function(t){t.contains(e.target)||u(t)}))}))}))}(); \ No newline at end of file diff --git a/wp-includes/js/dist/a11y.js b/wp-includes/js/dist/a11y.js index be0dbee1e8..84da468ef4 100644 --- a/wp-includes/js/dist/a11y.js +++ b/wp-includes/js/dist/a11y.js @@ -1,118 +1,66 @@ -this["wp"] = this["wp"] || {}; this["wp"]["a11y"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "jncB"); -/******/ }) +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ /************************************************************************/ -/******/ ({ - -/***/ "Y8OO": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["domReady"]; }()); - -/***/ }), - -/***/ "jncB": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(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__, "setup", function() { return /* binding */ setup; }); -__webpack_require__.d(__webpack_exports__, "speak", function() { return /* binding */ speak; }); +__webpack_require__.d(__webpack_exports__, { + "setup": function() { return /* binding */ setup; }, + "speak": function() { return /* binding */ speak; } +}); -// EXTERNAL MODULE: external ["wp","domReady"] -var external_wp_domReady_ = __webpack_require__("Y8OO"); -var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js +;// CONCATENATED MODULE: external ["wp","domReady"] +var external_wp_domReady_namespaceObject = window["wp"]["domReady"]; +var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_namespaceObject); +;// CONCATENATED MODULE: external ["wp","i18n"] +var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js /** * WordPress dependencies */ @@ -130,7 +78,7 @@ function addIntroText() { const introText = document.createElement('p'); introText.id = 'a11y-speak-intro-text'; introText.className = 'a11y-speak-intro-text'; - introText.textContent = Object(external_wp_i18n_["__"])('Notifications'); + introText.textContent = (0,external_wp_i18n_namespaceObject.__)('Notifications'); introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;'); introText.setAttribute('hidden', 'hidden'); const { @@ -144,7 +92,7 @@ function addIntroText() { return introText; } -// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js /** * Build the live regions markup. * @@ -172,7 +120,7 @@ function addContainer() { return container; } -// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js /** * Clears the a11y-speak-region elements and hides the explanatory text. */ @@ -190,7 +138,7 @@ function clear() { } } -// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js let previousMessage = ''; /** * Filter the message to be announced to the screenreader. @@ -222,7 +170,7 @@ function filterMessage(message) { return message; } -// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js /** * WordPress dependencies */ @@ -307,14 +255,6 @@ function speak(message, ariaLive) { } } - -/***/ }), - -/***/ "l3Sj": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["i18n"]; }()); - -/***/ }) - -/******/ }); \ No newline at end of file +(window.wp = window.wp || {}).a11y = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/js/dist/a11y.min.js b/wp-includes/js/dist/a11y.min.js index 0fb49858b8..a5693f64cb 100644 --- a/wp-includes/js/dist/a11y.min.js +++ b/wp-includes/js/dist/a11y.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -this.wp=this.wp||{},this.wp.a11y=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="jncB")}({Y8OO:function(t,e){t.exports=window.wp.domReady},jncB:function(t,e,n){"use strict";n.r(e),n.d(e,"setup",(function(){return u})),n.d(e,"speak",(function(){return d}));var i=n("Y8OO"),o=n.n(i),r=n("l3Sj");function a(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite";const e=document.createElement("div");e.id="a11y-speak-"+t,e.className="a11y-speak-region",e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(e),e}let p="";function u(){const t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===t&&function(){const t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=Object(r.__)("Notifications"),t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("hidden","hidden");const{body:e}=document;e&&e.appendChild(t)}(),null===e&&a("assertive"),null===n&&a("polite")}function d(t,e){!function(){const t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text");for(let e=0;e]+>/g," "),p===t&&(t+=" "),p=t,t}(t);const n=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");i&&"assertive"===e?i.textContent=t:o&&(o.textContent=t),n&&n.removeAttribute("hidden")}o()(u)},l3Sj:function(t,e){t.exports=window.wp.i18n}}); \ No newline at end of file +!function(){"use strict";var t={n:function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},d:function(e,n){for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(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,{setup:function(){return d},speak:function(){return p}});var n=window.wp.domReady,i=t.n(n),o=window.wp.i18n;function r(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite";const e=document.createElement("div");e.id=`a11y-speak-${t}`,e.className="a11y-speak-region",e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(e),e}let a="";function d(){const t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===t&&function(){const t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=(0,o.__)("Notifications"),t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("hidden","hidden");const{body:e}=document;e&&e.appendChild(t)}(),null===e&&r("assertive"),null===n&&r("polite")}function p(t,e){!function(){const t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text");for(let e=0;e]+>/g," "),a===t&&(t+=" "),a=t,t}(t);const n=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");i&&"assertive"===e?i.textContent=t:o&&(o.textContent=t),n&&n.removeAttribute("hidden")}i()(d),(window.wp=window.wp||{}).a11y=e}(); \ No newline at end of file diff --git a/wp-includes/js/dist/annotations.js b/wp-includes/js/dist/annotations.js index 803010cdfb..984b0e96a3 100644 --- a/wp-includes/js/dist/annotations.js +++ b/wp-includes/js/dist/annotations.js @@ -1,132 +1,72 @@ -this["wp"] = this["wp"] || {}; this["wp"]["annotations"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "23Y4"); -/******/ }) +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ /************************************************************************/ -/******/ ({ - -/***/ "1ZqX": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["data"]; }()); - -/***/ }), - -/***/ "23Y4": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(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__, "store", function() { return /* reexport */ store; }); +__webpack_require__.d(__webpack_exports__, { + "store": function() { return /* reexport */ store; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotationsForBlock", function() { return __experimentalGetAnnotationsForBlock; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllAnnotationsForBlock", function() { return __experimentalGetAllAnnotationsForBlock; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotationsForRichText", function() { return __experimentalGetAnnotationsForRichText; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotations", function() { return __experimentalGetAnnotations; }); +__webpack_require__.d(selectors_namespaceObject, { + "__experimentalGetAllAnnotationsForBlock": function() { return __experimentalGetAllAnnotationsForBlock; }, + "__experimentalGetAnnotations": function() { return __experimentalGetAnnotations; }, + "__experimentalGetAnnotationsForBlock": function() { return __experimentalGetAnnotationsForBlock; }, + "__experimentalGetAnnotationsForRichText": function() { return __experimentalGetAnnotationsForRichText; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); -__webpack_require__.d(actions_namespaceObject, "__experimentalAddAnnotation", function() { return __experimentalAddAnnotation; }); -__webpack_require__.d(actions_namespaceObject, "__experimentalRemoveAnnotation", function() { return __experimentalRemoveAnnotation; }); -__webpack_require__.d(actions_namespaceObject, "__experimentalUpdateAnnotationRange", function() { return __experimentalUpdateAnnotationRange; }); -__webpack_require__.d(actions_namespaceObject, "__experimentalRemoveAnnotationsBySource", function() { return __experimentalRemoveAnnotationsBySource; }); +__webpack_require__.d(actions_namespaceObject, { + "__experimentalAddAnnotation": function() { return __experimentalAddAnnotation; }, + "__experimentalRemoveAnnotation": function() { return __experimentalRemoveAnnotation; }, + "__experimentalRemoveAnnotationsBySource": function() { return __experimentalRemoveAnnotationsBySource; }, + "__experimentalUpdateAnnotationRange": function() { return __experimentalUpdateAnnotationRange; } +}); -// EXTERNAL MODULE: external ["wp","richText"] -var external_wp_richText_ = __webpack_require__("qRz9"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/constants.js +;// CONCATENATED MODULE: external ["wp","richText"] +var external_wp_richText_namespaceObject = window["wp"]["richText"]; +;// CONCATENATED MODULE: external ["wp","i18n"] +var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/constants.js /** * The identifier for the data store. * @@ -134,7 +74,7 @@ var external_wp_i18n_ = __webpack_require__("l3Sj"); */ const STORE_NAME = 'core/annotations'; -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/annotation.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/annotation.js /** * WordPress dependencies */ @@ -173,7 +113,7 @@ function applyAnnotations(record) { const className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source; const id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id; - record = Object(external_wp_richText_["applyFormat"])(record, { + record = (0,external_wp_richText_namespaceObject.applyFormat)(record, { type: FORMAT_NAME, attributes: { className, @@ -191,7 +131,7 @@ function applyAnnotations(record) { */ function removeAnnotations(record) { - return Object(external_wp_richText_["removeFormat"])(record, 'core/annotation', 0, record.text.length); + return removeFormat(record, 'core/annotation', 0, record.text.length); } /** * Retrieves the positions of annotations inside an array of formats. @@ -262,9 +202,9 @@ function updateAnnotationsWithPositions(annotations, positions, _ref) { }); } -const annotation_annotation = { +const annotation = { name: FORMAT_NAME, - title: Object(external_wp_i18n_["__"])('Annotation'), + title: (0,external_wp_i18n_namespaceObject.__)('Annotation'), tagName: 'mark', className: 'annotation-text', attributes: { @@ -328,7 +268,7 @@ const annotation_annotation = { }; -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/index.js /** * WordPress dependencies */ @@ -341,16 +281,14 @@ const annotation_annotation = { const { name: format_name, ...settings -} = annotation_annotation; -Object(external_wp_richText_["registerFormatType"])(format_name, settings); +} = annotation; +(0,external_wp_richText_namespaceObject.registerFormatType)(format_name, settings); -// EXTERNAL MODULE: external ["wp","hooks"] -var external_wp_hooks_ = __webpack_require__("g56x"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/block/index.js +;// CONCATENATED MODULE: external ["wp","hooks"] +var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; +;// CONCATENATED MODULE: external ["wp","data"] +var external_wp_data_namespaceObject = window["wp"]["data"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/block/index.js /** * WordPress dependencies */ @@ -369,7 +307,7 @@ var external_wp_data_ = __webpack_require__("1ZqX"); */ const addAnnotationClassName = OriginalComponent => { - return Object(external_wp_data_["withSelect"])((select, _ref) => { + return (0,external_wp_data_namespaceObject.withSelect)((select, _ref) => { let { clientId, className @@ -385,12 +323,11 @@ const addAnnotationClassName = OriginalComponent => { })(OriginalComponent); }; -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/annotations', addAnnotationClassName); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/annotations', addAnnotationClassName); -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/reducer.js +;// CONCATENATED MODULE: external "lodash" +var external_lodash_namespaceObject = window["lodash"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/reducer.js /** * External dependencies */ @@ -418,7 +355,7 @@ function filterWithReference(collection, predicate) { function isValidAnnotationRange(annotation) { - return Object(external_lodash_["isNumber"])(annotation.start) && Object(external_lodash_["isNumber"])(annotation.end) && annotation.start <= annotation.end; + return (0,external_lodash_namespaceObject.isNumber)(annotation.start) && (0,external_lodash_namespaceObject.isNumber)(annotation.end) && annotation.start <= annotation.end; } /** * Reducer managing annotations. @@ -430,7 +367,7 @@ function isValidAnnotationRange(annotation) { */ -function reducer_annotations() { +function annotations() { var _state$blockClientId; let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -458,14 +395,14 @@ function reducer_annotations() { }; case 'ANNOTATION_REMOVE': - return Object(external_lodash_["mapValues"])(state, annotationsForBlock => { + return (0,external_lodash_namespaceObject.mapValues)(state, annotationsForBlock => { return filterWithReference(annotationsForBlock, annotation => { return annotation.id !== action.annotationId; }); }); case 'ANNOTATION_UPDATE_RANGE': - return Object(external_lodash_["mapValues"])(state, annotationsForBlock => { + return (0,external_lodash_namespaceObject.mapValues)(state, annotationsForBlock => { let hasChangedRange = false; const newAnnotations = annotationsForBlock.map(annotation => { if (annotation.id === action.annotationId) { @@ -484,7 +421,7 @@ function reducer_annotations() { }); case 'ANNOTATION_REMOVE_SOURCE': - return Object(external_lodash_["mapValues"])(state, annotationsForBlock => { + return (0,external_lodash_namespaceObject.mapValues)(state, annotationsForBlock => { return filterWithReference(annotationsForBlock, annotation => { return annotation.source !== action.source; }); @@ -493,367 +430,9 @@ function reducer_annotations() { return state; } -/* harmony default export */ var reducer = (reducer_annotations); +/* harmony default export */ var reducer = (annotations); -// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js -var rememo = __webpack_require__("pPDe"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js -/** - * External dependencies - */ - - -/** - * Shared reference to an empty array for cases where it is important to avoid - * returning a new array reference on every invocation, as in a connected or - * other pure component which performs `shouldComponentUpdate` check on props. - * This should be used as a last resort, since the normalized data should be - * maintained by the reducer result in state. - * - * @type {Array} - */ - -const EMPTY_ARRAY = []; -/** - * Returns the annotations for a specific client ID. - * - * @param {Object} state Editor state. - * @param {string} clientId The ID of the block to get the annotations for. - * - * @return {Array} The annotations applicable to this block. - */ - -const __experimentalGetAnnotationsForBlock = Object(rememo["a" /* default */])((state, blockClientId) => { - var _state$blockClientId; - - return ((_state$blockClientId = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : []).filter(annotation => { - return annotation.selector === 'block'; - }); -}, (state, blockClientId) => { - var _state$blockClientId2; - - return [(_state$blockClientId2 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId2 !== void 0 ? _state$blockClientId2 : EMPTY_ARRAY]; -}); -function __experimentalGetAllAnnotationsForBlock(state, blockClientId) { - var _state$blockClientId3; - - return (_state$blockClientId3 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId3 !== void 0 ? _state$blockClientId3 : EMPTY_ARRAY; -} -/** - * Returns the annotations that apply to the given RichText instance. - * - * Both a blockClientId and a richTextIdentifier are required. This is because - * a block might have multiple `RichText` components. This does mean that every - * block needs to implement annotations itself. - * - * @param {Object} state Editor state. - * @param {string} blockClientId The client ID for the block. - * @param {string} richTextIdentifier Unique identifier that identifies the given RichText. - * @return {Array} All the annotations relevant for the `RichText`. - */ - -const __experimentalGetAnnotationsForRichText = Object(rememo["a" /* default */])((state, blockClientId, richTextIdentifier) => { - var _state$blockClientId4; - - return ((_state$blockClientId4 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId4 !== void 0 ? _state$blockClientId4 : []).filter(annotation => { - return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier; - }).map(annotation => { - const { - range, - ...other - } = annotation; - return { ...range, - ...other - }; - }); -}, (state, blockClientId) => { - var _state$blockClientId5; - - return [(_state$blockClientId5 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId5 !== void 0 ? _state$blockClientId5 : EMPTY_ARRAY]; -}); -/** - * Returns all annotations in the editor state. - * - * @param {Object} state Editor state. - * @return {Array} All annotations currently applied. - */ - -function __experimentalGetAnnotations(state) { - return Object(external_lodash_["flatMap"])(state, annotations => { - return annotations; - }); -} - -// EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules -var v4 = __webpack_require__("7Cbv"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/actions.js -/** - * External dependencies - */ - -/** - * @typedef WPAnnotationRange - * - * @property {number} start The offset where the annotation should start. - * @property {number} end The offset where the annotation should end. - */ - -/** - * Adds an annotation to a block. - * - * The `block` attribute refers to a block ID that needs to be annotated. - * `isBlockAnnotation` controls whether or not the annotation is a block - * annotation. The `source` is the source of the annotation, this will be used - * to identity groups of annotations. - * - * The `range` property is only relevant if the selector is 'range'. - * - * @param {Object} annotation The annotation to add. - * @param {string} annotation.blockClientId The blockClientId to add the annotation to. - * @param {string} annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to. - * @param {WPAnnotationRange} annotation.range The range at which to apply this annotation. - * @param {string} [annotation.selector="range"] The way to apply this annotation. - * @param {string} [annotation.source="default"] The source that added the annotation. - * @param {string} [annotation.id] The ID the annotation should have. Generates a UUID by default. - * - * @return {Object} Action object. - */ - -function __experimentalAddAnnotation(_ref) { - let { - blockClientId, - richTextIdentifier = null, - range = null, - selector = 'range', - source = 'default', - id = Object(v4["a" /* default */])() - } = _ref; - const action = { - type: 'ANNOTATION_ADD', - id, - blockClientId, - richTextIdentifier, - source, - selector - }; - - if (selector === 'range') { - action.range = range; - } - - return action; -} -/** - * Removes an annotation with a specific ID. - * - * @param {string} annotationId The annotation to remove. - * - * @return {Object} Action object. - */ - -function __experimentalRemoveAnnotation(annotationId) { - return { - type: 'ANNOTATION_REMOVE', - annotationId - }; -} -/** - * Updates the range of an annotation. - * - * @param {string} annotationId ID of the annotation to update. - * @param {number} start The start of the new range. - * @param {number} end The end of the new range. - * - * @return {Object} Action object. - */ - -function __experimentalUpdateAnnotationRange(annotationId, start, end) { - return { - type: 'ANNOTATION_UPDATE_RANGE', - annotationId, - start, - end - }; -} -/** - * Removes all annotations of a specific source. - * - * @param {string} source The source to remove. - * - * @return {Object} Action object. - */ - -function __experimentalRemoveAnnotationsBySource(source) { - return { - type: 'ANNOTATION_REMOVE_SOURCE', - source - }; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/index.js -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -/** - * Module Constants - */ - - -/** - * Store definition for the annotations namespace. - * - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore - * - * @type {Object} - */ - -const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, { - reducer: reducer, - selectors: selectors_namespaceObject, - actions: actions_namespaceObject -}); -Object(external_wp_data_["register"])(store); - -// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/index.js -/** - * Internal dependencies - */ - - - - - -/***/ }), - -/***/ "7Cbv": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// CONCATENATED MODULE: ./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()). -var getRandomValues; -var 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. Also, - // find the complete implementation of crypto (msCrypto) on IE11. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} -// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js -/* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); -// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js - - -function validate(uuid) { - return typeof uuid === 'string' && regex.test(uuid); -} - -/* harmony default export */ var esm_browser_validate = (validate); -// CONCATENATED MODULE: ./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 - */ - -var byteToHex = []; - -for (var stringify_i = 0; stringify_i < 256; ++stringify_i) { - byteToHex.push((stringify_i + 0x100).toString(16).substr(1)); -} - -function stringify(arr) { - var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 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 - var uuid = (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]]).toLowerCase(); // 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 (!esm_browser_validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -/* harmony default export */ var esm_browser_stringify = (stringify); -// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js - - - -function v4(options, buf, offset) { - options = options || {}; - var 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 (var i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return esm_browser_stringify(rnds); -} - -/* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4); - -/***/ }), - -/***/ "YLtl": -/***/ (function(module, exports) { - -(function() { module.exports = window["lodash"]; }()); - -/***/ }), - -/***/ "g56x": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["hooks"]; }()); - -/***/ }), - -/***/ "l3Sj": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["i18n"]; }()); - -/***/ }), - -/***/ "pPDe": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; +;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js var LEAF_KEY, hasWeakMap; @@ -951,7 +530,7 @@ function isShallowEqual( a, b, fromIndex ) { * * @return {Function} Memoized selector. */ -/* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) { +/* harmony default export */ function rememo(selector, getDependants ) { var rootCache, getCache; // Use object source as dependant if getter not provided @@ -1127,16 +706,325 @@ function isShallowEqual( a, b, fromIndex ) { clear(); return callSelector; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js +/** + * External dependencies + */ + + +/** + * Shared reference to an empty array for cases where it is important to avoid + * returning a new array reference on every invocation, as in a connected or + * other pure component which performs `shouldComponentUpdate` check on props. + * This should be used as a last resort, since the normalized data should be + * maintained by the reducer result in state. + * + * @type {Array} + */ + +const EMPTY_ARRAY = []; +/** + * Returns the annotations for a specific client ID. + * + * @param {Object} state Editor state. + * @param {string} clientId The ID of the block to get the annotations for. + * + * @return {Array} The annotations applicable to this block. + */ + +const __experimentalGetAnnotationsForBlock = rememo((state, blockClientId) => { + var _state$blockClientId; + + return ((_state$blockClientId = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : []).filter(annotation => { + return annotation.selector === 'block'; + }); +}, (state, blockClientId) => { + var _state$blockClientId2; + + return [(_state$blockClientId2 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId2 !== void 0 ? _state$blockClientId2 : EMPTY_ARRAY]; }); +function __experimentalGetAllAnnotationsForBlock(state, blockClientId) { + var _state$blockClientId3; + + return (_state$blockClientId3 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId3 !== void 0 ? _state$blockClientId3 : EMPTY_ARRAY; +} +/** + * Returns the annotations that apply to the given RichText instance. + * + * Both a blockClientId and a richTextIdentifier are required. This is because + * a block might have multiple `RichText` components. This does mean that every + * block needs to implement annotations itself. + * + * @param {Object} state Editor state. + * @param {string} blockClientId The client ID for the block. + * @param {string} richTextIdentifier Unique identifier that identifies the given RichText. + * @return {Array} All the annotations relevant for the `RichText`. + */ + +const __experimentalGetAnnotationsForRichText = rememo((state, blockClientId, richTextIdentifier) => { + var _state$blockClientId4; + + return ((_state$blockClientId4 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId4 !== void 0 ? _state$blockClientId4 : []).filter(annotation => { + return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier; + }).map(annotation => { + const { + range, + ...other + } = annotation; + return { ...range, + ...other + }; + }); +}, (state, blockClientId) => { + var _state$blockClientId5; + + return [(_state$blockClientId5 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId5 !== void 0 ? _state$blockClientId5 : EMPTY_ARRAY]; +}); +/** + * Returns all annotations in the editor state. + * + * @param {Object} state Editor state. + * @return {Array} All annotations currently applied. + */ + +function __experimentalGetAnnotations(state) { + return (0,external_lodash_namespaceObject.flatMap)(state, annotations => { + return annotations; + }); +} + +;// CONCATENATED MODULE: ./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()). +var getRandomValues; +var 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. Also, + // find the complete implementation of crypto (msCrypto) on IE11. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js +/* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js -/***/ }), +function validate(uuid) { + return typeof uuid === 'string' && regex.test(uuid); +} -/***/ "qRz9": -/***/ (function(module, exports) { +/* harmony default export */ var esm_browser_validate = (validate); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js -(function() { module.exports = window["wp"]["richText"]; }()); +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ -/***/ }) +var byteToHex = []; -/******/ }); \ No newline at end of file +for (var i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 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 + var uuid = (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]]).toLowerCase(); // 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 (!esm_browser_validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +/* harmony default export */ var esm_browser_stringify = (stringify); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + + + +function v4(options, buf, offset) { + options = options || {}; + var 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 (var i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return esm_browser_stringify(rnds); +} + +/* harmony default export */ var esm_browser_v4 = (v4); +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/actions.js +/** + * External dependencies + */ + +/** + * @typedef WPAnnotationRange + * + * @property {number} start The offset where the annotation should start. + * @property {number} end The offset where the annotation should end. + */ + +/** + * Adds an annotation to a block. + * + * The `block` attribute refers to a block ID that needs to be annotated. + * `isBlockAnnotation` controls whether or not the annotation is a block + * annotation. The `source` is the source of the annotation, this will be used + * to identity groups of annotations. + * + * The `range` property is only relevant if the selector is 'range'. + * + * @param {Object} annotation The annotation to add. + * @param {string} annotation.blockClientId The blockClientId to add the annotation to. + * @param {string} annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to. + * @param {WPAnnotationRange} annotation.range The range at which to apply this annotation. + * @param {string} [annotation.selector="range"] The way to apply this annotation. + * @param {string} [annotation.source="default"] The source that added the annotation. + * @param {string} [annotation.id] The ID the annotation should have. Generates a UUID by default. + * + * @return {Object} Action object. + */ + +function __experimentalAddAnnotation(_ref) { + let { + blockClientId, + richTextIdentifier = null, + range = null, + selector = 'range', + source = 'default', + id = esm_browser_v4() + } = _ref; + const action = { + type: 'ANNOTATION_ADD', + id, + blockClientId, + richTextIdentifier, + source, + selector + }; + + if (selector === 'range') { + action.range = range; + } + + return action; +} +/** + * Removes an annotation with a specific ID. + * + * @param {string} annotationId The annotation to remove. + * + * @return {Object} Action object. + */ + +function __experimentalRemoveAnnotation(annotationId) { + return { + type: 'ANNOTATION_REMOVE', + annotationId + }; +} +/** + * Updates the range of an annotation. + * + * @param {string} annotationId ID of the annotation to update. + * @param {number} start The start of the new range. + * @param {number} end The end of the new range. + * + * @return {Object} Action object. + */ + +function __experimentalUpdateAnnotationRange(annotationId, start, end) { + return { + type: 'ANNOTATION_UPDATE_RANGE', + annotationId, + start, + end + }; +} +/** + * Removes all annotations of a specific source. + * + * @param {string} source The source to remove. + * + * @return {Object} Action object. + */ + +function __experimentalRemoveAnnotationsBySource(source) { + return { + type: 'ANNOTATION_REMOVE_SOURCE', + source + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/index.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +/** + * Module Constants + */ + + +/** + * Store definition for the annotations namespace. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore + * + * @type {Object} + */ + +const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { + reducer: reducer, + selectors: selectors_namespaceObject, + actions: actions_namespaceObject +}); +(0,external_wp_data_namespaceObject.register)(store); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/index.js +/** + * Internal dependencies + */ + + + + +(window.wp = window.wp || {}).annotations = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/js/dist/annotations.min.js b/wp-includes/js/dist/annotations.min.js index 4b3bf5034b..321712a8ae 100644 --- a/wp-includes/js/dist/annotations.min.js +++ b/wp-includes/js/dist/annotations.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -this.wp=this.wp||{},this.wp.annotations=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="23Y4")}({"1ZqX":function(t,e){t.exports=window.wp.data},"23Y4":function(t,e,n){"use strict";n.r(e),n.d(e,"store",(function(){return R}));var r={};n.r(r),n.d(r,"__experimentalGetAnnotationsForBlock",(function(){return x})),n.d(r,"__experimentalGetAllAnnotationsForBlock",(function(){return _})),n.d(r,"__experimentalGetAnnotationsForRichText",(function(){return A})),n.d(r,"__experimentalGetAnnotations",(function(){return O}));var o={};n.r(o),n.d(o,"__experimentalAddAnnotation",(function(){return N})),n.d(o,"__experimentalRemoveAnnotation",(function(){return T})),n.d(o,"__experimentalUpdateAnnotationRange",(function(){return w})),n.d(o,"__experimentalRemoveAnnotationsBySource",(function(){return j}));var a=n("qRz9"),i=n("l3Sj");const u="core/annotations";const l={name:"core/annotation",title:Object(i.__)("Annotation"),tagName:"mark",className:"annotation-text",attributes:{className:"class",id:"id"},edit:()=>null,__experimentalGetPropsForEditableTreePreparation(t,e){let{richTextIdentifier:n,blockClientId:r}=e;return{annotations:t(u).__experimentalGetAnnotationsForRichText(r,n)}},__experimentalCreatePrepareEditableTree(t){let{annotations:e}=t;return(t,n)=>{if(0===e.length)return t;let r={formats:t,text:n};return r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.forEach(e=>{let{start:n,end:r}=e;n>t.text.length&&(n=t.text.length),r>t.text.length&&(r=t.text.length);const o="annotation-text-"+e.source,i="annotation-text-"+e.id;t=Object(a.applyFormat)(t,{type:"core/annotation",attributes:{className:o,id:i}},n,r)}),t}(r,e),r.formats}},__experimentalGetPropsForEditableTreeChangeHandler:t=>({removeAnnotation:t(u).__experimentalRemoveAnnotation,updateAnnotationRange:t(u).__experimentalUpdateAnnotationRange}),__experimentalCreateOnChangeEditableValue:t=>e=>{const n=function(t){const e={};return t.forEach((t,n)=>{(t=(t=t||[]).filter(t=>"core/annotation"===t.type)).forEach(t=>{let{id:r}=t.attributes;r=r.replace("annotation-text-",""),e.hasOwnProperty(r)||(e[r]={start:n}),e[r].end=n+1})}),e}(e),{removeAnnotation:r,updateAnnotationRange:o,annotations:a}=t;!function(t,e,n){let{removeAnnotation:r,updateAnnotationRange:o}=n;t.forEach(t=>{const n=e[t.id];if(!n)return void r(t.id);const{start:a,end:i}=t;a===n.start&&i===n.end||o(t.id,n.start,n.end)})}(a,n,{removeAnnotation:r,updateAnnotationRange:o})}},{name:c,...s}=l;Object(a.registerFormatType)(c,s);var d=n("g56x"),f=n("1ZqX");Object(d.addFilter)("editor.BlockListBlock","core/annotations",t=>Object(f.withSelect)((t,e)=>{let{clientId:n,className:r}=e;return{className:t(u).__experimentalGetAnnotationsForBlock(n).map(t=>"is-annotated-by-"+t.source).concat(r).filter(Boolean).join(" ")}})(t));var p=n("YLtl");function v(t,e){const n=t.filter(e);return t.length===n.length?t:n}function g(t){return Object(p.isNumber)(t.start)&&Object(p.isNumber)(t.end)&&t.start<=t.end}var m=function(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"ANNOTATION_ADD":const r=n.blockClientId,o={id:n.id,blockClientId:r,richTextIdentifier:n.richTextIdentifier,source:n.source,selector:n.selector,range:n.range};if("range"===o.selector&&!g(o.range))return e;const a=null!==(t=null==e?void 0:e[r])&&void 0!==t?t:[];return{...e,[r]:[...a,o]};case"ANNOTATION_REMOVE":return Object(p.mapValues)(e,t=>v(t,t=>t.id!==n.annotationId));case"ANNOTATION_UPDATE_RANGE":return Object(p.mapValues)(e,t=>{let e=!1;const r=t.map(t=>t.id===n.annotationId?(e=!0,{...t,range:{start:n.start,end:n.end}}):t);return e?r:t});case"ANNOTATION_REMOVE_SOURCE":return Object(p.mapValues)(e,t=>v(t,t=>t.source!==n.source))}return e},h=n("pPDe");const b=[],x=Object(h.a)((t,e)=>{var n;return(null!==(n=null==t?void 0:t[e])&&void 0!==n?n:[]).filter(t=>"block"===t.selector)},(t,e)=>{var n;return[null!==(n=null==t?void 0:t[e])&&void 0!==n?n:b]});function _(t,e){var n;return null!==(n=null==t?void 0:t[e])&&void 0!==n?n:b}const A=Object(h.a)((t,e,n)=>{var r;return(null!==(r=null==t?void 0:t[e])&&void 0!==r?r:[]).filter(t=>"range"===t.selector&&n===t.richTextIdentifier).map(t=>{const{range:e,...n}=t;return{...e,...n}})},(t,e)=>{var n;return[null!==(n=null==t?void 0:t[e])&&void 0!==n?n:b]});function O(t){return Object(p.flatMap)(t,t=>t)}var y=n("7Cbv");function N(t){let{blockClientId:e,richTextIdentifier:n=null,range:r=null,selector:o="range",source:a="default",id:i=Object(y.a)()}=t;const u={type:"ANNOTATION_ADD",id:i,blockClientId:e,richTextIdentifier:n,source:a,selector:o};return"range"===o&&(u.range=r),u}function T(t){return{type:"ANNOTATION_REMOVE",annotationId:t}}function w(t,e,n){return{type:"ANNOTATION_UPDATE_RANGE",annotationId:t,start:e,end:n}}function j(t){return{type:"ANNOTATION_REMOVE_SOURCE",source:t}}const R=Object(f.createReduxStore)(u,{reducer:m,selectors:r,actions:o});Object(f.register)(R)},"7Cbv":function(t,e,n){"use strict";var r,o=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}var i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var u=function(t){return"string"==typeof t&&i.test(t)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!u(n))throw TypeError("Stringified UUID is invalid");return n};e.a=function(t,e,n){var r=(t=t||{}).random||(t.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return s(r)}},YLtl:function(t,e){t.exports=window.lodash},g56x:function(t,e){t.exports=window.wp.hooks},l3Sj:function(t,e){t.exports=window.wp.i18n},pPDe:function(t,e,n){"use strict";var r,o;function a(t){return[t]}function i(){var t={clear:function(){t.head=null}};return t}function u(t,e,n){var r;if(t.length!==e.length)return!1;for(r=n;rnull,__experimentalGetPropsForEditableTreePreparation(e,t){let{richTextIdentifier:n,blockClientId:r}=t;return{annotations:e(i).__experimentalGetAnnotationsForRichText(r,n)}},__experimentalCreatePrepareEditableTree(e){let{annotations:t}=e;return(e,n)=>{if(0===t.length)return e;let r={formats:e,text:n};return r=function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((t=>{let{start:n,end:r}=t;n>e.text.length&&(n=e.text.length),r>e.text.length&&(r=e.text.length);const a=u+t.source,i=u+t.id;e=(0,o.applyFormat)(e,{type:l,attributes:{className:a,id:i}},n,r)})),e}(r,t),r.formats}},__experimentalGetPropsForEditableTreeChangeHandler:e=>({removeAnnotation:e(i).__experimentalRemoveAnnotation,updateAnnotationRange:e(i).__experimentalUpdateAnnotationRange}),__experimentalCreateOnChangeEditableValue:e=>t=>{const n=function(e){const t={};return e.forEach(((e,n)=>{(e=(e=e||[]).filter((e=>e.type===l))).forEach((e=>{let{id:r}=e.attributes;r=r.replace(u,""),t.hasOwnProperty(r)||(t[r]={start:n}),t[r].end=n+1}))})),t}(t),{removeAnnotation:r,updateAnnotationRange:o,annotations:a}=e;!function(e,t,n){let{removeAnnotation:r,updateAnnotationRange:o}=n;e.forEach((e=>{const n=t[e.id];if(!n)return void r(e.id);const{start:a,end:i}=e;a===n.start&&i===n.end||o(e.id,n.start,n.end)}))}(a,n,{removeAnnotation:r,updateAnnotationRange:o})}},{name:c,...d}=s;(0,o.registerFormatType)(c,d);var p=window.wp.hooks,f=window.wp.data;(0,p.addFilter)("editor.BlockListBlock","core/annotations",(e=>(0,f.withSelect)(((e,t)=>{let{clientId:n,className:r}=t;return{className:e(i).__experimentalGetAnnotationsForBlock(n).map((e=>"is-annotated-by-"+e.source)).concat(r).filter(Boolean).join(" ")}}))(e)));var v=window.lodash;function m(e,t){const n=e.filter(t);return e.length===n.length?e:n}function g(e){return(0,v.isNumber)(e.start)&&(0,v.isNumber)(e.end)&&e.start<=e.end}var h,_,A=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"ANNOTATION_ADD":const r=n.blockClientId,o={id:n.id,blockClientId:r,richTextIdentifier:n.richTextIdentifier,source:n.source,selector:n.selector,range:n.range};if("range"===o.selector&&!g(o.range))return t;const a=null!==(e=null==t?void 0:t[r])&&void 0!==e?e:[];return{...t,[r]:[...a,o]};case"ANNOTATION_REMOVE":return(0,v.mapValues)(t,(e=>m(e,(e=>e.id!==n.annotationId))));case"ANNOTATION_UPDATE_RANGE":return(0,v.mapValues)(t,(e=>{let t=!1;const r=e.map((e=>e.id===n.annotationId?(t=!0,{...e,range:{start:n.start,end:n.end}}):e));return t?r:e}));case"ANNOTATION_REMOVE_SOURCE":return(0,v.mapValues)(t,(e=>m(e,(e=>e.source!==n.source))))}return t};function y(e){return[e]}function x(){var e={clear:function(){e.head=null}};return e}function N(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r{var n;return(null!==(n=null==e?void 0:e[t])&&void 0!==n?n:[]).filter((e=>"block"===e.selector))}),((e,t)=>{var n;return[null!==(n=null==e?void 0:e[t])&&void 0!==n?n:w]}));function O(e,t){var n;return null!==(n=null==e?void 0:e[t])&&void 0!==n?n:w}const I=T(((e,t,n)=>{var r;return(null!==(r=null==e?void 0:e[t])&&void 0!==r?r:[]).filter((e=>"range"===e.selector&&n===e.richTextIdentifier)).map((e=>{const{range:t,...n}=e;return{...t,...n}}))}),((e,t)=>{var n;return[null!==(n=null==e?void 0:e[t])&&void 0!==n?n:w]}));function R(e){return(0,v.flatMap)(e,(e=>e))}var E,k=new Uint8Array(16);function C(){if(!E&&!(E="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E(k)}var D=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var S=function(e){return"string"==typeof e&&D.test(e)},V=[],P=0;P<256;++P)V.push((P+256).toString(16).substr(1));var U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(V[e[t+0]]+V[e[t+1]]+V[e[t+2]]+V[e[t+3]]+"-"+V[e[t+4]]+V[e[t+5]]+"-"+V[e[t+6]]+V[e[t+7]]+"-"+V[e[t+8]]+V[e[t+9]]+"-"+V[e[t+10]]+V[e[t+11]]+V[e[t+12]]+V[e[t+13]]+V[e[t+14]]+V[e[t+15]]).toLowerCase();if(!S(n))throw TypeError("Stringified UUID is invalid");return n};var F=function(e,t,n){var r=(e=e||{}).random||(e.rng||C)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return U(r)};function G(e){let{blockClientId:t,richTextIdentifier:n=null,range:r=null,selector:o="range",source:a="default",id:i=F()}=e;const l={type:"ANNOTATION_ADD",id:i,blockClientId:t,richTextIdentifier:n,source:a,selector:o};return"range"===o&&(l.range=r),l}function M(e){return{type:"ANNOTATION_REMOVE",annotationId:e}}function B(e,t,n){return{type:"ANNOTATION_UPDATE_RANGE",annotationId:e,start:t,end:n}}function j(e){return{type:"ANNOTATION_REMOVE_SOURCE",source:e}}const W=(0,f.createReduxStore)(i,{reducer:A,selectors:n,actions:r});(0,f.register)(W),(window.wp=window.wp||{}).annotations=t}(); \ No newline at end of file diff --git a/wp-includes/js/dist/api-fetch.js b/wp-includes/js/dist/api-fetch.js index 72f02e38dc..4703c39055 100644 --- a/wp-includes/js/dist/api-fetch.js +++ b/wp-includes/js/dist/api-fetch.js @@ -1,110 +1,37 @@ -this["wp"] = this["wp"] || {}; this["wp"]["apiFetch"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "jqrR"); -/******/ }) +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ /************************************************************************/ -/******/ ({ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; -/***/ "Mmq9": -/***/ (function(module, exports) { +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* binding */ build_module; } +}); -(function() { module.exports = window["wp"]["url"]; }()); - -/***/ }), - -/***/ "jqrR": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js +;// CONCATENATED MODULE: external ["wp","i18n"] +var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js /** * @param {string} nonce * @return {import('../types').APIFetchMiddleware & { nonce: string }} A middleware to enhance a request with a nonce. @@ -138,7 +65,7 @@ function createNonceMiddleware(nonce) { /* harmony default export */ var nonce = (createNonceMiddleware); -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js /** * @type {import('../types').APIFetchMiddleware} */ @@ -166,7 +93,7 @@ const namespaceAndEndpointMiddleware = (options, next) => { /* harmony default export */ var namespace_endpoint = (namespaceAndEndpointMiddleware); -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js /** * Internal dependencies */ @@ -207,10 +134,9 @@ const createRootURLMiddleware = rootURL => (options, next) => { /* harmony default export */ var root_url = (createRootURLMiddleware); -// EXTERNAL MODULE: external ["wp","url"] -var external_wp_url_ = __webpack_require__("Mmq9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js +;// CONCATENATED MODULE: external ["wp","url"] +var external_wp_url_namespaceObject = window["wp"]["url"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js /** * WordPress dependencies */ @@ -222,7 +148,7 @@ var external_wp_url_ = __webpack_require__("Mmq9"); function createPreloadingMiddleware(preloadedData) { const cache = Object.keys(preloadedData).reduce((result, path) => { - result[Object(external_wp_url_["normalizePath"])(path)] = preloadedData[path]; + result[(0,external_wp_url_namespaceObject.normalizePath)(path)] = preloadedData[path]; return result; }, /** @type {Record} */ @@ -236,7 +162,7 @@ function createPreloadingMiddleware(preloadedData) { let rawPath = options.path; if (!rawPath && options.url) { - const pathFromQuery = Object(external_wp_url_["getQueryArg"])(options.url, 'rest_route'); + const pathFromQuery = (0,external_wp_url_namespaceObject.getQueryArg)(options.url, 'rest_route'); if (typeof pathFromQuery === 'string') { rawPath = pathFromQuery; @@ -245,7 +171,7 @@ function createPreloadingMiddleware(preloadedData) { if (typeof rawPath === 'string') { const method = options.method || 'GET'; - const path = Object(external_wp_url_["normalizePath"])(rawPath); + const path = (0,external_wp_url_namespaceObject.normalizePath)(rawPath); if ('GET' === method && cache[path]) { const cacheData = cache[path]; // Unsetting the cache key ensures that the data is only used a single time @@ -270,7 +196,7 @@ function createPreloadingMiddleware(preloadedData) { /* harmony default export */ var preloading = (createPreloadingMiddleware); -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js /** * WordPress dependencies */ @@ -295,8 +221,8 @@ const modifyQuery = (_ref, queryArgs) => { ...options } = _ref; return { ...options, - url: url && Object(external_wp_url_["addQueryArgs"])(url, queryArgs), - path: path && Object(external_wp_url_["addQueryArgs"])(path, queryArgs) + url: url && (0,external_wp_url_namespaceObject.addQueryArgs)(url, queryArgs), + path: path && (0,external_wp_url_namespaceObject.addQueryArgs)(path, queryArgs) }; }; /** @@ -411,7 +337,7 @@ const fetchAllMiddleware = async (options, next) => { /* harmony default export */ var fetch_all_middleware = (fetchAllMiddleware); -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js /** * Set of HTTP methods which are eligible to be overridden. * @@ -457,7 +383,7 @@ const httpV1Middleware = (options, next) => { /* harmony default export */ var http_v1 = (httpV1Middleware); -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js /** * WordPress dependencies */ @@ -467,14 +393,14 @@ const httpV1Middleware = (options, next) => { */ const userLocaleMiddleware = (options, next) => { - if (typeof options.url === 'string' && !Object(external_wp_url_["hasQueryArg"])(options.url, '_locale')) { - options.url = Object(external_wp_url_["addQueryArgs"])(options.url, { + if (typeof options.url === 'string' && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.url, '_locale')) { + options.url = (0,external_wp_url_namespaceObject.addQueryArgs)(options.url, { _locale: 'user' }); } - if (typeof options.path === 'string' && !Object(external_wp_url_["hasQueryArg"])(options.path, '_locale')) { - options.path = Object(external_wp_url_["addQueryArgs"])(options.path, { + if (typeof options.path === 'string' && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.path, '_locale')) { + options.path = (0,external_wp_url_namespaceObject.addQueryArgs)(options.path, { _locale: 'user' }); } @@ -484,7 +410,7 @@ const userLocaleMiddleware = (options, next) => { /* harmony default export */ var user_locale = (userLocaleMiddleware); -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/utils/response.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/utils/response.js /** * WordPress dependencies */ @@ -523,7 +449,7 @@ const response_parseResponse = function (response) { const parseJsonAndNormalizeError = response => { const invalidJsonError = { code: 'invalid_json', - message: Object(external_wp_i18n_["__"])('The response is not a valid JSON response.') + message: (0,external_wp_i18n_namespaceObject.__)('The response is not a valid JSON response.') }; if (!response || !response.json) { @@ -566,13 +492,13 @@ function parseAndThrowError(response) { return parseJsonAndNormalizeError(response).then(error => { const unknownError = { code: 'unknown_error', - message: Object(external_wp_i18n_["__"])('An unknown error occurred.') + message: (0,external_wp_i18n_namespaceObject.__)('An unknown error occurred.') }; throw error || unknownError; }); } -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/media-upload.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/media-upload.js /** * WordPress dependencies */ @@ -643,7 +569,7 @@ const mediaUploadMiddleware = (options, next) => { if (options.parse !== false) { return Promise.reject({ code: 'post_process', - message: Object(external_wp_i18n_["__"])('Media upload failed. If this is a photo or a large image, please scale it down and try again.') + message: (0,external_wp_i18n_namespaceObject.__)('Media upload failed. If this is a photo or a large image, please scale it down and try again.') }); } @@ -657,7 +583,7 @@ const mediaUploadMiddleware = (options, next) => { /* harmony default export */ var media_upload = (mediaUploadMiddleware); -// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/index.js /** * WordPress dependencies */ @@ -778,7 +704,7 @@ const defaultFetchHandler = nextOptions => { throw { code: 'fetch_error', - message: Object(external_wp_i18n_["__"])('You are probably offline.') + message: (0,external_wp_i18n_namespaceObject.__)('You are probably offline.') }; }); }; @@ -836,16 +762,8 @@ apiFetch.createPreloadingMiddleware = preloading; apiFetch.createRootURLMiddleware = root_url; apiFetch.fetchAllMiddleware = fetch_all_middleware; apiFetch.mediaUploadMiddleware = media_upload; -/* harmony default export */ var build_module = __webpack_exports__["default"] = (apiFetch); +/* harmony default export */ var build_module = (apiFetch); - -/***/ }), - -/***/ "l3Sj": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["i18n"]; }()); - -/***/ }) - -/******/ })["default"]; \ No newline at end of file +(window.wp = window.wp || {}).apiFetch = __webpack_exports__["default"]; +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/js/dist/api-fetch.min.js b/wp-includes/js/dist/api-fetch.min.js index 58eb28e50f..cf03cc4f77 100644 --- a/wp-includes/js/dist/api-fetch.min.js +++ b/wp-includes/js/dist/api-fetch.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -this.wp=this.wp||{},this.wp.apiFetch=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="jqrR")}({Mmq9:function(e,t){e.exports=window.wp.url},jqrR:function(e,t,r){"use strict";r.r(t);var n=r("l3Sj");var o=function(e){const t=(e,r)=>{const{headers:n={}}=e;for(const o in n)if("x-wp-nonce"===o.toLowerCase()&&n[o]===t.nonce)return r(e);return r({...e,headers:{...n,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t};var a=(e,t)=>{let r,n,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,""),n=e.endpoint.replace(/^\//,""),o=n?r+"/"+n:r),delete e.namespace,delete e.endpoint,t({...e,path:o})};var s=e=>(t,r)=>a(t,t=>{let n,o=t.url,a=t.path;return"string"==typeof a&&(n=e,-1!==e.indexOf("?")&&(a=a.replace("?","&")),a=a.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(a=a.replace("?","&")),o=n+a),r({...t,url:o})}),c=r("Mmq9");var i=function(e){const t=Object.keys(e).reduce((t,r)=>(t[Object(c.normalizePath)(r)]=e[r],t),{});return(e,r)=>{const{parse:n=!0}=e;let o=e.path;if(!o&&e.url){const t=Object(c.getQueryArg)(e.url,"rest_route");"string"==typeof t&&(o=t)}if("string"==typeof o){const r=e.method||"GET",a=Object(c.normalizePath)(o);if("GET"===r&&t[a]){const e=t[a];return delete t[a],Promise.resolve(n?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}if("OPTIONS"===r&&t[r]&&t[r][a]){const e=t[r][a];return delete t[r][a],Promise.resolve(n?e.body:e)}}return r(e)}};const u=(e,t)=>{let{path:r,url:n,...o}=e;return{...o,url:n&&Object(c.addQueryArgs)(n,t),path:r&&Object(c.addQueryArgs)(r,t)}},d=e=>e.json?e.json():Promise.reject(e),l=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}})(e.headers.get("link"));return t};var p=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),r=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||r})(e))return t(e);const r=await T({...u(e,{per_page:100}),parse:!1}),n=await d(r);if(!Array.isArray(n))return n;let o=l(r);if(!o)return n;let a=[].concat(n);for(;o;){const t=await T({...e,path:void 0,url:o,parse:!1}),r=await d(t);a=a.concat(r),o=l(t)}return a};const h=new Set(["PATCH","PUT","DELETE"]),f="GET";const w=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},m=e=>{const t={code:"invalid_json",message:Object(n.__)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},g=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(w(e,t)).catch(e=>y(e,t))};function y(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return m(e).then(e=>{const t={code:"unknown_error",message:Object(n.__)("An unknown error occurred.")};throw e||t})}var j=(e,t)=>{if(!function(e){const t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);let r=0;const o=e=>(r++,t({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>r<5?o(e):(t({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(t=>{const r=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&r?o(r).catch(()=>!1!==e.parse?Promise.reject({code:"post_process",message:Object(n.__)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)):y(t,e.parse)}).then(t=>g(t,e.parse))};const O={Accept:"application/json, */*;q=0.1"},b={credentials:"include"},v=[(e,t)=>("string"!=typeof e.url||Object(c.hasQueryArg)(e.url,"_locale")||(e.url=Object(c.addQueryArgs)(e.url,{_locale:"user"})),"string"!=typeof e.path||Object(c.hasQueryArg)(e.path,"_locale")||(e.path=Object(c.addQueryArgs)(e.path,{_locale:"user"})),t(e)),a,(e,t)=>{const{method:r=f}=e;return h.has(r.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":r,"Content-Type":"application/json"},method:"POST"}),t(e)},p];const _=e=>{if(e.status>=200&&e.status<300)return e;throw e};let P=e=>{const{url:t,path:r,data:o,parse:a=!0,...s}=e;let{body:c,headers:i}=e;i={...O,...i},o&&(c=JSON.stringify(o),i["Content-Type"]="application/json");return window.fetch(t||r||window.location.href,{...b,...s,body:c,headers:i}).then(e=>Promise.resolve(e).then(_).catch(e=>y(e,a)).then(e=>g(e,a)),e=>{if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:Object(n.__)("You are probably offline.")}})};function x(e){return v.reduceRight((e,t)=>r=>t(r,e),P)(e).catch(t=>"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(x.nonceEndpoint).then(_).then(e=>e.text()).then(t=>(x.nonceMiddleware.nonce=t,x(e))))}x.use=function(e){v.unshift(e)},x.setFetchHandler=function(e){P=e},x.createNonceMiddleware=o,x.createPreloadingMiddleware=i,x.createRootURLMiddleware=s,x.fetchAllMiddleware=p,x.mediaUploadMiddleware=j;var T=t.default=x},l3Sj:function(e,t){e.exports=window.wp.i18n}}).default; \ No newline at end of file +!function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return A}});var r=window.wp.i18n;var n=function(e){const t=(e,r)=>{const{headers:n={}}=e;for(const o in n)if("x-wp-nonce"===o.toLowerCase()&&n[o]===t.nonce)return r(e);return r({...e,headers:{...n,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t};var o=(e,t)=>{let r,n,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,""),n=e.endpoint.replace(/^\//,""),o=n?r+"/"+n:r),delete e.namespace,delete e.endpoint,t({...e,path:o})};var a=e=>(t,r)=>o(t,(t=>{let n,o=t.url,a=t.path;return"string"==typeof a&&(n=e,-1!==e.indexOf("?")&&(a=a.replace("?","&")),a=a.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(a=a.replace("?","&")),o=n+a),r({...t,url:o})})),s=window.wp.url;var i=function(e){const t=Object.keys(e).reduce(((t,r)=>(t[(0,s.normalizePath)(r)]=e[r],t)),{});return(e,r)=>{const{parse:n=!0}=e;let o=e.path;if(!o&&e.url){const t=(0,s.getQueryArg)(e.url,"rest_route");"string"==typeof t&&(o=t)}if("string"==typeof o){const r=e.method||"GET",a=(0,s.normalizePath)(o);if("GET"===r&&t[a]){const e=t[a];return delete t[a],Promise.resolve(n?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}if("OPTIONS"===r&&t[r]&&t[r][a]){const e=t[r][a];return delete t[r][a],Promise.resolve(n?e.body:e)}}return r(e)}};const c=(e,t)=>{let{path:r,url:n,...o}=e;return{...o,url:n&&(0,s.addQueryArgs)(n,t),path:r&&(0,s.addQueryArgs)(r,t)}},d=e=>e.json?e.json():Promise.reject(e),u=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}})(e.headers.get("link"));return t};var p=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),r=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||r})(e))return t(e);const r=await A({...c(e,{per_page:100}),parse:!1}),n=await d(r);if(!Array.isArray(n))return n;let o=u(r);if(!o)return n;let a=[].concat(n);for(;o;){const t=await A({...e,path:void 0,url:o,parse:!1}),r=await d(t);a=a.concat(r),o=u(t)}return a};const l=new Set(["PATCH","PUT","DELETE"]),h="GET";const f=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},w=e=>{const t={code:"invalid_json",message:(0,r.__)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((()=>{throw t}))},g=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(f(e,t)).catch((e=>m(e,t)))};function m(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return w(e).then((e=>{const t={code:"unknown_error",message:(0,r.__)("An unknown error occurred.")};throw e||t}))}var y=(e,t)=>{if(!function(e){const t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);let n=0;const o=e=>(n++,t({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((()=>n<5?o(e):(t({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject()))));return t({...e,parse:!1}).catch((t=>{const n=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&n?o(n).catch((()=>!1!==e.parse?Promise.reject({code:"post_process",message:(0,r.__)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t))):m(t,e.parse)})).then((t=>g(t,e.parse)))};const v={Accept:"application/json, */*;q=0.1"},P={credentials:"include"},_=[(e,t)=>("string"!=typeof e.url||(0,s.hasQueryArg)(e.url,"_locale")||(e.url=(0,s.addQueryArgs)(e.url,{_locale:"user"})),"string"!=typeof e.path||(0,s.hasQueryArg)(e.path,"_locale")||(e.path=(0,s.addQueryArgs)(e.path,{_locale:"user"})),t(e)),o,(e,t)=>{const{method:r=h}=e;return l.has(r.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":r,"Content-Type":"application/json"},method:"POST"}),t(e)},p];const O=e=>{if(e.status>=200&&e.status<300)return e;throw e};let j=e=>{const{url:t,path:n,data:o,parse:a=!0,...s}=e;let{body:i,headers:c}=e;c={...v,...c},o&&(i=JSON.stringify(o),c["Content-Type"]="application/json");return window.fetch(t||n||window.location.href,{...P,...s,body:i,headers:c}).then((e=>Promise.resolve(e).then(O).catch((e=>m(e,a))).then((e=>g(e,a)))),(e=>{if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:(0,r.__)("You are probably offline.")}}))};function T(e){return _.reduceRight(((e,t)=>r=>t(r,e)),j)(e).catch((t=>"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(T.nonceEndpoint).then(O).then((e=>e.text())).then((t=>(T.nonceMiddleware.nonce=t,T(e))))))}T.use=function(e){_.unshift(e)},T.setFetchHandler=function(e){j=e},T.createNonceMiddleware=n,T.createPreloadingMiddleware=i,T.createRootURLMiddleware=a,T.fetchAllMiddleware=p,T.mediaUploadMiddleware=y;var A=T;(window.wp=window.wp||{}).apiFetch=t.default}(); \ No newline at end of file diff --git a/wp-includes/js/dist/autop.js b/wp-includes/js/dist/autop.js index f9c19e1bf1..9cb85c8187 100644 --- a/wp-includes/js/dist/autop.js +++ b/wp-includes/js/dist/autop.js @@ -1,99 +1,44 @@ -this["wp"] = this["wp"] || {}; this["wp"]["autop"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "zbAn"); -/******/ }) +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ /************************************************************************/ -/******/ ({ - -/***/ "zbAn": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(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 (binding) */ __webpack_require__.d(__webpack_exports__, "autop", function() { return autop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removep", function() { return removep; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "autop": function() { return /* binding */ autop; }, +/* harmony export */ "removep": function() { return /* binding */ removep; } +/* harmony export */ }); /** * The regular expression for an HTML element. * @@ -492,7 +437,6 @@ function removep(html) { return html; } - -/***/ }) - -/******/ }); \ No newline at end of file +(window.wp = window.wp || {}).autop = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/js/dist/autop.min.js b/wp-includes/js/dist/autop.min.js index f150bb9814..52a8c7c462 100644 --- a/wp-includes/js/dist/autop.min.js +++ b/wp-includes/js/dist/autop.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -this.wp=this.wp||{},this.wp.autop=function(e){var n={};function r(p){if(n[p])return n[p].exports;var t=n[p]={i:p,l:!1,exports:{}};return e[p].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=e,r.c=n,r.d=function(e,n,p){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:p})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)r.d(p,t,function(n){return e[n]}.bind(null,t));return p},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s="zbAn")}({zbAn:function(e,n,r){"use strict";r.r(n),r.d(n,"autop",(function(){return c})),r.d(n,"removep",(function(){return l}));const p=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");function t(e,n){const r=function(e){const n=[];let r,t=e;for(;r=t.match(p);){const e=r.index;n.push(t.slice(0,e)),n.push(r[0]),t=t.slice(e+r[0].length)}return t.length&&n.push(t),n}(e);let t=!1;const c=Object.keys(n);for(let e=1;e1&&void 0!==arguments[1])||arguments[1];const r=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf(""),p=n.pop();e="";for(let p=0;p";r.push([l,t.substr(c)+""]),e+=t.substr(0,c)+l}e+=p}const p="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=t(e=(e=(e=(e=e.replace(/\s*/g,"\n\n")).replace(new RegExp("(<"+p+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("()","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("\s*/g,"")),-1!==e.indexOf("")&&(e=(e=(e=e.replace(/(]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("]*>)/,"$1")).replace(/<\/figcaption>\s*/,""));const c=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",c.forEach(n=>{e+="

"+n.replace(/^\n*|\n*$/g,"")+"

\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/

\s*<\/p>/g,"")).replace(/

([^<]+)<\/(div|address|form)>/g,"

$1

")).replace(new RegExp("

\\s*(]*>)\\s*

","g"),"$1")).replace(/

(/g,"$1")).replace(/

]*)>/gi,"

")).replace(/<\/blockquote><\/p>/g,"

")).replace(new RegExp("

\\s*(]*>)","g"),"$1")).replace(new RegExp("(]*>)\\s*

","g"),"$1"),n&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,e=>e[0].replace(/\n/g,""))).replace(/
|/g,"
")).replace(/(
)?\s*\n/g,(e,n)=>n?e:"
\n")).replace(//g,"\n")),e=(e=(e=e.replace(new RegExp("(]*>)\\s*
","g"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"

"),r.forEach(n=>{const[r,p]=n;e=e.replace(r,p)}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?\s?/g,"\n")),e}function l(e){const n="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",r=n+"|div|p",p=n+"|pre",t=[];let c=!1,l=!1;return e?(-1===e.indexOf("]*>[\s\S]*?<\/\1>/g,e=>(t.push(e),""))),-1!==e.indexOf("]*>[\s\S]+?<\/pre>/g,e=>(e=(e=e.replace(/
(\r\n|\n)?/g,"")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"")).replace(/\r?\n/g,""))),-1!==e.indexOf("[caption")&&(l=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,e=>e.replace(/]*)>/g,"").replace(/[\r\n\t]+/,""))),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*\\s*","g"),"\n")).replace(new RegExp("\\s*<((?:"+r+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(

]+>[\s\S]*?)<\/p>/g,"$1")).replace(/]*)?>\s*

/gi,"\n\n")).replace(/\s*

/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)
\s*/gi,(e,n)=>n&&-1!==n.indexOf("\n")?"\n\n":"\n")).replace(/\s*

\s*/g,"
\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:"+p+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(new RegExp("\\s*\\s*","g"),"\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("/g,"\n")),-1!==e.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==e.indexOf("/g,e=>e.replace(/[\r\n]+/g,""))),e=(e=(e=(e=e.replace(/<\/p#>/g,"

\n")).replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),c&&(e=e.replace(//g,"\n")),l&&(e=e.replace(/]*)>/g,"")),t.length&&(e=e.replace(//g,()=>t.shift())),e):""}}}); \ No newline at end of file +!function(){"use strict";var e={d:function(n,p){for(var r in p)e.o(p,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:p[r]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(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,{autop:function(){return t},removep:function(){return c}});const p=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");function r(e,n){const r=function(e){const n=[];let r,t=e;for(;r=t.match(p);){const e=r.index;n.push(t.slice(0,e)),n.push(r[0]),t=t.slice(e+r[0].length)}return t.length&&n.push(t),n}(e);let t=!1;const c=Object.keys(n);for(let e=1;e1&&void 0!==arguments[1])||arguments[1];const p=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf(""),r=n.pop();e="";for(let r=0;r";p.push([l,t.substr(c)+""]),e+=t.substr(0,c)+l}e+=r}const t="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=r(e=(e=(e=(e=e.replace(/\s*/g,"\n\n")).replace(new RegExp("(<"+t+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("()","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("\s*/g,"")),-1!==e.indexOf("")&&(e=(e=(e=e.replace(/(]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("]*>)/,"$1")).replace(/<\/figcaption>\s*/,""));const c=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",c.forEach((n=>{e+="

"+n.replace(/^\n*|\n*$/g,"")+"

\n"})),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/

\s*<\/p>/g,"")).replace(/

([^<]+)<\/(div|address|form)>/g,"

$1

")).replace(new RegExp("

\\s*(]*>)\\s*

","g"),"$1")).replace(/

(/g,"$1")).replace(/

]*)>/gi,"

")).replace(/<\/blockquote><\/p>/g,"

")).replace(new RegExp("

\\s*(]*>)","g"),"$1")).replace(new RegExp("(]*>)\\s*

","g"),"$1"),n&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,(e=>e[0].replace(/\n/g,"")))).replace(/
|/g,"
")).replace(/(
)?\s*\n/g,((e,n)=>n?e:"
\n"))).replace(//g,"\n")),e=(e=(e=e.replace(new RegExp("(]*>)\\s*
","g"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"

"),p.forEach((n=>{const[p,r]=n;e=e.replace(p,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?\s?/g,"\n")),e}function c(e){const n="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",p=n+"|div|p",r=n+"|pre",t=[];let c=!1,l=!1;return e?(-1===e.indexOf("]*>[\s\S]*?<\/\1>/g,(e=>(t.push(e),"")))),-1!==e.indexOf("]*>[\s\S]+?<\/pre>/g,(e=>(e=(e=e.replace(/
(\r\n|\n)?/g,"")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"")).replace(/\r?\n/g,"")))),-1!==e.indexOf("[caption")&&(l=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,(e=>e.replace(/]*)>/g,"").replace(/[\r\n\t]+/,"")))),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*\\s*","g"),"\n")).replace(new RegExp("\\s*<((?:"+p+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(

]+>[\s\S]*?)<\/p>/g,"$1")).replace(/]*)?>\s*

/gi,"\n\n")).replace(/\s*

/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)
\s*/gi,((e,n)=>n&&-1!==n.indexOf("\n")?"\n\n":"\n"))).replace(/\s*

\s*/g,"
\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(new RegExp("\\s*\\s*","g"),"\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("/g,"\n")),-1!==e.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==e.indexOf("/g,(e=>e.replace(/[\r\n]+/g,"")))),e=(e=(e=(e=e.replace(/<\/p#>/g,"

\n")).replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),c&&(e=e.replace(//g,"\n")),l&&(e=e.replace(/]*)>/g,"")),t.length&&(e=e.replace(//g,(()=>t.shift()))),e):""}(window.wp=window.wp||{}).autop=n}(); \ No newline at end of file diff --git a/wp-includes/js/dist/blob.js b/wp-includes/js/dist/blob.js index 883d1747a4..b19e68b4ab 100644 --- a/wp-includes/js/dist/blob.js +++ b/wp-includes/js/dist/blob.js @@ -1,102 +1,47 @@ -this["wp"] = this["wp"] || {}; this["wp"]["blob"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "ca5x"); -/******/ }) +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ /************************************************************************/ -/******/ ({ - -/***/ "ca5x": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(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 (binding) */ __webpack_require__.d(__webpack_exports__, "createBlobURL", function() { return createBlobURL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlobByURL", function() { return getBlobByURL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlobTypeByURL", function() { return getBlobTypeByURL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revokeBlobURL", function() { return revokeBlobURL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlobURL", function() { return isBlobURL; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "createBlobURL": function() { return /* binding */ createBlobURL; }, +/* harmony export */ "getBlobByURL": function() { return /* binding */ getBlobByURL; }, +/* harmony export */ "getBlobTypeByURL": function() { return /* binding */ getBlobTypeByURL; }, +/* harmony export */ "isBlobURL": function() { return /* binding */ isBlobURL; }, +/* harmony export */ "revokeBlobURL": function() { return /* binding */ revokeBlobURL; } +/* harmony export */ }); /** * Browser dependencies */ @@ -179,7 +124,6 @@ function isBlobURL(url) { return url.indexOf('blob:') === 0; } - -/***/ }) - -/******/ }); \ No newline at end of file +(window.wp = window.wp || {}).blob = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/js/dist/blob.min.js b/wp-includes/js/dist/blob.min.js index 4098f36329..ad54f5081a 100644 --- a/wp-includes/js/dist/blob.min.js +++ b/wp-includes/js/dist/blob.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -this.wp=this.wp||{},this.wp.blob=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="ca5x")}({ca5x:function(e,t,n){"use strict";n.r(t),n.d(t,"createBlobURL",(function(){return i})),n.d(t,"getBlobByURL",(function(){return c})),n.d(t,"getBlobTypeByURL",(function(){return f})),n.d(t,"revokeBlobURL",(function(){return l})),n.d(t,"isBlobURL",(function(){return d}));const{createObjectURL:r,revokeObjectURL:o}=window.URL,u={};function i(e){const t=r(e);return u[t]=e,t}function c(e){return u[e]}function f(e){var t;return null===(t=c(e))||void 0===t?void 0:t.type.split("/")[0]}function l(e){u[e]&&o(e),delete u[e]}function d(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}}}); \ No newline at end of file +!function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(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,{createBlobURL:function(){return u},getBlobByURL:function(){return i},getBlobTypeByURL:function(){return c},isBlobURL:function(){return l},revokeBlobURL:function(){return f}});const{createObjectURL:t,revokeObjectURL:o}=window.URL,r={};function u(e){const n=t(e);return r[n]=e,n}function i(e){return r[e]}function c(e){var n;return null===(n=i(e))||void 0===n?void 0:n.type.split("/")[0]}function f(e){r[e]&&o(e),delete r[e]}function l(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}(window.wp=window.wp||{}).blob=n}(); \ No newline at end of file diff --git a/wp-includes/js/dist/block-directory.js b/wp-includes/js/dist/block-directory.js index 09d18403d1..2d872257cb 100644 --- a/wp-includes/js/dist/block-directory.js +++ b/wp-includes/js/dist/block-directory.js @@ -1,186 +1,110 @@ -this["wp"] = this["wp"] || {}; this["wp"]["blockDirectory"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "7f3f"); -/******/ }) +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ /************************************************************************/ -/******/ ({ - -/***/ "//Lo": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const blockDefault = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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 */ __webpack_exports__["a"] = (blockDefault); - - -/***/ }), - -/***/ "1ZqX": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["data"]; }()); - -/***/ }), - -/***/ "7f3f": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(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__, "store", function() { return /* reexport */ store; }); +__webpack_require__.d(__webpack_exports__, { + "store": function() { return /* reexport */ store; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); -__webpack_require__.d(selectors_namespaceObject, "isRequestingDownloadableBlocks", function() { return selectors_isRequestingDownloadableBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getDownloadableBlocks", function() { return selectors_getDownloadableBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getInstalledBlockTypes", function() { return getInstalledBlockTypes; }); -__webpack_require__.d(selectors_namespaceObject, "getNewBlockTypes", function() { return getNewBlockTypes; }); -__webpack_require__.d(selectors_namespaceObject, "getUnusedBlockTypes", function() { return getUnusedBlockTypes; }); -__webpack_require__.d(selectors_namespaceObject, "isInstalling", function() { return selectors_isInstalling; }); -__webpack_require__.d(selectors_namespaceObject, "getErrorNotices", function() { return getErrorNotices; }); -__webpack_require__.d(selectors_namespaceObject, "getErrorNoticeForBlock", function() { return selectors_getErrorNoticeForBlock; }); +__webpack_require__.d(selectors_namespaceObject, { + "getDownloadableBlocks": function() { return getDownloadableBlocks; }, + "getErrorNoticeForBlock": function() { return getErrorNoticeForBlock; }, + "getErrorNotices": function() { return getErrorNotices; }, + "getInstalledBlockTypes": function() { return getInstalledBlockTypes; }, + "getNewBlockTypes": function() { return getNewBlockTypes; }, + "getUnusedBlockTypes": function() { return getUnusedBlockTypes; }, + "isInstalling": function() { return isInstalling; }, + "isRequestingDownloadableBlocks": function() { return isRequestingDownloadableBlocks; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); -__webpack_require__.d(actions_namespaceObject, "fetchDownloadableBlocks", function() { return fetchDownloadableBlocks; }); -__webpack_require__.d(actions_namespaceObject, "receiveDownloadableBlocks", function() { return receiveDownloadableBlocks; }); -__webpack_require__.d(actions_namespaceObject, "installBlockType", function() { return actions_installBlockType; }); -__webpack_require__.d(actions_namespaceObject, "uninstallBlockType", function() { return actions_uninstallBlockType; }); -__webpack_require__.d(actions_namespaceObject, "addInstalledBlockType", function() { return addInstalledBlockType; }); -__webpack_require__.d(actions_namespaceObject, "removeInstalledBlockType", function() { return removeInstalledBlockType; }); -__webpack_require__.d(actions_namespaceObject, "setIsInstalling", function() { return setIsInstalling; }); -__webpack_require__.d(actions_namespaceObject, "setErrorNotice", function() { return setErrorNotice; }); -__webpack_require__.d(actions_namespaceObject, "clearErrorNotice", function() { return clearErrorNotice; }); +__webpack_require__.d(actions_namespaceObject, { + "addInstalledBlockType": function() { return addInstalledBlockType; }, + "clearErrorNotice": function() { return clearErrorNotice; }, + "fetchDownloadableBlocks": function() { return fetchDownloadableBlocks; }, + "installBlockType": function() { return installBlockType; }, + "receiveDownloadableBlocks": function() { return receiveDownloadableBlocks; }, + "removeInstalledBlockType": function() { return removeInstalledBlockType; }, + "setErrorNotice": function() { return setErrorNotice; }, + "setIsInstalling": function() { return setIsInstalling; }, + "uninstallBlockType": function() { return uninstallBlockType; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js var resolvers_namespaceObject = {}; __webpack_require__.r(resolvers_namespaceObject); -__webpack_require__.d(resolvers_namespaceObject, "getDownloadableBlocks", function() { return resolvers_getDownloadableBlocks; }); +__webpack_require__.d(resolvers_namespaceObject, { + "getDownloadableBlocks": function() { return resolvers_getDownloadableBlocks; } +}); -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","plugins"] -var external_wp_plugins_ = __webpack_require__("TvNi"); - -// EXTERNAL MODULE: external ["wp","hooks"] -var external_wp_hooks_ = __webpack_require__("g56x"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","editor"] -var external_wp_editor_ = __webpack_require__("jSdM"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js +;// CONCATENATED MODULE: external ["wp","element"] +var external_wp_element_namespaceObject = window["wp"]["element"]; +;// CONCATENATED MODULE: external ["wp","plugins"] +var external_wp_plugins_namespaceObject = window["wp"]["plugins"]; +;// CONCATENATED MODULE: external ["wp","hooks"] +var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; +;// CONCATENATED MODULE: external ["wp","blocks"] +var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; +;// CONCATENATED MODULE: external ["wp","data"] +var external_wp_data_namespaceObject = window["wp"]["data"]; +;// CONCATENATED MODULE: external ["wp","editor"] +var external_wp_editor_namespaceObject = window["wp"]["editor"]; +;// CONCATENATED MODULE: external "lodash" +var external_lodash_namespaceObject = window["lodash"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js /** * External dependencies */ @@ -282,21 +206,20 @@ const errorNotices = function () { }; case 'CLEAR_ERROR_NOTICE': - return Object(external_lodash_["omit"])(state, action.blockId); + return (0,external_lodash_namespaceObject.omit)(state, action.blockId); } return state; }; -/* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({ +/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ downloadableBlocks, blockManagement, errorNotices })); -// EXTERNAL MODULE: external ["wp","blockEditor"] -var external_wp_blockEditor_ = __webpack_require__("axFQ"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js +;// CONCATENATED MODULE: external ["wp","blockEditor"] +var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js /** * Check if a block list contains a specific block type. Recursively searches * through `innerBlocks` if they exist. @@ -331,7 +254,7 @@ function hasBlockType(blockType) { return false; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js /** * WordPress dependencies */ @@ -351,7 +274,7 @@ function hasBlockType(blockType) { * @return {boolean} Whether a request is in progress for the blocks list. */ -function selectors_isRequestingDownloadableBlocks(state, filterValue) { +function isRequestingDownloadableBlocks(state, filterValue) { var _state$downloadableBl, _state$downloadableBl2; return (_state$downloadableBl = (_state$downloadableBl2 = state.downloadableBlocks[filterValue]) === null || _state$downloadableBl2 === void 0 ? void 0 : _state$downloadableBl2.isRequesting) !== null && _state$downloadableBl !== void 0 ? _state$downloadableBl : false; @@ -365,7 +288,7 @@ function selectors_isRequestingDownloadableBlocks(state, filterValue) { * @return {Array} Downloadable blocks. */ -function selectors_getDownloadableBlocks(state, filterValue) { +function getDownloadableBlocks(state, filterValue) { var _state$downloadableBl3, _state$downloadableBl4; return (_state$downloadableBl3 = (_state$downloadableBl4 = state.downloadableBlocks[filterValue]) === null || _state$downloadableBl4 === void 0 ? void 0 : _state$downloadableBl4.results) !== null && _state$downloadableBl3 !== void 0 ? _state$downloadableBl3 : []; @@ -391,8 +314,8 @@ function getInstalledBlockTypes(state) { * @return {Array} Block type items. */ -const getNewBlockTypes = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const usedBlockTree = select(external_wp_blockEditor_["store"]).getBlocks(); +const getNewBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); const installedBlockTypes = getInstalledBlockTypes(state); return installedBlockTypes.filter(blockType => hasBlockType(blockType, usedBlockTree)); }); @@ -405,8 +328,8 @@ const getNewBlockTypes = Object(external_wp_data_["createRegistrySelector"])(sel * @return {Array} Block type items. */ -const getUnusedBlockTypes = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const usedBlockTree = select(external_wp_blockEditor_["store"]).getBlocks(); +const getUnusedBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); const installedBlockTypes = getInstalledBlockTypes(state); return installedBlockTypes.filter(blockType => !hasBlockType(blockType, usedBlockTree)); }); @@ -419,7 +342,7 @@ const getUnusedBlockTypes = Object(external_wp_data_["createRegistrySelector"])( * @return {boolean} Whether this block is currently being installed. */ -function selectors_isInstalling(state, blockId) { +function isInstalling(state, blockId) { return state.blockManagement.isInstalling[blockId] || false; } /** @@ -442,21 +365,18 @@ function getErrorNotices(state) { * @return {string|boolean} The error text, or false if no error. */ -function selectors_getErrorNoticeForBlock(state, blockId) { +function getErrorNoticeForBlock(state, blockId) { return state.errorNotices[blockId]; } -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","apiFetch"] -var external_wp_apiFetch_ = __webpack_require__("ywyh"); -var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_); - -// EXTERNAL MODULE: external ["wp","notices"] -var external_wp_notices_ = __webpack_require__("onLe"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/load-assets.js +;// CONCATENATED MODULE: external ["wp","i18n"] +var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +;// CONCATENATED MODULE: external ["wp","apiFetch"] +var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; +var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); +;// CONCATENATED MODULE: external ["wp","notices"] +var external_wp_notices_namespaceObject = window["wp"]["notices"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/load-assets.js /** * WordPress dependencies */ @@ -529,7 +449,7 @@ async function loadAssets() { } } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/get-plugin-url.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/get-plugin-url.js /** * Get the plugin's direct API link out of a block-directory response. * @@ -551,7 +471,7 @@ function getPluginUrl(block) { return false; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js /** * WordPress dependencies */ @@ -605,7 +525,7 @@ function receiveDownloadableBlocks(downloadableBlocks, filterValue) { * @return {boolean} Whether the block was successfully installed & loaded. */ -const actions_installBlockType = block => async _ref => { +const installBlockType = block => async _ref => { let { registry, dispatch @@ -649,27 +569,27 @@ const actions_installBlockType = block => async _ref => { } }); await loadAssets(); - const registeredBlocks = registry.select(external_wp_blocks_["store"]).getBlockTypes(); + const registeredBlocks = registry.select(external_wp_blocks_namespaceObject.store).getBlockTypes(); if (!registeredBlocks.some(i => i.name === block.name)) { - throw new Error(Object(external_wp_i18n_["__"])('Error registering block. Try reloading the page.')); + throw new Error((0,external_wp_i18n_namespaceObject.__)('Error registering block. Try reloading the page.')); } - registry.dispatch(external_wp_notices_["store"]).createInfoNotice(Object(external_wp_i18n_["sprintf"])( // translators: %s is the block title. - Object(external_wp_i18n_["__"])('Block %s installed and added.'), block.title), { + registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is the block title. + (0,external_wp_i18n_namespaceObject.__)('Block %s installed and added.'), block.title), { speak: true, type: 'snackbar' }); success = true; } catch (error) { - let message = error.message || Object(external_wp_i18n_["__"])('An error occurred.'); // Errors we throw are fatal + let message = error.message || (0,external_wp_i18n_namespaceObject.__)('An error occurred.'); // Errors we throw are fatal let isFatal = error instanceof Error; // Specific API errors that are fatal const fatalAPIErrors = { - folder_exists: Object(external_wp_i18n_["__"])('This block is already installed. Try reloading the page.'), - unable_to_connect_to_filesystem: Object(external_wp_i18n_["__"])('Error installing block. You can reload the page and try again.') + folder_exists: (0,external_wp_i18n_namespaceObject.__)('This block is already installed. Try reloading the page.'), + unable_to_connect_to_filesystem: (0,external_wp_i18n_namespaceObject.__)('Error installing block. You can reload the page and try again.') }; if (fatalAPIErrors[error.code]) { @@ -678,7 +598,7 @@ const actions_installBlockType = block => async _ref => { } dispatch.setErrorNotice(id, message, isFatal); - registry.dispatch(external_wp_notices_["store"]).createErrorNotice(message, { + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(message, { speak: true, isDismissible: true }); @@ -693,7 +613,7 @@ const actions_installBlockType = block => async _ref => { * @param {Object} block The blockType object. */ -const actions_uninstallBlockType = block => async _ref2 => { +const uninstallBlockType = block => async _ref2 => { let { registry, dispatch @@ -714,7 +634,7 @@ const actions_uninstallBlockType = block => async _ref2 => { }); dispatch.removeInstalledBlockType(block); } catch (error) { - registry.dispatch(external_wp_notices_["store"]).createErrorNotice(error.message || Object(external_wp_i18n_["__"])('An error occurred.')); + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(error.message || (0,external_wp_i18n_namespaceObject.__)('An error occurred.')); } }; /** @@ -797,7 +717,7 @@ function clearErrorNotice(blockId) { }; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js /** * External dependencies */ @@ -826,12 +746,12 @@ const resolvers_getDownloadableBlocks = filterValue => async _ref => { const results = await external_wp_apiFetch_default()({ path: `wp/v2/block-directory/search?term=${filterValue}` }); - const blocks = results.map(result => Object(external_lodash_["mapKeys"])(result, (value, key) => Object(external_lodash_["camelCase"])(key))); + const blocks = results.map(result => (0,external_lodash_namespaceObject.mapKeys)(result, (value, key) => (0,external_lodash_namespaceObject.camelCase)(key))); dispatch(receiveDownloadableBlocks(blocks, filterValue)); } catch {} }; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/index.js /** * WordPress dependencies */ @@ -872,10 +792,10 @@ const storeConfig = { * @type {Object} */ -const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, storeConfig); -Object(external_wp_data_["register"])(store); +const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, storeConfig); +(0,external_wp_data_namespaceObject.register)(store); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js /** * WordPress dependencies */ @@ -891,69 +811,134 @@ Object(external_wp_data_["register"])(store); function AutoBlockUninstaller() { const { uninstallBlockType - } = Object(external_wp_data_["useDispatch"])(store); - const shouldRemoveBlockTypes = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const shouldRemoveBlockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isAutosavingPost, isSavingPost - } = select(external_wp_editor_["store"]); + } = select(external_wp_editor_namespaceObject.store); return isSavingPost() && !isAutosavingPost(); }, []); - const unusedBlockTypes = Object(external_wp_data_["useSelect"])(select => select(store).getUnusedBlockTypes(), []); - Object(external_wp_element_["useEffect"])(() => { + const unusedBlockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getUnusedBlockTypes(), []); + (0,external_wp_element_namespaceObject.useEffect)(() => { if (shouldRemoveBlockTypes && unusedBlockTypes.length) { unusedBlockTypes.forEach(blockType => { uninstallBlockType(blockType); - Object(external_wp_blocks_["unregisterBlockType"])(blockType.name); + (0,external_wp_blocks_namespaceObject.unregisterBlockType)(blockType.name); }); } }, [shouldRemoveBlockTypes]); return null; } -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); +;// CONCATENATED MODULE: external ["wp","components"] +var external_wp_components_namespaceObject = window["wp"]["components"]; +;// CONCATENATED MODULE: external ["wp","compose"] +var external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// CONCATENATED MODULE: external ["wp","coreData"] +var external_wp_coreData_namespaceObject = window["wp"]["coreData"]; +;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } -// EXTERNAL MODULE: external ["wp","coreData"] -var external_wp_coreData_ = __webpack_require__("jZUy"); + return target; + }; -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); + return _extends.apply(this, arguments); +} +;// CONCATENATED MODULE: external ["wp","htmlEntities"] +var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js +/** + * WordPress dependencies + */ -// EXTERNAL MODULE: external ["wp","htmlEntities"] -var external_wp_htmlEntities_ = __webpack_require__("rmEH"); +/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js -var build_module_icon = __webpack_require__("iClF"); +/** + * 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 + * + * @return {JSX.Element} Icon component + */ -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js -var star_filled = __webpack_require__("URob"); +function Icon(_ref) { + let { + icon, + size = 24, + ...props + } = _ref; + return (0,external_wp_element_namespaceObject.cloneElement)(icon, { + width: size, + height: size, + ...props + }); +} -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); +/* harmony default export */ var icon = (Icon); -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js +;// CONCATENATED MODULE: external ["wp","primitives"] +var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js /** * WordPress dependencies */ -const starHalf = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const starFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var star_filled = (starFilled); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js + + +/** + * WordPress dependencies + */ + +const starHalf = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.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.39v7.143z" })); /* harmony default export */ var star_half = (starHalf); -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js -var star_empty = __webpack_require__("Xxwi"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js + +/** + * WordPress dependencies + */ + +const starEmpty = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var star_empty = (starEmpty); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js /** @@ -975,31 +960,31 @@ function Stars(_ref) { const fullStarCount = Math.floor(rating); const halfStarCount = Math.ceil(rating - fullStarCount); const emptyStarCount = 5 - (fullStarCount + halfStarCount); - return Object(external_wp_element_["createElement"])("span", { - "aria-label": Object(external_wp_i18n_["sprintf"])( + return (0,external_wp_element_namespaceObject.createElement)("span", { + "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of stars. */ - Object(external_wp_i18n_["__"])('%s out of 5 stars'), stars) - }, Object(external_lodash_["times"])(fullStarCount, i => Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { + (0,external_wp_i18n_namespaceObject.__)('%s out of 5 stars'), stars) + }, (0,external_lodash_namespaceObject.times)(fullStarCount, i => (0,external_wp_element_namespaceObject.createElement)(icon, { key: `full_stars_${i}`, className: "block-directory-block-ratings__star-full", - icon: star_filled["a" /* default */], + icon: star_filled, size: 16 - })), Object(external_lodash_["times"])(halfStarCount, i => Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { + })), (0,external_lodash_namespaceObject.times)(halfStarCount, i => (0,external_wp_element_namespaceObject.createElement)(icon, { key: `half_stars_${i}`, className: "block-directory-block-ratings__star-half-full", icon: star_half, size: 16 - })), Object(external_lodash_["times"])(emptyStarCount, i => Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { + })), (0,external_lodash_namespaceObject.times)(emptyStarCount, i => (0,external_wp_element_namespaceObject.createElement)(icon, { key: `empty_stars_${i}`, className: "block-directory-block-ratings__star-empty", - icon: star_empty["a" /* default */], + icon: star_empty, size: 16 }))); } -/* harmony default export */ var block_ratings_stars = (Stars); +/* harmony default export */ var stars = (Stars); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js /** @@ -1010,15 +995,15 @@ const BlockRatings = _ref => { let { rating } = _ref; - return Object(external_wp_element_["createElement"])("span", { + return (0,external_wp_element_namespaceObject.createElement)("span", { className: "block-directory-block-ratings" - }, Object(external_wp_element_["createElement"])(block_ratings_stars, { + }, (0,external_wp_element_namespaceObject.createElement)(stars, { rating: rating })); }; /* harmony default export */ var block_ratings = (BlockRatings); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js /** @@ -1031,11 +1016,11 @@ function DownloadableBlockIcon(_ref) { icon } = _ref; const className = 'block-directory-downloadable-block-icon'; - return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? Object(external_wp_element_["createElement"])("img", { + return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? (0,external_wp_element_namespaceObject.createElement)("img", { className: className, src: icon, alt: "" - }) : Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { + }) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { className: className, icon: icon, showColors: true @@ -1044,7 +1029,7 @@ function DownloadableBlockIcon(_ref) { /* harmony default export */ var downloadable_block_icon = (DownloadableBlockIcon); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js /** @@ -1061,21 +1046,21 @@ const DownloadableBlockNotice = _ref => { let { block } = _ref; - const errorNotice = Object(external_wp_data_["useSelect"])(select => select(store).getErrorNoticeForBlock(block.id), [block]); + const errorNotice = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getErrorNoticeForBlock(block.id), [block]); if (!errorNotice) { return null; } - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-downloadable-block-notice" - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-downloadable-block-notice__content" - }, errorNotice.message, errorNotice.isFatal ? ' ' + Object(external_wp_i18n_["__"])('Try reloading the page.') : null)); + }, errorNotice.message, errorNotice.isFatal ? ' ' + (0,external_wp_i18n_namespaceObject.__)('Try reloading the page.') : null)); }; /* harmony default export */ var downloadable_block_notice = (DownloadableBlockNotice); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js @@ -1112,28 +1097,28 @@ function getDownloadableBlockLabel(_ref, _ref2) { if (!isInstalled && hasNotice) { /* translators: %1$s: block title */ - return Object(external_wp_i18n_["sprintf"])('Retry installing %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title)); + return (0,external_wp_i18n_namespaceObject.sprintf)('Retry installing %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); } if (isInstalled) { /* translators: %1$s: block title */ - return Object(external_wp_i18n_["sprintf"])('Add %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title)); + return (0,external_wp_i18n_namespaceObject.sprintf)('Add %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); } if (isInstalling) { /* translators: %1$s: block title */ - return Object(external_wp_i18n_["sprintf"])('Installing %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title)); + return (0,external_wp_i18n_namespaceObject.sprintf)('Installing %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); } // No ratings yet, just use the title. if (ratingCount < 1) { /* translators: %1$s: block title */ - return Object(external_wp_i18n_["sprintf"])('Install %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title)); + return (0,external_wp_i18n_namespaceObject.sprintf)('Install %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); } - return Object(external_wp_i18n_["sprintf"])( + return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */ - Object(external_wp_i18n_["_n"])('Install %1$s. %2$s stars with %3$s review.', 'Install %1$s. %2$s stars with %3$s reviews.', ratingCount), Object(external_wp_htmlEntities_["decodeEntities"])(title), stars, ratingCount); + (0,external_wp_i18n_namespaceObject._n)('Install %1$s. %2$s stars with %3$s review.', 'Install %1$s. %2$s stars with %3$s reviews.', ratingCount), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), stars, ratingCount); } function DownloadableBlockListItem(_ref3) { @@ -1150,12 +1135,12 @@ function DownloadableBlockListItem(_ref3) { title } = item; // getBlockType returns a block object if this block exists, or null if not. - const isInstalled = !!Object(external_wp_blocks_["getBlockType"])(item.name); + const isInstalled = !!(0,external_wp_blocks_namespaceObject.getBlockType)(item.name); const { hasNotice, isInstalling, isInstallable - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getErrorNoticeForBlock, isInstalling: isBlockInstalling @@ -1171,14 +1156,14 @@ function DownloadableBlockListItem(_ref3) { let statusText = ''; if (isInstalled) { - statusText = Object(external_wp_i18n_["__"])('Installed!'); + statusText = (0,external_wp_i18n_namespaceObject.__)('Installed!'); } else if (isInstalling) { - statusText = Object(external_wp_i18n_["__"])('Installing…'); + statusText = (0,external_wp_i18n_namespaceObject.__)('Installing…'); } - return Object(external_wp_element_["createElement"])(external_wp_components_["__unstableCompositeItem"], Object(esm_extends["a" /* default */])({ + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, _extends({ role: "option", - as: external_wp_components_["Button"] + as: external_wp_components_namespaceObject.Button }, composite, { className: "block-directory-downloadable-block-list-item", onClick: event => { @@ -1194,35 +1179,35 @@ function DownloadableBlockListItem(_ref3) { }), showTooltip: true, tooltipPosition: "top center" - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-downloadable-block-list-item__icon" - }, Object(external_wp_element_["createElement"])(downloadable_block_icon, { + }, (0,external_wp_element_namespaceObject.createElement)(downloadable_block_icon, { icon: icon, title: title - }), isInstalling ? Object(external_wp_element_["createElement"])("span", { + }), isInstalling ? (0,external_wp_element_namespaceObject.createElement)("span", { className: "block-directory-downloadable-block-list-item__spinner" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)) : Object(external_wp_element_["createElement"])(block_ratings, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)) : (0,external_wp_element_namespaceObject.createElement)(block_ratings, { rating: rating - })), Object(external_wp_element_["createElement"])("span", { + })), (0,external_wp_element_namespaceObject.createElement)("span", { className: "block-directory-downloadable-block-list-item__details" - }, Object(external_wp_element_["createElement"])("span", { + }, (0,external_wp_element_namespaceObject.createElement)("span", { className: "block-directory-downloadable-block-list-item__title" - }, Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["sprintf"])( + }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: block title, %2$s: author name. */ - Object(external_wp_i18n_["__"])('%1$s by %2$s'), Object(external_wp_htmlEntities_["decodeEntities"])(title), author), { - span: Object(external_wp_element_["createElement"])("span", { + (0,external_wp_i18n_namespaceObject.__)('%1$s by %2$s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), author), { + span: (0,external_wp_element_namespaceObject.createElement)("span", { className: "block-directory-downloadable-block-list-item__author" }) - })), hasNotice ? Object(external_wp_element_["createElement"])(downloadable_block_notice, { + })), hasNotice ? (0,external_wp_element_namespaceObject.createElement)(downloadable_block_notice, { block: item - }) : Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("span", { + }) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", { className: "block-directory-downloadable-block-list-item__desc" - }, !!statusText ? statusText : Object(external_wp_htmlEntities_["decodeEntities"])(description)), isInstallable && !(isInstalled || isInstalling) && Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], null, Object(external_wp_i18n_["__"])('Install block'))))); + }, !!statusText ? statusText : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(description)), isInstallable && !(isInstalled || isInstalling) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('Install block'))))); } /* harmony default export */ var downloadable_block_list_item = (DownloadableBlockListItem); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js @@ -1248,31 +1233,31 @@ function DownloadableBlockListItem(_ref3) { function DownloadableBlocksList(_ref) { let { items, - onHover = external_lodash_["noop"], + onHover = external_lodash_namespaceObject.noop, onSelect } = _ref; - const composite = Object(external_wp_components_["__unstableUseCompositeState"])(); + const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)(); const { installBlockType - } = Object(external_wp_data_["useDispatch"])(store); + } = (0,external_wp_data_namespaceObject.useDispatch)(store); if (!items.length) { return null; } - return Object(external_wp_element_["createElement"])(external_wp_components_["__unstableComposite"], Object(esm_extends["a" /* default */])({}, composite, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, { role: "listbox", className: "block-directory-downloadable-blocks-list", - "aria-label": Object(external_wp_i18n_["__"])('Blocks available for install') + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Blocks available for install') }), items.map(item => { - return Object(external_wp_element_["createElement"])(downloadable_block_list_item, { + return (0,external_wp_element_namespaceObject.createElement)(downloadable_block_list_item, { key: item.id, composite: composite, onClick: () => { // Check if the block is registered (`getBlockType` // will return an object). If so, insert the block. // This prevents installing existing plugins. - if (Object(external_wp_blocks_["getBlockType"])(item.name)) { + if ((0,external_wp_blocks_namespaceObject.getBlockType)(item.name)) { onSelect(item); } else { installBlockType(item).then(success => { @@ -1292,10 +1277,9 @@ function DownloadableBlocksList(_ref) { /* harmony default export */ var downloadable_blocks_list = (DownloadableBlocksList); -// EXTERNAL MODULE: external ["wp","a11y"] -var external_wp_a11y_ = __webpack_require__("gdqT"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/inserter-panel.js +;// CONCATENATED MODULE: external ["wp","a11y"] +var external_wp_a11y_namespaceObject = window["wp"]["a11y"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/inserter-panel.js /** @@ -1312,32 +1296,44 @@ function DownloadableBlocksInserterPanel(_ref) { hasLocalBlocks } = _ref; const count = downloadableItems.length; - Object(external_wp_element_["useEffect"])(() => { - Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["sprintf"])( + (0,external_wp_element_namespaceObject.useEffect)(() => { + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of available blocks. */ - Object(external_wp_i18n_["_n"])('%d additional block is available to install.', '%d additional blocks are available to install.', count), count)); + (0,external_wp_i18n_namespaceObject._n)('%d additional block is available to install.', '%d additional blocks are available to install.', count), count)); }, [count]); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !hasLocalBlocks && Object(external_wp_element_["createElement"])("p", { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !hasLocalBlocks && (0,external_wp_element_namespaceObject.createElement)("p", { className: "block-directory-downloadable-blocks-panel__no-local" - }, Object(external_wp_i18n_["__"])('No results available from your installed blocks.')), Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_i18n_namespaceObject.__)('No results available from your installed blocks.')), (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-editor-inserter__quick-inserter-separator" - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-downloadable-blocks-panel" - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-downloadable-blocks-panel__header" - }, Object(external_wp_element_["createElement"])("h2", { + }, (0,external_wp_element_namespaceObject.createElement)("h2", { className: "block-directory-downloadable-blocks-panel__title" - }, Object(external_wp_i18n_["__"])('Available to install')), Object(external_wp_element_["createElement"])("p", { + }, (0,external_wp_i18n_namespaceObject.__)('Available to install')), (0,external_wp_element_namespaceObject.createElement)("p", { className: "block-directory-downloadable-blocks-panel__description" - }, Object(external_wp_i18n_["__"])('Select a block to install and add it to your post.'))), children)); + }, (0,external_wp_i18n_namespaceObject.__)('Select a block to install and add it to your post.'))), children)); } /* harmony default export */ var inserter_panel = (DownloadableBlocksInserterPanel); -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js -var block_default = __webpack_require__("//Lo"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/no-results.js + +/** + * WordPress dependencies + */ + +const blockDefault = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var block_default = (blockDefault); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/no-results.js /** @@ -1347,17 +1343,17 @@ var block_default = __webpack_require__("//Lo"); function DownloadableBlocksNoResults() { - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-editor-inserter__no-results" - }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { + }, (0,external_wp_element_namespaceObject.createElement)(icon, { className: "block-editor-inserter__no-results-icon", - icon: block_default["a" /* default */] - }), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('No results found.'))); + icon: block_default + }), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No results found.'))); } /* harmony default export */ var no_results = (DownloadableBlocksNoResults); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js /** @@ -1390,34 +1386,34 @@ function DownloadableBlocksPanel(_ref) { } = _ref; if (typeof hasPermission === 'undefined' || isLoading || isTyping) { - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, hasPermission && !hasLocalBlocks && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("p", { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasPermission && !hasLocalBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("p", { className: "block-directory-downloadable-blocks-panel__no-local" - }, Object(external_wp_i18n_["__"])('No results available from your installed blocks.')), Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_i18n_namespaceObject.__)('No results available from your installed blocks.')), (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-editor-inserter__quick-inserter-separator" - })), Object(external_wp_element_["createElement"])("div", { + })), (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-downloadable-blocks-panel has-blocks-loading" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))); } if (false === hasPermission) { if (!hasLocalBlocks) { - return Object(external_wp_element_["createElement"])(no_results, null); + return (0,external_wp_element_namespaceObject.createElement)(no_results, null); } return null; } - return !!downloadableItems.length ? Object(external_wp_element_["createElement"])(inserter_panel, { + return !!downloadableItems.length ? (0,external_wp_element_namespaceObject.createElement)(inserter_panel, { downloadableItems: downloadableItems, hasLocalBlocks: hasLocalBlocks - }, Object(external_wp_element_["createElement"])(downloadable_blocks_list, { + }, (0,external_wp_element_namespaceObject.createElement)(downloadable_blocks_list, { items: downloadableItems, onSelect: onSelect, onHover: onHover - })) : !hasLocalBlocks && Object(external_wp_element_["createElement"])(no_results, null); + })) : !hasLocalBlocks && (0,external_wp_element_namespaceObject.createElement)(no_results, null); } -/* harmony default export */ var downloadable_blocks_panel = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, _ref2) => { +/* harmony default export */ var downloadable_blocks_panel = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => { let { filterValue, rootClientId = null @@ -1428,8 +1424,8 @@ function DownloadableBlocksPanel(_ref) { } = select(store); const { canInsertBlockType - } = select(external_wp_blockEditor_["store"]); - const hasPermission = select(external_wp_coreData_["store"]).canUser('read', 'block-directory/search'); + } = select(external_wp_blockEditor_namespaceObject.store); + const hasPermission = select(external_wp_coreData_namespaceObject.store).canUser('read', 'block-directory/search'); function getInstallableBlocks(term) { return getDownloadableBlocks(term).filter(block => canInsertBlockType(block, rootClientId, true)); @@ -1444,7 +1440,7 @@ function DownloadableBlocksPanel(_ref) { }; })])(DownloadableBlocksPanel)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js /** @@ -1464,9 +1460,9 @@ function DownloadableBlocksPanel(_ref) { function InserterMenuDownloadableBlocksPanel() { - const [debouncedFilterValue, setFilterValue] = Object(external_wp_element_["useState"])(''); - const debouncedSetFilterValue = Object(external_lodash_["debounce"])(setFilterValue, 400); - return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableInserterMenuExtension"], null, _ref => { + const [debouncedFilterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(''); + const debouncedSetFilterValue = (0,external_lodash_namespaceObject.debounce)(setFilterValue, 400); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableInserterMenuExtension, null, _ref => { let { onSelect, onHover, @@ -1483,7 +1479,7 @@ function InserterMenuDownloadableBlocksPanel() { return null; } - return Object(external_wp_element_["createElement"])(downloadable_blocks_panel, { + return (0,external_wp_element_namespaceObject.createElement)(downloadable_blocks_panel, { onSelect: onSelect, onHover: onHover, rootClientId: rootClientId, @@ -1496,10 +1492,9 @@ function InserterMenuDownloadableBlocksPanel() { /* harmony default export */ var inserter_menu_downloadable_blocks_panel = (InserterMenuDownloadableBlocksPanel); -// EXTERNAL MODULE: external ["wp","editPost"] -var external_wp_editPost_ = __webpack_require__("BLhE"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js +;// CONCATENATED MODULE: external ["wp","editPost"] +var external_wp_editPost_namespaceObject = window["wp"]["editPost"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js /** @@ -1520,7 +1515,7 @@ function CompactList(_ref) { return null; } - return Object(external_wp_element_["createElement"])("ul", { + return (0,external_wp_element_namespaceObject.createElement)("ul", { className: "block-directory-compact-list" }, items.map(_ref2 => { let { @@ -1529,25 +1524,25 @@ function CompactList(_ref) { title, author } = _ref2; - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: id, className: "block-directory-compact-list__item" - }, Object(external_wp_element_["createElement"])(downloadable_block_icon, { + }, (0,external_wp_element_namespaceObject.createElement)(downloadable_block_icon, { icon: icon, title: title - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-compact-list__item-details" - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-compact-list__item-title" - }, title), Object(external_wp_element_["createElement"])("div", { + }, title), (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-directory-compact-list__item-author" - }, Object(external_wp_i18n_["sprintf"])( + }, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the block author. */ - Object(external_wp_i18n_["__"])('By %s'), author)))); + (0,external_wp_i18n_namespaceObject.__)('By %s'), author)))); })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js /** @@ -1564,25 +1559,25 @@ function CompactList(_ref) { function InstalledBlocksPrePublishPanel() { - const newBlockTypes = Object(external_wp_data_["useSelect"])(select => select(store).getNewBlockTypes(), []); + const newBlockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getNewBlockTypes(), []); if (!newBlockTypes.length) { return null; } - return Object(external_wp_element_["createElement"])(external_wp_editPost_["PluginPrePublishPanel"], { - icon: block_default["a" /* default */], - title: Object(external_wp_i18n_["sprintf"])( // translators: %d: number of blocks (number). - Object(external_wp_i18n_["_n"])('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length), + return (0,external_wp_element_namespaceObject.createElement)(external_wp_editPost_namespaceObject.PluginPrePublishPanel, { + icon: block_default, + title: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: number of blocks (number). + (0,external_wp_i18n_namespaceObject._n)('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length), initialOpen: true - }, Object(external_wp_element_["createElement"])("p", { + }, (0,external_wp_element_namespaceObject.createElement)("p", { className: "installed-blocks-pre-publish-panel__copy" - }, Object(external_wp_i18n_["_n"])('The following block has been added to your site.', 'The following blocks have been added to your site.', newBlockTypes.length)), Object(external_wp_element_["createElement"])(CompactList, { + }, (0,external_wp_i18n_namespaceObject._n)('The following block has been added to your site.', 'The following blocks have been added to your site.', newBlockTypes.length)), (0,external_wp_element_namespaceObject.createElement)(CompactList, { items: newBlockTypes })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/install-button.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/install-button.js /** @@ -1604,33 +1599,33 @@ function InstallButton(_ref) { block, clientId } = _ref; - const isInstallingBlock = Object(external_wp_data_["useSelect"])(select => select(store).isInstalling(block.id), [block.id]); + const isInstallingBlock = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isInstalling(block.id), [block.id]); const { installBlockType - } = Object(external_wp_data_["useDispatch"])(store); + } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { replaceBlock - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { onClick: () => installBlockType(block).then(success => { if (success) { - const blockType = Object(external_wp_blocks_["getBlockType"])(block.name); - const [originalBlock] = Object(external_wp_blocks_["parse"])(attributes.originalContent); + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); + const [originalBlock] = (0,external_wp_blocks_namespaceObject.parse)(attributes.originalContent); if (originalBlock && blockType) { - replaceBlock(clientId, Object(external_wp_blocks_["createBlock"])(blockType.name, originalBlock.attributes, originalBlock.innerBlocks)); + replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)(blockType.name, originalBlock.attributes, originalBlock.innerBlocks)); } } }), disabled: isInstallingBlock, isBusy: isInstallingBlock, variant: "primary" - }, Object(external_wp_i18n_["sprintf"])( + }, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ - Object(external_wp_i18n_["__"])('Install %s'), block.title)); + (0,external_wp_i18n_namespaceObject.__)('Install %s'), block.title)); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js @@ -1660,7 +1655,7 @@ const getInstallMissing = OriginalComponent => props => { const { block, hasPermission - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getDownloadableBlocks } = select(store); @@ -1671,16 +1666,16 @@ const getInstallMissing = OriginalComponent => props => { return originalName === name; }); return { - hasPermission: select(external_wp_coreData_["store"]).canUser('read', 'block-directory/search'), + hasPermission: select(external_wp_coreData_namespaceObject.store).canUser('read', 'block-directory/search'), block: blocks.length && blocks[0] }; }, [originalName]); // The user can't install blocks, or the block isn't available for download. if (!hasPermission || !block) { - return Object(external_wp_element_["createElement"])(OriginalComponent, props); + return (0,external_wp_element_namespaceObject.createElement)(OriginalComponent, props); } - return Object(external_wp_element_["createElement"])(ModifiedWarning, Object(esm_extends["a" /* default */])({}, props, { + return (0,external_wp_element_namespaceObject.createElement)(ModifiedWarning, _extends({}, props, { originalBlock: block })); }; @@ -1696,20 +1691,20 @@ const ModifiedWarning = _ref2 => { } = props.attributes; const { replaceBlock - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const convertToHTML = () => { - replaceBlock(props.clientId, Object(external_wp_blocks_["createBlock"])('core/html', { + replaceBlock(props.clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { content: originalUndelimitedContent })); }; const hasContent = !!originalUndelimitedContent; - const hasHTMLBlock = Object(external_wp_blocks_["getBlockType"])('core/html'); - let messageHTML = Object(external_wp_i18n_["sprintf"])( + const hasHTMLBlock = (0,external_wp_blocks_namespaceObject.getBlockType)('core/html'); + let messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ - Object(external_wp_i18n_["__"])('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName); - const actions = [Object(external_wp_element_["createElement"])(InstallButton, { + (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName); + const actions = [(0,external_wp_element_namespaceObject.createElement)(InstallButton, { key: "install", block: originalBlock, attributes: props.attributes, @@ -1717,24 +1712,24 @@ const ModifiedWarning = _ref2 => { })]; if (hasContent && hasHTMLBlock) { - messageHTML = Object(external_wp_i18n_["sprintf"])( + messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ - Object(external_wp_i18n_["__"])('Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'), originalBlock.title || originalName); - actions.push(Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'), originalBlock.title || originalName); + actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { key: "convert", onClick: convertToHTML, variant: "link" - }, Object(external_wp_i18n_["__"])('Keep as HTML'))); + }, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML'))); } - return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], { + return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, { actions: actions - }, messageHTML), Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, originalUndelimitedContent)); + }, messageHTML), (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, originalUndelimitedContent)); }; /* harmony default export */ var get_install_missing = (getInstallMissing); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js /** @@ -1750,13 +1745,13 @@ const ModifiedWarning = _ref2 => { -Object(external_wp_plugins_["registerPlugin"])('block-directory', { +(0,external_wp_plugins_namespaceObject.registerPlugin)('block-directory', { render() { - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(AutoBlockUninstaller, null), Object(external_wp_element_["createElement"])(inserter_menu_downloadable_blocks_panel, null), Object(external_wp_element_["createElement"])(InstalledBlocksPrePublishPanel, null)); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AutoBlockUninstaller, null), (0,external_wp_element_namespaceObject.createElement)(inserter_menu_downloadable_blocks_panel, null), (0,external_wp_element_namespaceObject.createElement)(InstalledBlocksPrePublishPanel, null)); } }); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'block-directory/fallback', (settings, name) => { +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'block-directory/fallback', (settings, name) => { if (name !== 'core/missing') { return settings; } @@ -1765,250 +1760,13 @@ Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'block-direc return settings; }); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js /** * Internal dependencies */ - -/***/ }), - -/***/ "BLhE": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["editPost"]; }()); - -/***/ }), - -/***/ "GRId": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["element"]; }()); - -/***/ }), - -/***/ "HSyU": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["blocks"]; }()); - -/***/ }), - -/***/ "K9lf": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["compose"]; }()); - -/***/ }), - -/***/ "Tqx9": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["primitives"]; }()); - -/***/ }), - -/***/ "TvNi": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["plugins"]; }()); - -/***/ }), - -/***/ "URob": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const starFilled = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (starFilled); - - -/***/ }), - -/***/ "Xxwi": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const starEmpty = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (starEmpty); - - -/***/ }), - -/***/ "YLtl": -/***/ (function(module, exports) { - -(function() { module.exports = window["lodash"]; }()); - -/***/ }), - -/***/ "axFQ": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["blockEditor"]; }()); - -/***/ }), - -/***/ "g56x": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["hooks"]; }()); - -/***/ }), - -/***/ "gdqT": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["a11y"]; }()); - -/***/ }), - -/***/ "iClF": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/** - * 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 - * - * @return {JSX.Element} Icon component - */ - -function Icon(_ref) { - let { - icon, - size = 24, - ...props - } = _ref; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, { - width: size, - height: size, - ...props - }); -} - -/* harmony default export */ __webpack_exports__["a"] = (Icon); - - -/***/ }), - -/***/ "jSdM": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["editor"]; }()); - -/***/ }), - -/***/ "jZUy": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["coreData"]; }()); - -/***/ }), - -/***/ "l3Sj": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["i18n"]; }()); - -/***/ }), - -/***/ "onLe": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["notices"]; }()); - -/***/ }), - -/***/ "rmEH": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["htmlEntities"]; }()); - -/***/ }), - -/***/ "tI+e": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["components"]; }()); - -/***/ }), - -/***/ "wx14": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); -function _extends() { - _extends = Object.assign || 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 target; - }; - - return _extends.apply(this, arguments); -} - -/***/ }), - -/***/ "ywyh": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["apiFetch"]; }()); - -/***/ }) - -/******/ }); \ No newline at end of file +(window.wp = window.wp || {}).blockDirectory = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/js/dist/block-directory.min.js b/wp-includes/js/dist/block-directory.min.js index fe1b242271..573651ad2f 100644 --- a/wp-includes/js/dist/block-directory.min.js +++ b/wp-includes/js/dist/block-directory.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -this.wp=this.wp||{},this.wp.blockDirectory=function(e){var t={};function n(l){if(t[l])return t[l].exports;var c=t[l]={i:l,l:!1,exports:{}};return e[l].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(l,c,function(t){return e[t]}.bind(null,c));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="7f3f")}({"//Lo":function(e,t,n){"use strict";var l=n("GRId"),c=n("Tqx9");const o=Object(l.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(c.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"}));t.a=o},"1ZqX":function(e,t){e.exports=window.wp.data},"7f3f":function(e,t,n){"use strict";n.r(t),n.d(t,"store",(function(){return V}));var l={};n.r(l),n.d(l,"isRequestingDownloadableBlocks",(function(){return k})),n.d(l,"getDownloadableBlocks",(function(){return j})),n.d(l,"getInstalledBlockTypes",(function(){return f})),n.d(l,"getNewBlockTypes",(function(){return g})),n.d(l,"getUnusedBlockTypes",(function(){return _})),n.d(l,"isInstalling",(function(){return w})),n.d(l,"getErrorNotices",(function(){return E})),n.d(l,"getErrorNoticeForBlock",(function(){return y}));var c={};n.r(c),n.d(c,"fetchDownloadableBlocks",(function(){return L})),n.d(c,"receiveDownloadableBlocks",(function(){return S})),n.d(c,"installBlockType",(function(){return x})),n.d(c,"uninstallBlockType",(function(){return C})),n.d(c,"addInstalledBlockType",(function(){return R})),n.d(c,"removeInstalledBlockType",(function(){return D})),n.d(c,"setIsInstalling",(function(){return P})),n.d(c,"setErrorNotice",(function(){return M})),n.d(c,"clearErrorNotice",(function(){return A}));var o={};n.r(o),n.d(o,"getDownloadableBlocks",(function(){return F}));var r=n("GRId"),a=n("TvNi"),i=n("g56x"),s=n("HSyU"),d=n("1ZqX"),b=n("jSdM"),u=n("YLtl");var m=Object(d.combineReducers)({downloadableBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{installedBlockTypes:[],isInstalling:{}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter(e=>e.name!==t.item.name)};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":return Object(u.omit)(e,t.blockId)}return e}}),p=n("axFQ");function O(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;if(t.some(t=>{let{name:n}=t;return n===e.name}))return!0;for(let n=0;nt=>{const n=e(p.store).getBlocks();return f(t).filter(e=>O(e,n))}),_=Object(d.createRegistrySelector)(e=>t=>{const n=e(p.store).getBlocks();return f(t).filter(e=>!O(e,n))});function w(e,t){return e.blockManagement.isInstalling[t]||!1}function E(e){return e.errorNotices}function y(e,t){return e.errorNotices[t]}var h=n("l3Sj"),v=n("ywyh"),B=n.n(v),I=n("onLe");const N=e=>new Promise((t,n)=>{const l=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(t=>{e[t]&&(l[t]=e[t])}),e.innerHTML&&l.appendChild(document.createTextNode(e.innerHTML)),l.onload=()=>t(!0),l.onerror=()=>n(new Error("Error loading asset.")),document.body.appendChild(l),("link"===l.nodeName.toLowerCase()||"script"===l.nodeName.toLowerCase()&&!l.src)&&t()});function T(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function L(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function S(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const x=e=>async t=>{let{registry:n,dispatch:l}=t;const{id:c}=e;let o=!1;l.clearErrorNotice(c);try{l.setIsInstalling(c,!0);const t=T(e);let r={};if(t)await B()({method:"PUT",url:t,data:{status:"active"}});else{r=(await B()({method:"POST",path:"wp/v2/plugins",data:{slug:c,status:"active"}}))._links}l.addInstalledBlockType({...e,links:{...e.links,...r}}),await async function(){const e=await B()({url:document.location.href,parse:!1}),t=await e.text(),n=(new window.DOMParser).parseFromString(t,"text/html"),l=Array.from(n.querySelectorAll('link[rel="stylesheet"],script')).filter(e=>e.id&&!document.getElementById(e.id));for(const e of l)await N(e)}();if(!n.select(s.store).getBlockTypes().some(t=>t.name===e.name))throw new Error(Object(h.__)("Error registering block. Try reloading the page."));n.dispatch(I.store).createInfoNotice(Object(h.sprintf)(Object(h.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),o=!0}catch(e){let t=e.message||Object(h.__)("An error occurred."),o=e instanceof Error;const r={folder_exists:Object(h.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:Object(h.__)("Error installing block. You can reload the page and try again.")};r[e.code]&&(o=!0,t=r[e.code]),l.setErrorNotice(c,t,o),n.dispatch(I.store).createErrorNotice(t,{speak:!0,isDismissible:!0})}return l.setIsInstalling(c,!1),o},C=e=>async t=>{let{registry:n,dispatch:l}=t;try{const t=T(e);await B()({method:"PUT",url:t,data:{status:"inactive"}}),await B()({method:"DELETE",url:t}),l.removeInstalledBlockType(e)}catch(e){n.dispatch(I.store).createErrorNotice(e.message||Object(h.__)("An error occurred."))}};function R(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function D(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function P(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function M(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:n}}function A(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}const F=e=>async t=>{let{dispatch:n}=t;if(e)try{n(L(e));const t=await B()({path:"wp/v2/block-directory/search?term="+e});n(S(t.map(e=>Object(u.mapKeys)(e,(e,t)=>Object(u.camelCase)(t))),e))}catch{}},H={reducer:m,selectors:l,actions:c,resolvers:o,__experimentalUseThunks:!0},V=Object(d.createReduxStore)("core/block-directory",H);function q(){const{uninstallBlockType:e}=Object(d.useDispatch)(V),t=Object(d.useSelect)(e=>{const{isAutosavingPost:t,isSavingPost:n}=e(b.store);return n()&&!t()},[]),n=Object(d.useSelect)(e=>e(V).getUnusedBlockTypes(),[]);return Object(r.useEffect)(()=>{t&&n.length&&n.forEach(t=>{e(t),Object(s.unregisterBlockType)(t.name)})},[t]),null}Object(d.register)(V);var U=n("tI+e"),K=n("K9lf"),G=n("jZUy"),z=n("wx14"),Y=n("rmEH"),$=n("iClF"),W=n("URob"),X=n("Tqx9");var Z=Object(r.createElement)(X.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(X.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.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.39v7.143z"})),Q=n("Xxwi");var J=function(e){let{rating:t}=e;const n=.5*Math.round(t/.5),l=Math.floor(t),c=Math.ceil(t-l),o=5-(l+c);return Object(r.createElement)("span",{"aria-label":Object(h.sprintf)(Object(h.__)("%s out of 5 stars"),n)},Object(u.times)(l,e=>Object(r.createElement)($.a,{key:"full_stars_"+e,className:"block-directory-block-ratings__star-full",icon:W.a,size:16})),Object(u.times)(c,e=>Object(r.createElement)($.a,{key:"half_stars_"+e,className:"block-directory-block-ratings__star-half-full",icon:Z,size:16})),Object(u.times)(o,e=>Object(r.createElement)($.a,{key:"empty_stars_"+e,className:"block-directory-block-ratings__star-empty",icon:Q.a,size:16})))};var ee=e=>{let{rating:t}=e;return Object(r.createElement)("span",{className:"block-directory-block-ratings"},Object(r.createElement)(J,{rating:t}))};var te=function(e){let{icon:t}=e;const n="block-directory-downloadable-block-icon";return null!==t.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?Object(r.createElement)("img",{className:n,src:t,alt:""}):Object(r.createElement)(p.BlockIcon,{className:n,icon:t,showColors:!0})};var ne=e=>{let{block:t}=e;const n=Object(d.useSelect)(e=>e(V).getErrorNoticeForBlock(t.id),[t]);return n?Object(r.createElement)("div",{className:"block-directory-downloadable-block-notice"},Object(r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},n.message,n.isFatal?" "+Object(h.__)("Try reloading the page."):null)):null};function le(e,t){let{title:n,rating:l,ratingCount:c}=e,{hasNotice:o,isInstalled:r,isInstalling:a}=t;const i=.5*Math.round(l/.5);return!r&&o?Object(h.sprintf)("Retry installing %s.",Object(Y.decodeEntities)(n)):r?Object(h.sprintf)("Add %s.",Object(Y.decodeEntities)(n)):a?Object(h.sprintf)("Installing %s.",Object(Y.decodeEntities)(n)):c<1?Object(h.sprintf)("Install %s.",Object(Y.decodeEntities)(n)):Object(h.sprintf)(Object(h._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",c),Object(Y.decodeEntities)(n),i,c)}var ce=function(e){let{composite:t,item:n,onClick:l}=e;const{author:c,description:o,icon:a,rating:i,title:b}=n,u=!!Object(s.getBlockType)(n.name),{hasNotice:m,isInstalling:p,isInstallable:O}=Object(d.useSelect)(e=>{const{getErrorNoticeForBlock:t,isInstalling:l}=e(V),c=t(n.id),o=c&&c.isFatal;return{hasNotice:!!c,isInstalling:l(n.id),isInstallable:!o}},[n]);let k="";return u?k=Object(h.__)("Installed!"):p&&(k=Object(h.__)("Installing…")),Object(r.createElement)(U.__unstableCompositeItem,Object(z.a)({role:"option",as:U.Button},t,{className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),l()},isBusy:p,disabled:p||!O,label:le(n,{hasNotice:m,isInstalled:u,isInstalling:p}),showTooltip:!0,tooltipPosition:"top center"}),Object(r.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},Object(r.createElement)(te,{icon:a,title:b}),p?Object(r.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},Object(r.createElement)(U.Spinner,null)):Object(r.createElement)(ee,{rating:i})),Object(r.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},Object(r.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},Object(r.createInterpolateElement)(Object(h.sprintf)(Object(h.__)("%1$s by %2$s"),Object(Y.decodeEntities)(b),c),{span:Object(r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),m?Object(r.createElement)(ne,{block:n}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},k||Object(Y.decodeEntities)(o)),O&&!(u||p)&&Object(r.createElement)(U.VisuallyHidden,null,Object(h.__)("Install block")))))};var oe=function(e){let{items:t,onHover:n=u.noop,onSelect:l}=e;const c=Object(U.__unstableUseCompositeState)(),{installBlockType:o}=Object(d.useDispatch)(V);return t.length?Object(r.createElement)(U.__unstableComposite,Object(z.a)({},c,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":Object(h.__)("Blocks available for install")}),t.map(e=>Object(r.createElement)(ce,{key:e.id,composite:c,onClick:()=>{Object(s.getBlockType)(e.name)?l(e):o(e).then(t=>{t&&l(e)}),n(null)},onHover:n,item:e}))):null},re=n("gdqT");var ae=function(e){let{children:t,downloadableItems:n,hasLocalBlocks:l}=e;const c=n.length;return Object(r.useEffect)(()=>{Object(re.speak)(Object(h.sprintf)(Object(h._n)("%d additional block is available to install.","%d additional blocks are available to install.",c),c))},[c]),Object(r.createElement)(r.Fragment,null,!l&&Object(r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},Object(h.__)("No results available from your installed blocks.")),Object(r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),Object(r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},Object(r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},Object(r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},Object(h.__)("Available to install")),Object(r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},Object(h.__)("Select a block to install and add it to your post."))),t))},ie=n("//Lo");var se=function(){return Object(r.createElement)("div",{className:"block-editor-inserter__no-results"},Object(r.createElement)($.a,{className:"block-editor-inserter__no-results-icon",icon:ie.a}),Object(r.createElement)("p",null,Object(h.__)("No results found.")))};var de=Object(K.compose)([Object(d.withSelect)((e,t)=>{let{filterValue:n,rootClientId:l=null}=t;const{getDownloadableBlocks:c,isRequestingDownloadableBlocks:o}=e(V),{canInsertBlockType:r}=e(p.store),a=e(G.store).canUser("read","block-directory/search");return{downloadableItems:a?c(n).filter(e=>r(e,l,!0)):[],hasPermission:a,isLoading:o(n)}})])((function(e){let{downloadableItems:t,onSelect:n,onHover:l,hasLocalBlocks:c,hasPermission:o,isLoading:a,isTyping:i}=e;return void 0===o||a||i?Object(r.createElement)(r.Fragment,null,o&&!c&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},Object(h.__)("No results available from your installed blocks.")),Object(r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),Object(r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},Object(r.createElement)(U.Spinner,null))):!1===o?c?null:Object(r.createElement)(se,null):t.length?Object(r.createElement)(ae,{downloadableItems:t,hasLocalBlocks:c},Object(r.createElement)(oe,{items:t,onSelect:n,onHover:l})):!c&&Object(r.createElement)(se,null)}));var be=function(){const[e,t]=Object(r.useState)(""),n=Object(u.debounce)(t,400);return Object(r.createElement)(p.__unstableInserterMenuExtension,null,t=>{let{onSelect:l,onHover:c,filterValue:o,hasItems:a,rootClientId:i}=t;return e!==o&&n(o),e?Object(r.createElement)(de,{onSelect:l,onHover:c,rootClientId:i,filterValue:e,hasLocalBlocks:a,isTyping:o!==e}):null})},ue=n("BLhE");function me(e){let{items:t}=e;return t.length?Object(r.createElement)("ul",{className:"block-directory-compact-list"},t.map(e=>{let{icon:t,id:n,title:l,author:c}=e;return Object(r.createElement)("li",{key:n,className:"block-directory-compact-list__item"},Object(r.createElement)(te,{icon:t,title:l}),Object(r.createElement)("div",{className:"block-directory-compact-list__item-details"},Object(r.createElement)("div",{className:"block-directory-compact-list__item-title"},l),Object(r.createElement)("div",{className:"block-directory-compact-list__item-author"},Object(h.sprintf)(Object(h.__)("By %s"),c))))})):null}function pe(){const e=Object(d.useSelect)(e=>e(V).getNewBlockTypes(),[]);return e.length?Object(r.createElement)(ue.PluginPrePublishPanel,{icon:ie.a,title:Object(h.sprintf)(Object(h._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},Object(r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},Object(h._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),Object(r.createElement)(me,{items:e})):null}function Oe(e){let{attributes:t,block:n,clientId:l}=e;const c=Object(d.useSelect)(e=>e(V).isInstalling(n.id),[n.id]),{installBlockType:o}=Object(d.useDispatch)(V),{replaceBlock:a}=Object(d.useDispatch)(p.store);return Object(r.createElement)(U.Button,{onClick:()=>o(n).then(e=>{if(e){const e=Object(s.getBlockType)(n.name),[c]=Object(s.parse)(t.originalContent);c&&e&&a(l,Object(s.createBlock)(e.name,c.attributes,c.innerBlocks))}}),disabled:c,isBusy:c,variant:"primary"},Object(h.sprintf)(Object(h.__)("Install %s"),n.title))}const ke=e=>{let{originalBlock:t,...n}=e;const{originalName:l,originalUndelimitedContent:c}=n.attributes,{replaceBlock:o}=Object(d.useDispatch)(p.store),a=()=>{o(n.clientId,Object(s.createBlock)("core/html",{content:c}))},i=!!c,b=Object(s.getBlockType)("core/html");let u=Object(h.sprintf)(Object(h.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||l);const m=[Object(r.createElement)(Oe,{key:"install",block:t,attributes:n.attributes,clientId:n.clientId})];return i&&b&&(u=Object(h.sprintf)(Object(h.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||l),m.push(Object(r.createElement)(U.Button,{key:"convert",onClick:a,variant:"link"},Object(h.__)("Keep as HTML")))),Object(r.createElement)("div",Object(p.useBlockProps)(),Object(r.createElement)(p.Warning,{actions:m},u),Object(r.createElement)(r.RawHTML,null,c))};var je=e=>t=>{const{originalName:n}=t.attributes,{block:l,hasPermission:c}=Object(d.useSelect)(e=>{const{getDownloadableBlocks:t}=e(V),l=t("block:"+n).filter(e=>{let{name:t}=e;return n===t});return{hasPermission:e(G.store).canUser("read","block-directory/search"),block:l.length&&l[0]}},[n]);return c&&l?Object(r.createElement)(ke,Object(z.a)({},t,{originalBlock:l})):Object(r.createElement)(e,t)};Object(a.registerPlugin)("block-directory",{render:()=>Object(r.createElement)(r.Fragment,null,Object(r.createElement)(q,null),Object(r.createElement)(be,null),Object(r.createElement)(pe,null))}),Object(i.addFilter)("blocks.registerBlockType","block-directory/fallback",(e,t)=>("core/missing"!==t||(e.edit=je(e.edit)),e))},BLhE:function(e,t){e.exports=window.wp.editPost},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},K9lf:function(e,t){e.exports=window.wp.compose},Tqx9:function(e,t){e.exports=window.wp.primitives},TvNi:function(e,t){e.exports=window.wp.plugins},URob:function(e,t,n){"use strict";var l=n("GRId"),c=n("Tqx9");const o=Object(l.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(c.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"}));t.a=o},Xxwi:function(e,t,n){"use strict";var l=n("GRId"),c=n("Tqx9");const o=Object(l.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(c.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"}));t.a=o},YLtl:function(e,t){e.exports=window.lodash},axFQ:function(e,t){e.exports=window.wp.blockEditor},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},iClF:function(e,t,n){"use strict";var l=n("GRId");t.a=function(e){let{icon:t,size:n=24,...c}=e;return Object(l.cloneElement)(t,{width:n,height:n,...c})}},jSdM:function(e,t){e.exports=window.wp.editor},jZUy:function(e,t){e.exports=window.wp.coreData},l3Sj:function(e,t){e.exports=window.wp.i18n},onLe:function(e,t){e.exports=window.wp.notices},rmEH:function(e,t){e.exports=window.wp.htmlEntities},"tI+e":function(e,t){e.exports=window.wp.components},wx14:function(e,t,n){"use strict";function l(){return(l=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{installedBlockTypes:[],isInstalling:{}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":return(0,u.omit)(e,t.blockId)}return e}}),p=window.wp.blockEditor;function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;if(t.some((t=>{let{name:l}=t;return l===e.name})))return!0;for(let l=0;lt=>{const l=e(p.store).getBlocks();return _(t).filter((e=>k(e,l)))})),E=(0,c.createRegistrySelector)((e=>t=>{const l=e(p.store).getBlocks();return _(t).filter((e=>!k(e,l)))}));function f(e,t){return e.blockManagement.isInstalling[t]||!1}function y(e){return e.errorNotices}function h(e,t){return e.errorNotices[t]}var v=window.wp.i18n,B=window.wp.apiFetch,N=e.n(B),I=window.wp.notices;const T=e=>new Promise(((t,l)=>{const n=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(n[t]=e[t])})),e.innerHTML&&n.appendChild(document.createTextNode(e.innerHTML)),n.onload=()=>t(!0),n.onerror=()=>l(new Error("Error loading asset.")),document.body.appendChild(n),("link"===n.nodeName.toLowerCase()||"script"===n.nodeName.toLowerCase()&&!n.src)&&t()}));function L(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function S(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function C(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const O=e=>async t=>{let{registry:l,dispatch:n}=t;const{id:o}=e;let r=!1;n.clearErrorNotice(o);try{n.setIsInstalling(o,!0);const t=L(e);let a={};if(t)await N()({method:"PUT",url:t,data:{status:"active"}});else{a=(await N()({method:"POST",path:"wp/v2/plugins",data:{slug:o,status:"active"}}))._links}n.addInstalledBlockType({...e,links:{...e.links,...a}}),await async function(){const e=await N()({url:document.location.href,parse:!1}),t=await e.text(),l=(new window.DOMParser).parseFromString(t,"text/html"),n=Array.from(l.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of n)await T(e)}();if(!l.select(s.store).getBlockTypes().some((t=>t.name===e.name)))throw new Error((0,v.__)("Error registering block. Try reloading the page."));l.dispatch(I.store).createInfoNotice((0,v.sprintf)((0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),r=!0}catch(e){let t=e.message||(0,v.__)("An error occurred."),r=e instanceof Error;const a={folder_exists:(0,v.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,v.__)("Error installing block. You can reload the page and try again.")};a[e.code]&&(r=!0,t=a[e.code]),n.setErrorNotice(o,t,r),l.dispatch(I.store).createErrorNotice(t,{speak:!0,isDismissible:!0})}return n.setIsInstalling(o,!1),r},D=e=>async t=>{let{registry:l,dispatch:n}=t;try{const t=L(e);await N()({method:"PUT",url:t,data:{status:"inactive"}}),await N()({method:"DELETE",url:t}),n.removeInstalledBlockType(e)}catch(e){l.dispatch(I.store).createErrorNotice(e.message||(0,v.__)("An error occurred."))}};function P(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function R(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function A(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function M(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function F(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}const V=e=>async t=>{let{dispatch:l}=t;if(e)try{l(S(e));const t=await N()({path:`wp/v2/block-directory/search?term=${e}`});l(C(t.map((e=>(0,u.mapKeys)(e,((e,t)=>(0,u.camelCase)(t))))),e))}catch{}},H={reducer:m,selectors:l,actions:n,resolvers:o,__experimentalUseThunks:!0},x=(0,c.createReduxStore)("core/block-directory",H);function $(){const{uninstallBlockType:e}=(0,c.useDispatch)(x),t=(0,c.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,c.useSelect)((e=>e(x).getUnusedBlockTypes()),[]);return(0,r.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,s.unregisterBlockType)(t.name)}))}),[t]),null}(0,c.register)(x);var K=window.wp.components,z=window.wp.compose,U=window.wp.coreData;function Y(){return Y=Object.assign||function(e){for(var t=1;t(0,r.createElement)(q,{key:`full_stars_${e}`,className:"block-directory-block-ratings__star-full",icon:W,size:16}))),(0,u.times)(o,(e=>(0,r.createElement)(q,{key:`half_stars_${e}`,className:"block-directory-block-ratings__star-half-full",icon:J,size:16}))),(0,u.times)(a,(e=>(0,r.createElement)(q,{key:`empty_stars_${e}`,className:"block-directory-block-ratings__star-empty",icon:Q,size:16}))))};var Z=e=>{let{rating:t}=e;return(0,r.createElement)("span",{className:"block-directory-block-ratings"},(0,r.createElement)(X,{rating:t}))};var ee=function(e){let{icon:t}=e;const l="block-directory-downloadable-block-icon";return null!==t.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,r.createElement)("img",{className:l,src:t,alt:""}):(0,r.createElement)(p.BlockIcon,{className:l,icon:t,showColors:!0})};var te=e=>{let{block:t}=e;const l=(0,c.useSelect)((e=>e(x).getErrorNoticeForBlock(t.id)),[t]);return l?(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},l.message,l.isFatal?" "+(0,v.__)("Try reloading the page."):null)):null};function le(e,t){let{title:l,rating:n,ratingCount:o}=e,{hasNotice:r,isInstalled:a,isInstalling:i}=t;const s=.5*Math.round(n/.5);return!a&&r?(0,v.sprintf)("Retry installing %s.",(0,j.decodeEntities)(l)):a?(0,v.sprintf)("Add %s.",(0,j.decodeEntities)(l)):i?(0,v.sprintf)("Installing %s.",(0,j.decodeEntities)(l)):o<1?(0,v.sprintf)("Install %s.",(0,j.decodeEntities)(l)):(0,v.sprintf)((0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,j.decodeEntities)(l),s,o)}var ne=function(e){let{composite:t,item:l,onClick:n}=e;const{author:o,description:a,icon:i,rating:d,title:u}=l,m=!!(0,s.getBlockType)(l.name),{hasNotice:p,isInstalling:k,isInstallable:b}=(0,c.useSelect)((e=>{const{getErrorNoticeForBlock:t,isInstalling:n}=e(x),o=t(l.id),r=o&&o.isFatal;return{hasNotice:!!o,isInstalling:n(l.id),isInstallable:!r}}),[l]);let g="";return m?g=(0,v.__)("Installed!"):k&&(g=(0,v.__)("Installing…")),(0,r.createElement)(K.__unstableCompositeItem,Y({role:"option",as:K.Button},t,{className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),n()},isBusy:k,disabled:k||!b,label:le(l,{hasNotice:p,isInstalled:m,isInstalling:k}),showTooltip:!0,tooltipPosition:"top center"}),(0,r.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},(0,r.createElement)(ee,{icon:i,title:u}),k?(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},(0,r.createElement)(K.Spinner,null)):(0,r.createElement)(Z,{rating:d})),(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},(0,r.createInterpolateElement)((0,v.sprintf)((0,v.__)("%1$s by %2$s"),(0,j.decodeEntities)(u),o),{span:(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,r.createElement)(te,{block:l}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},g||(0,j.decodeEntities)(a)),b&&!(m||k)&&(0,r.createElement)(K.VisuallyHidden,null,(0,v.__)("Install block")))))};var oe=function(e){let{items:t,onHover:l=u.noop,onSelect:n}=e;const o=(0,K.__unstableUseCompositeState)(),{installBlockType:a}=(0,c.useDispatch)(x);return t.length?(0,r.createElement)(K.__unstableComposite,Y({},o,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,v.__)("Blocks available for install")}),t.map((e=>(0,r.createElement)(ne,{key:e.id,composite:o,onClick:()=>{(0,s.getBlockType)(e.name)?n(e):a(e).then((t=>{t&&n(e)})),l(null)},onHover:l,item:e})))):null},re=window.wp.a11y;var ae=function(e){let{children:t,downloadableItems:l,hasLocalBlocks:n}=e;const o=l.length;return(0,r.useEffect)((()=>{(0,re.speak)((0,v.sprintf)((0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",o),o))}),[o]),(0,r.createElement)(r.Fragment,null,!n&&(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))};var ie=(0,r.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(G.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"}));var se=function(){return(0,r.createElement)("div",{className:"block-editor-inserter__no-results"},(0,r.createElement)(q,{className:"block-editor-inserter__no-results-icon",icon:ie}),(0,r.createElement)("p",null,(0,v.__)("No results found.")))};var ce=(0,z.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r}=e(x),{canInsertBlockType:a}=e(p.store),i=e(U.store).canUser("read","block-directory/search");return{downloadableItems:i?o(l).filter((e=>a(e,n,!0))):[],hasPermission:i,isLoading:r(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:a,isLoading:i,isTyping:s}=e;return void 0===a||i||s?(0,r.createElement)(r.Fragment,null,a&&!o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,r.createElement)(K.Spinner,null))):!1===a?o?null:(0,r.createElement)(se,null):t.length?(0,r.createElement)(ae,{downloadableItems:t,hasLocalBlocks:o},(0,r.createElement)(oe,{items:t,onSelect:l,onHover:n})):!o&&(0,r.createElement)(se,null)}));var de=function(){const[e,t]=(0,r.useState)(""),l=(0,u.debounce)(t,400);return(0,r.createElement)(p.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:a,hasItems:i,rootClientId:s}=t;return e!==a&&l(a),e?(0,r.createElement)(ce,{onSelect:n,onHover:o,rootClientId:s,filterValue:e,hasLocalBlocks:i,isTyping:a!==e}):null}))},ue=window.wp.editPost;function me(e){let{items:t}=e;return t.length?(0,r.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,r.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,r.createElement)(ee,{icon:t,title:n}),(0,r.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,r.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,r.createElement)("div",{className:"block-directory-compact-list__item-author"},(0,v.sprintf)((0,v.__)("By %s"),o))))}))):null}function pe(){const e=(0,c.useSelect)((e=>e(x).getNewBlockTypes()),[]);return e.length?(0,r.createElement)(ue.PluginPrePublishPanel,{icon:ie,title:(0,v.sprintf)((0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},(0,v._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),(0,r.createElement)(me,{items:e})):null}function ke(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e(x).isInstalling(l.id)),[l.id]),{installBlockType:a}=(0,c.useDispatch)(x),{replaceBlock:i}=(0,c.useDispatch)(p.store);return(0,r.createElement)(K.Button,{onClick:()=>a(l).then((e=>{if(e){const e=(0,s.getBlockType)(l.name),[o]=(0,s.parse)(t.originalContent);o&&e&&i(n,(0,s.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(0,v.sprintf)((0,v.__)("Install %s"),l.title))}const be=e=>{let{originalBlock:t,...l}=e;const{originalName:n,originalUndelimitedContent:o}=l.attributes,{replaceBlock:a}=(0,c.useDispatch)(p.store),i=()=>{a(l.clientId,(0,s.createBlock)("core/html",{content:o}))},d=!!o,u=(0,s.getBlockType)("core/html");let m=(0,v.sprintf)((0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||n);const k=[(0,r.createElement)(ke,{key:"install",block:t,attributes:l.attributes,clientId:l.clientId})];return d&&u&&(m=(0,v.sprintf)((0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||n),k.push((0,r.createElement)(K.Button,{key:"convert",onClick:i,variant:"link"},(0,v.__)("Keep as HTML")))),(0,r.createElement)("div",(0,p.useBlockProps)(),(0,r.createElement)(p.Warning,{actions:k},m),(0,r.createElement)(r.RawHTML,null,o))};var ge=e=>t=>{const{originalName:l}=t.attributes,{block:n,hasPermission:o}=(0,c.useSelect)((e=>{const{getDownloadableBlocks:t}=e(x),n=t("block:"+l).filter((e=>{let{name:t}=e;return l===t}));return{hasPermission:e(U.store).canUser("read","block-directory/search"),block:n.length&&n[0]}}),[l]);return o&&n?(0,r.createElement)(be,Y({},t,{originalBlock:n})):(0,r.createElement)(e,t)};(0,a.registerPlugin)("block-directory",{render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)($,null),(0,r.createElement)(de,null),(0,r.createElement)(pe,null))}),(0,i.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>("core/missing"!==t||(e.edit=ge(e.edit)),e))),(window.wp=window.wp||{}).blockDirectory=t}(); \ No newline at end of file diff --git a/wp-includes/js/dist/block-editor.js b/wp-includes/js/dist/block-editor.js index bede895032..29b56e0ca1 100644 --- a/wp-includes/js/dist/block-editor.js +++ b/wp-includes/js/dist/block-editor.js @@ -1,23724 +1,9 @@ -this["wp"] = this["wp"] || {}; this["wp"]["blockEditor"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "tr0p"); -/******/ }) -/************************************************************************/ -/******/ ({ +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ -/***/ "+0ps": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ useNotifyCopy; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ useClipboardHandler; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","dom"] -var external_wp_dom_ = __webpack_require__("1CF3"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","notices"] -var external_wp_notices_ = __webpack_require__("onLe"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","blob"] -var external_wp_blob_ = __webpack_require__("xTGt"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/get-paste-event-data.js -/** - * WordPress dependencies - */ - - -function getPasteEventData(_ref) { - let { - clipboardData - } = _ref; - let plainText = ''; - let html = ''; // IE11 only supports `Text` as an argument for `getData` and will - // otherwise throw an invalid argument error, so we try the standard - // arguments first, then fallback to `Text` if they fail. - - try { - plainText = clipboardData.getData('text/plain'); - html = clipboardData.getData('text/html'); - } catch (error1) { - try { - html = clipboardData.getData('Text'); - } catch (error2) { - // Some browsers like UC Browser paste plain text by default and - // don't support clipboardData at all, so allow default - // behaviour. - return; - } - } - - const files = Object(external_wp_dom_["getFilesFromDataTransfer"])(clipboardData).filter(_ref2 => { - let { - type - } = _ref2; - return /^image\/(?:jpe?g|png|gif)$/.test(type); - }); // Only process files if no HTML is present. - // A pasted file may have the URL as plain text. - - if (files.length && !html) { - html = files.map(file => ``).join(''); - plainText = ''; - } - - return { - html, - plainText - }; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js - - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - -function useNotifyCopy() { - const { - getBlockName - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - getBlockType - } = Object(external_wp_data_["useSelect"])(external_wp_blocks_["store"]); - const { - createSuccessNotice - } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]); - return Object(external_wp_element_["useCallback"])((eventType, selectedBlockClientIds) => { - let notice = ''; - - if (selectedBlockClientIds.length === 1) { - var _getBlockType; - - const clientId = selectedBlockClientIds[0]; - const title = (_getBlockType = getBlockType(getBlockName(clientId))) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title; - notice = eventType === 'copy' ? Object(external_wp_i18n_["sprintf"])( // Translators: Name of the block being copied, e.g. "Paragraph". - Object(external_wp_i18n_["__"])('Copied "%s" to clipboard.'), title) : Object(external_wp_i18n_["sprintf"])( // Translators: Name of the block being cut, e.g. "Paragraph". - Object(external_wp_i18n_["__"])('Moved "%s" to clipboard.'), title); - } else { - notice = eventType === 'copy' ? Object(external_wp_i18n_["sprintf"])( // Translators: %d: Number of blocks being copied. - Object(external_wp_i18n_["_n"])('Copied %d block to clipboard.', 'Copied %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length) : Object(external_wp_i18n_["sprintf"])( // Translators: %d: Number of blocks being cut. - Object(external_wp_i18n_["_n"])('Moved %d block to clipboard.', 'Moved %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length); - } - - createSuccessNotice(notice, { - type: 'snackbar' - }); - }, []); -} -function useClipboardHandler() { - const { - getBlocksByClientId, - getSelectedBlockClientIds, - hasMultiSelection, - getSettings - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - flashBlock, - removeBlocks, - replaceBlocks - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const notifyCopy = useNotifyCopy(); - return Object(external_wp_compose_["useRefEffect"])(node => { - function handler(event) { - const selectedBlockClientIds = getSelectedBlockClientIds(); - - if (selectedBlockClientIds.length === 0) { - return; - } // Always handle multiple selected blocks. - - - if (!hasMultiSelection()) { - const { - target - } = event; - const { - ownerDocument - } = target; // If copying, only consider actual text selection as selection. - // Otherwise, any focus on an input field is considered. - - const hasSelection = event.type === 'copy' || event.type === 'cut' ? Object(external_wp_dom_["documentHasUncollapsedSelection"])(ownerDocument) : Object(external_wp_dom_["documentHasSelection"])(ownerDocument); // Let native copy behaviour take over in input fields. - - if (hasSelection) { - return; - } - } - - if (!node.contains(event.target.ownerDocument.activeElement)) { - return; - } - - const eventDefaultPrevented = event.defaultPrevented; - event.preventDefault(); - - if (event.type === 'copy' || event.type === 'cut') { - if (selectedBlockClientIds.length === 1) { - flashBlock(selectedBlockClientIds[0]); - } - - notifyCopy(event.type, selectedBlockClientIds); - const blocks = getBlocksByClientId(selectedBlockClientIds); - const serialized = Object(external_wp_blocks_["serialize"])(blocks); - event.clipboardData.setData('text/plain', serialized); - event.clipboardData.setData('text/html', serialized); - } - - if (event.type === 'cut') { - removeBlocks(selectedBlockClientIds); - } else if (event.type === 'paste') { - if (eventDefaultPrevented) { - // This was likely already handled in rich-text/use-paste-handler.js - return; - } - - const { - __experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML - } = getSettings(); - const { - plainText, - html - } = getPasteEventData(event); - const blocks = Object(external_wp_blocks_["pasteHandler"])({ - HTML: html, - plainText, - mode: 'BLOCKS', - canUserUseUnfilteredHTML - }); - replaceBlocks(selectedBlockClientIds, blocks, blocks.length - 1, -1); - } - } - - node.ownerDocument.addEventListener('copy', handler); - node.ownerDocument.addEventListener('cut', handler); - node.ownerDocument.addEventListener('paste', handler); - return () => { - node.ownerDocument.removeEventListener('copy', handler); - node.ownerDocument.removeEventListener('cut', handler); - node.ownerDocument.removeEventListener('paste', handler); - }; - }, []); -} - -function CopyHandler(_ref) { - let { - children - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - ref: useClipboardHandler() - }, children); -} - -/* harmony default export */ var copy_handler = __webpack_exports__["a"] = (CopyHandler); - - -/***/ }), - -/***/ "+6d5": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockMovingModeClassNames; }); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * Returns the class names used for block moving mode. - * - * @param {string} clientId The block client ID to insert above. - * - * @return {string} The class names. - */ - -function useBlockMovingModeClassNames(clientId) { - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => { - const { - hasBlockMovingClientId, - canInsertBlockType, - getBlockName, - getBlockRootClientId, - isBlockSelected - } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); // The classes are only relevant for the selected block. Avoid - // re-rendering all blocks! - - if (!isBlockSelected(clientId)) { - return; - } - - const movingClientId = hasBlockMovingClientId(); - - if (!movingClientId) { - return; - } - - return classnames__WEBPACK_IMPORTED_MODULE_0___default()('is-block-moving-mode', { - 'can-insert-moving-block': canInsertBlockType(getBlockName(movingClientId), getBlockRootClientId(clientId)) - }); - }, [clientId]); -} - - -/***/ }), - -/***/ "+DUQ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export a */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animated", function() { return animated; }); -/* harmony import */ var _react_spring_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("kmrn"); -/* harmony reexport (checked) */ if(__webpack_require__.o(_react_spring_core__WEBPACK_IMPORTED_MODULE_0__, "useSpring")) __webpack_require__.d(__webpack_exports__, "useSpring", function() { return _react_spring_core__WEBPACK_IMPORTED_MODULE_0__["useSpring"]; }); - -/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("faye"); -/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("nEW0"); -/* harmony import */ var _react_spring_animated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("dfZa"); - - - - - - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -const _excluded$2 = ["style", "children", "scrollTop", "scrollLeft"]; -const isCustomPropRE = /^--/; - -function dangerousStyleValue(name, value) { - if (value == null || typeof value === 'boolean' || value === '') return ''; - if (typeof value === 'number' && value !== 0 && !isCustomPropRE.test(name) && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; - return ('' + value).trim(); -} - -const attributeCache = {}; -function applyAnimatedValues(instance, props) { - if (!instance.nodeType || !instance.setAttribute) { - return false; - } - - const isFilterElement = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter'; - - const _ref = props, - { - style, - children, - scrollTop, - scrollLeft - } = _ref, - attributes = _objectWithoutPropertiesLoose(_ref, _excluded$2); - - const values = Object.values(attributes); - const names = Object.keys(attributes).map(name => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, n => '-' + n.toLowerCase()))); - - if (children !== void 0) { - instance.textContent = children; - } - - for (let name in style) { - if (style.hasOwnProperty(name)) { - const value = dangerousStyleValue(name, style[name]); - - if (isCustomPropRE.test(name)) { - instance.style.setProperty(name, value); - } else { - instance.style[name] = value; - } - } - } - - names.forEach((name, i) => { - instance.setAttribute(name, values[i]); - }); - - if (scrollTop !== void 0) { - instance.scrollTop = scrollTop; - } - - if (scrollLeft !== void 0) { - instance.scrollLeft = scrollLeft; - } -} -let isUnitlessNumber = { - animationIterationCount: true, - borderImageOutset: true, - borderImageSlice: true, - borderImageWidth: true, - boxFlex: true, - boxFlexGroup: true, - boxOrdinalGroup: true, - columnCount: true, - columns: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - flexOrder: true, - gridRow: true, - gridRowEnd: true, - gridRowSpan: true, - gridRowStart: true, - gridColumn: true, - gridColumnEnd: true, - gridColumnSpan: true, - gridColumnStart: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeDasharray: true, - strokeDashoffset: true, - strokeMiterlimit: true, - strokeOpacity: true, - strokeWidth: true -}; - -const prefixKey = (prefix, key) => prefix + key.charAt(0).toUpperCase() + key.substring(1); - -const prefixes = ['Webkit', 'Ms', 'Moz', 'O']; -isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => { - prefixes.forEach(prefix => acc[prefixKey(prefix, prop)] = acc[prop]); - return acc; -}, isUnitlessNumber); - -const _excluded$1 = ["x", "y", "z"]; -const domTransforms = /^(matrix|translate|scale|rotate|skew)/; -const pxTransforms = /^(translate)/; -const degTransforms = /^(rotate|skew)/; - -const addUnit = (value, unit) => _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* is */ "s"].num(value) && value !== 0 ? value + unit : value; - -const isValueIdentity = (value, id) => _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* is */ "s"].arr(value) ? value.every(v => isValueIdentity(v, id)) : _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* is */ "s"].num(value) ? value === id : parseFloat(value) === id; - -class AnimatedStyle extends _react_spring_animated__WEBPACK_IMPORTED_MODULE_3__[/* AnimatedObject */ "a"] { - constructor(_ref) { - let { - x, - y, - z - } = _ref, - style = _objectWithoutPropertiesLoose(_ref, _excluded$1); - - const inputs = []; - const transforms = []; - - if (x || y || z) { - inputs.push([x || 0, y || 0, z || 0]); - transforms.push(xyz => [`translate3d(${xyz.map(v => addUnit(v, 'px')).join(',')})`, isValueIdentity(xyz, 0)]); - } - - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* eachProp */ "l"])(style, (value, key) => { - if (key === 'transform') { - inputs.push([value || '']); - transforms.push(transform => [transform, transform === '']); - } else if (domTransforms.test(key)) { - delete style[key]; - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* is */ "s"].und(value)) return; - const unit = pxTransforms.test(key) ? 'px' : degTransforms.test(key) ? 'deg' : ''; - inputs.push(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* toArray */ "y"])(value)); - transforms.push(key === 'rotate3d' ? ([x, y, z, deg]) => [`rotate3d(${x},${y},${z},${addUnit(deg, unit)})`, isValueIdentity(deg, 0)] : input => [`${key}(${input.map(v => addUnit(v, unit)).join(',')})`, isValueIdentity(input, key.startsWith('scale') ? 1 : 0)]); - } - }); - - if (inputs.length) { - style.transform = new FluidTransform(inputs, transforms); - } - - super(style); - } - -} - -class FluidTransform extends _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* FluidValue */ "a"] { - constructor(inputs, transforms) { - super(); - this._value = null; - this.inputs = inputs; - this.transforms = transforms; - } - - get() { - return this._value || (this._value = this._get()); - } - - _get() { - let transform = ''; - let identity = true; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* each */ "k"])(this.inputs, (input, i) => { - const arg1 = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* getFluidValue */ "q"])(input[0]); - const [t, id] = this.transforms[i](_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* is */ "s"].arr(arg1) ? arg1 : input.map(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* getFluidValue */ "q"])); - transform += ' ' + t; - identity = identity && id; - }); - return identity ? 'none' : transform; - } - - observerAdded(count) { - if (count == 1) Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* each */ "k"])(this.inputs, input => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* each */ "k"])(input, value => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* hasFluidValue */ "r"])(value) && Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* addFluidObserver */ "c"])(value, this))); - } - - observerRemoved(count) { - if (count == 0) Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* each */ "k"])(this.inputs, input => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* each */ "k"])(input, value => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* hasFluidValue */ "r"])(value) && Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* removeFluidObserver */ "x"])(value, this))); - } - - eventObserved(event) { - if (event.type == 'change') { - this._value = null; - } - - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* callFluidObservers */ "d"])(this, event); - } - -} - -const primitives = ['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']; - -const _excluded = ["scrollTop", "scrollLeft"]; -_react_spring_core__WEBPACK_IMPORTED_MODULE_0__["Globals"].assign({ - batchedUpdates: react_dom__WEBPACK_IMPORTED_MODULE_1__["unstable_batchedUpdates"], - createStringInterpolator: _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* createStringInterpolator */ "g"], - colors: _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* colors */ "e"] -}); -const host = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_3__[/* createHost */ "d"])(primitives, { - applyAnimatedValues, - createAnimatedStyle: style => new AnimatedStyle(style), - getComponentProps: _ref => { - let props = _objectWithoutPropertiesLoose(_ref, _excluded); - - return props; - } -}); -const animated = host.animated; - - - - -/***/ }), - -/***/ "+G0a": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -/** - * Retrieves the block types inserter state. - * - * @param {string=} rootClientId Insertion's root client ID. - * @param {Function} onInsert function called when inserter a list of blocks. - * @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler) - */ - -const useBlockTypesState = (rootClientId, onInsert) => { - const { - categories, - collections, - items - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => { - const { - getInserterItems - } = select(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); - const { - getCategories, - getCollections - } = select(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["store"]); - return { - categories: getCategories(), - collections: getCollections(), - items: getInserterItems(rootClientId) - }; - }, [rootClientId]); - const onSelectItem = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useCallback"])((_ref, shouldFocusBlock) => { - let { - name, - initialAttributes, - innerBlocks - } = _ref; - const insertedBlock = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(name, initialAttributes, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["createBlocksFromInnerBlocksTemplate"])(innerBlocks)); - onInsert(insertedBlock, undefined, shouldFocusBlock); - }, [onInsert]); - return [items, categories, collections, onSelectItem]; -}; - -/* harmony default export */ __webpack_exports__["a"] = (useBlockTypesState); - - -/***/ }), - -/***/ "+WrK": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const symbol = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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 */ __webpack_exports__["a"] = (symbol); - - -/***/ }), - -/***/ "+gtr": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockToolbar; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/index.js -var block_mover = __webpack_require__("JygI"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-display-information/index.js -var use_block_display_information = __webpack_require__("wC17"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js -var block_icon = __webpack_require__("7SSY"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/utils.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -const { - clearTimeout: utils_clearTimeout, - setTimeout: utils_setTimeout -} = window; -const DEBOUNCE_TIMEOUT = 200; -/** - * Hook that creates a showMover state, as well as debounced show/hide callbacks. - * - * @param {Object} props Component props. - * @param {Object} props.ref Element reference. - * @param {boolean} props.isFocused Whether the component has current focus. - * @param {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. - * @param {Function} [props.onChange=noop] Callback function. - */ - -function useDebouncedShowMovers(_ref) { - let { - ref, - isFocused, - debounceTimeout = DEBOUNCE_TIMEOUT, - onChange = external_lodash_["noop"] - } = _ref; - const [showMovers, setShowMovers] = Object(external_wp_element_["useState"])(false); - const timeoutRef = Object(external_wp_element_["useRef"])(); - - const handleOnChange = nextIsFocused => { - if (ref !== null && ref !== void 0 && ref.current) { - setShowMovers(nextIsFocused); - } - - onChange(nextIsFocused); - }; - - const getIsHovered = () => { - return (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.matches(':hover'); - }; - - const shouldHideMovers = () => { - const isHovered = getIsHovered(); - return !isFocused && !isHovered; - }; - - const clearTimeoutRef = () => { - const timeout = timeoutRef.current; - - if (timeout && utils_clearTimeout) { - utils_clearTimeout(timeout); - } - }; - - const debouncedShowMovers = event => { - if (event) { - event.stopPropagation(); - } - - clearTimeoutRef(); - - if (!showMovers) { - handleOnChange(true); - } - }; - - const debouncedHideMovers = event => { - if (event) { - event.stopPropagation(); - } - - clearTimeoutRef(); - timeoutRef.current = utils_setTimeout(() => { - if (shouldHideMovers()) { - handleOnChange(false); - } - }, debounceTimeout); - }; - - Object(external_wp_element_["useEffect"])(() => () => clearTimeoutRef(), []); - return { - showMovers, - debouncedShowMovers, - debouncedHideMovers - }; -} -/** - * Hook that provides a showMovers state and gesture events for DOM elements - * that interact with the showMovers state. - * - * @param {Object} props Component props. - * @param {Object} props.ref Element reference. - * @param {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. - * @param {Function} [props.onChange=noop] Callback function. - */ - -function useShowMoversGestures(_ref2) { - let { - ref, - debounceTimeout = DEBOUNCE_TIMEOUT, - onChange = external_lodash_["noop"] - } = _ref2; - const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false); - const { - showMovers, - debouncedShowMovers, - debouncedHideMovers - } = useDebouncedShowMovers({ - ref, - debounceTimeout, - isFocused, - onChange - }); - const registerRef = Object(external_wp_element_["useRef"])(false); - - const isFocusedWithin = () => { - return (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.contains(ref.current.ownerDocument.activeElement); - }; - - Object(external_wp_element_["useEffect"])(() => { - const node = ref.current; - - const handleOnFocus = () => { - if (isFocusedWithin()) { - setIsFocused(true); - debouncedShowMovers(); - } - }; - - const handleOnBlur = () => { - if (!isFocusedWithin()) { - setIsFocused(false); - debouncedHideMovers(); - } - }; - /** - * Events are added via DOM events (vs. React synthetic events), - * as the child React components swallow mouse events. - */ - - - if (node && !registerRef.current) { - node.addEventListener('focus', handleOnFocus, true); - node.addEventListener('blur', handleOnBlur, true); - registerRef.current = true; - } - - return () => { - if (node) { - node.removeEventListener('focus', handleOnFocus); - node.removeEventListener('blur', handleOnBlur); - } - }; - }, [ref, registerRef, setIsFocused, debouncedShowMovers, debouncedHideMovers]); - return { - showMovers, - gestures: { - onMouseMove: debouncedShowMovers, - onMouseLeave: debouncedHideMovers - } - }; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-parent-selector/index.js - - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - -/** - * Block parent selector component, displaying the hierarchy of the - * current block selection as a single icon to "go up" a level. - * - * @return {WPComponent} Parent block selector. - */ - -function BlockParentSelector() { - const { - selectBlock, - toggleBlockHighlight - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const { - firstParentClientId, - shouldHide, - hasReducedUI - } = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockName, - getBlockParents, - getSelectedBlockClientId, - getSettings - } = select(store["a" /* store */]); - const { - hasBlockSupport - } = select(external_wp_blocks_["store"]); - const selectedBlockClientId = getSelectedBlockClientId(); - const parents = getBlockParents(selectedBlockClientId); - const _firstParentClientId = parents[parents.length - 1]; - const parentBlockName = getBlockName(_firstParentClientId); - - const _parentBlockType = Object(external_wp_blocks_["getBlockType"])(parentBlockName); - - const settings = getSettings(); - return { - firstParentClientId: _firstParentClientId, - shouldHide: !hasBlockSupport(_parentBlockType, '__experimentalParentSelector', true), - hasReducedUI: settings.hasReducedUI - }; - }, []); - const blockInformation = Object(use_block_display_information["a" /* default */])(firstParentClientId); // Allows highlighting the parent block outline when focusing or hovering - // the parent block selector within the child. - - const nodeRef = Object(external_wp_element_["useRef"])(); - const { - gestures: showMoversGestures - } = useShowMoversGestures({ - ref: nodeRef, - - onChange(isFocused) { - if (isFocused && hasReducedUI) { - return; - } - - toggleBlockHighlight(firstParentClientId, isFocused); - } - - }); - - if (shouldHide || firstParentClientId === undefined) { - return null; - } - - return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ - className: "block-editor-block-parent-selector", - key: firstParentClientId, - ref: nodeRef - }, showMoversGestures), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - className: "block-editor-block-parent-selector__button", - onClick: () => selectBlock(firstParentClientId), - label: Object(external_wp_i18n_["sprintf"])( - /* translators: %s: Name of the block's parent. */ - Object(external_wp_i18n_["__"])('Select %s'), blockInformation.title), - showTooltip: true, - icon: Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - icon: blockInformation.icon - }) - })); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js -var stack = __webpack_require__("wzfx"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js -var block_title = __webpack_require__("f8JO"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js + 2 modules -var block_preview = __webpack_require__("REKd"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/preview-block-popover.js - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function PreviewBlockPopover(_ref) { - let { - blocks - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__popover__preview__parent" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__popover__preview__container" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { - className: "block-editor-block-switcher__preview__popover", - position: "bottom right", - focusOnMount: false - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__preview" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__preview-title" - }, Object(external_wp_i18n_["__"])('Preview')), Object(external_wp_element_["createElement"])(block_preview["a" /* default */], { - viewportWidth: 500, - blocks: blocks - }))))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-transformations-menu.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -const BlockTransformationsMenu = _ref => { - let { - className, - possibleBlockTransformations, - onSelect, - blocks - } = _ref; - const [hoveredTransformItemName, setHoveredTransformItemName] = Object(external_wp_element_["useState"])(); - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { - label: Object(external_wp_i18n_["__"])('Transform to'), - className: className - }, hoveredTransformItemName && Object(external_wp_element_["createElement"])(PreviewBlockPopover, { - blocks: Object(external_wp_blocks_["switchToBlockType"])(blocks, hoveredTransformItemName) - }), possibleBlockTransformations.map(item => { - const { - name, - icon, - title, - isDisabled - } = item; - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - key: name, - className: Object(external_wp_blocks_["getBlockMenuDefaultClassName"])(name), - onClick: event => { - event.preventDefault(); - onSelect(name); - }, - disabled: isDisabled, - onMouseLeave: () => setHoveredTransformItemName(null), - onMouseEnter: () => setHoveredTransformItemName(name) - }, Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - icon: icon, - showColors: true - }), title); - })); -}; - -/* harmony default export */ var block_transformations_menu = (BlockTransformationsMenu); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js + 1 modules -var block_styles = __webpack_require__("7NR9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-styles-menu.js - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -function BlockStylesMenu(_ref) { - let { - hoveredBlock, - onSwitch - } = _ref; - const { - name, - clientId - } = hoveredBlock; - const [hoveredClassName, setHoveredClassName] = Object(external_wp_element_["useState"])(); - const blockType = Object(external_wp_data_["useSelect"])(select => select(external_wp_blocks_["store"]).getBlockType(name), [name]); - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { - label: Object(external_wp_i18n_["__"])('Styles'), - className: "block-editor-block-switcher__styles__menugroup" - }, hoveredClassName && Object(external_wp_element_["createElement"])(PreviewBlockPopover, { - blocks: blockType && blockType.example ? Object(external_wp_blocks_["getBlockFromExample"])(blockType.name, { - attributes: { ...blockType.example.attributes, - className: hoveredClassName - }, - innerBlocks: blockType.example.innerBlocks - }) : Object(external_wp_blocks_["cloneBlock"])(hoveredBlock, { - className: hoveredClassName - }) - }), Object(external_wp_element_["createElement"])(block_styles["a" /* default */], { - clientId: clientId, - onSwitch: onSwitch, - onHoverClassName: setHoveredClassName, - itemRole: "menuitem" - })); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js -var chevron_right = __webpack_require__("1iEr"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/utils.js -/** - * WordPress dependencies - */ - -/** - * Try to find a matching block by a block's name in a provided - * block. We recurse through InnerBlocks and return the reference - * of the matched block (it could be an InnerBlock). - * If no match is found return nothing. - * - * @param {WPBlock} block The block to try to find a match. - * @param {string} selectedBlockName The block's name to use for matching condition. - * @param {Set} consumedBlocks A set holding the previously matched/consumed blocks. - * - * @return {WPBlock?} The matched block if found or nothing(`undefined`). - */ - -const getMatchingBlockByName = function (block, selectedBlockName) { - let consumedBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set(); - const { - clientId, - name, - innerBlocks = [] - } = block; // Check if block has been consumed already. - - if (consumedBlocks.has(clientId)) return; - if (name === selectedBlockName) return block; // Try to find a matching block from InnerBlocks recursively. - - for (const innerBlock of innerBlocks) { - const match = getMatchingBlockByName(innerBlock, selectedBlockName, consumedBlocks); - if (match) return match; - } -}; -/** - * Find and return the block attributes to retain through - * the transformation, based on Block Type's `role:content` - * attributes. If no `role:content` attributes exist, - * return selected block's attributes. - * - * @param {string} name Block type's namespaced name. - * @param {Object} attributes Selected block's attributes. - * @return {Object} The block's attributes to retain. - */ - -const getRetainedBlockAttributes = (name, attributes) => { - const contentAttributes = Object(external_wp_blocks_["__experimentalGetBlockAttributesNamesByRole"])(name, 'content'); - if (!(contentAttributes !== null && contentAttributes !== void 0 && contentAttributes.length)) return attributes; - return contentAttributes.reduce((_accumulator, attribute) => { - if (attributes[attribute]) _accumulator[attribute] = attributes[attribute]; - return _accumulator; - }, {}); -}; - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/use-transformed-patterns.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * Mutate the matched block's attributes by getting - * which block type's attributes to retain and prioritize - * them in the merging of the attributes. - * - * @param {WPBlock} match The matched block. - * @param {WPBlock} selectedBlock The selected block. - * @return {void} - */ - -const transformMatchingBlock = (match, selectedBlock) => { - // Get the block attributes to retain through the transformation. - const retainedBlockAttributes = getRetainedBlockAttributes(selectedBlock.name, selectedBlock.attributes); - match.attributes = { ...match.attributes, - ...retainedBlockAttributes - }; -}; -/** - * By providing the selected blocks and pattern's blocks - * find the matching blocks, transform them and return them. - * If not all selected blocks are matched, return nothing. - * - * @param {WPBlock[]} selectedBlocks The selected blocks. - * @param {WPBlock[]} patternBlocks The pattern's blocks. - * @return {WPBlock[]|void} The transformed pattern's blocks or undefined if not all selected blocks have been matched. - */ - -const getPatternTransformedBlocks = (selectedBlocks, patternBlocks) => { - // Clone Pattern's blocks to produce new clientIds and be able to mutate the matches. - const _patternBlocks = patternBlocks.map(block => Object(external_wp_blocks_["cloneBlock"])(block)); - /** - * Keep track of the consumed pattern blocks. - * This is needed because we loop the selected blocks - * and for example we may have selected two paragraphs and - * the pattern's blocks could have more `paragraphs`. - */ - - - const consumedBlocks = new Set(); - - for (const selectedBlock of selectedBlocks) { - let isMatch = false; - - for (const patternBlock of _patternBlocks) { - const match = getMatchingBlockByName(patternBlock, selectedBlock.name, consumedBlocks); - if (!match) continue; - isMatch = true; - consumedBlocks.add(match.clientId); // We update (mutate) the matching pattern block. - - transformMatchingBlock(match, selectedBlock); // No need to loop through other pattern's blocks. - - break; - } // Bail eary if a selected block has not been matched. - - - if (!isMatch) return; - } - - return _patternBlocks; -}; -/** - * @typedef {WPBlockPattern & {transformedBlocks: WPBlock[]}} TransformedBlockPattern - */ - -/** - * Custom hook that accepts patterns from state and the selected - * blocks and tries to match these with the pattern's blocks. - * If all selected blocks are matched with a Pattern's block, - * we transform them by retaining block's attributes with `role:content`. - * The transformed pattern's blocks are set to a new pattern - * property `transformedBlocks`. - * - * @param {WPBlockPattern[]} patterns Patterns from state. - * @param {WPBlock[]} selectedBlocks The currently selected blocks. - * @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks. - */ -// TODO tests - -const useTransformedPatterns = (patterns, selectedBlocks) => { - return Object(external_wp_element_["useMemo"])(() => patterns.reduce((accumulator, _pattern) => { - const transformedBlocks = getPatternTransformedBlocks(selectedBlocks, _pattern.blocks); - - if (transformedBlocks) { - accumulator.push({ ..._pattern, - transformedBlocks - }); - } - - return accumulator; - }, []), [patterns, selectedBlocks]); -}; - -/* harmony default export */ var use_transformed_patterns = (useTransformedPatterns); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/pattern-transformations-menu.js - - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -function PatternTransformationsMenu(_ref) { - let { - blocks, - patterns: statePatterns, - onSelect - } = _ref; - const [showTransforms, setShowTransforms] = Object(external_wp_element_["useState"])(false); - const patterns = use_transformed_patterns(statePatterns, blocks); - if (!patterns.length) return null; - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { - className: "block-editor-block-switcher__pattern__transforms__menugroup" - }, showTransforms && Object(external_wp_element_["createElement"])(PreviewPatternsPopover, { - patterns: patterns, - onSelect: onSelect - }), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: event => { - event.preventDefault(); - setShowTransforms(!showTransforms); - }, - icon: chevron_right["a" /* default */] - }, Object(external_wp_i18n_["__"])('Patterns'))); -} - -function PreviewPatternsPopover(_ref2) { - let { - patterns, - onSelect - } = _ref2; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__popover__preview__parent" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__popover__preview__container" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { - className: "block-editor-block-switcher__preview__popover", - position: "bottom right" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__preview" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__preview-title" - }, Object(external_wp_i18n_["__"])('Preview')), Object(external_wp_element_["createElement"])(BlockPatternsList, { - patterns: patterns, - onSelect: onSelect - }))))); -} - -function BlockPatternsList(_ref3) { - let { - patterns, - onSelect - } = _ref3; - const composite = Object(external_wp_components_["__unstableUseCompositeState"])(); - return Object(external_wp_element_["createElement"])(external_wp_components_["__unstableComposite"], Object(esm_extends["a" /* default */])({}, composite, { - role: "listbox", - className: "block-editor-block-switcher__preview-patterns-container", - "aria-label": Object(external_wp_i18n_["__"])('Patterns list') - }), patterns.map(pattern => Object(external_wp_element_["createElement"])(BlockPattern, { - key: pattern.name, - pattern: pattern, - onSelect: onSelect, - composite: composite - }))); -} - -function BlockPattern(_ref4) { - let { - pattern, - onSelect, - composite - } = _ref4; - // TODO check pattern/preview width... - const baseClassName = 'block-editor-block-switcher__preview-patterns-container'; - const descriptionId = Object(external_wp_compose_["useInstanceId"])(BlockPattern, `${baseClassName}-list__item-description`); - return Object(external_wp_element_["createElement"])("div", { - className: `${baseClassName}-list__list-item`, - "aria-label": pattern.title, - "aria-describedby": pattern.description ? descriptionId : undefined - }, Object(external_wp_element_["createElement"])(external_wp_components_["__unstableCompositeItem"], Object(esm_extends["a" /* default */])({ - role: "option", - as: "div" - }, composite, { - className: `${baseClassName}-list__item`, - onClick: () => onSelect(pattern.transformedBlocks) - }), Object(external_wp_element_["createElement"])(block_preview["a" /* default */], { - blocks: pattern.transformedBlocks, - viewportWidth: pattern.viewportWidth || 500 - }), Object(external_wp_element_["createElement"])("div", { - className: `${baseClassName}-list__item-title` - }, pattern.title)), !!pattern.description && Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { - id: descriptionId - }, pattern.description)); -} - -/* harmony default export */ var pattern_transformations_menu = (PatternTransformationsMenu); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - - - -const BlockSwitcherDropdownMenu = _ref => { - let { - clientIds, - blocks - } = _ref; - const { - replaceBlocks - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const blockInformation = Object(use_block_display_information["a" /* default */])(blocks[0].clientId); - const { - possibleBlockTransformations, - canRemove, - hasBlockStyles, - icon, - blockTitle, - patterns - } = Object(external_wp_data_["useSelect"])(select => { - var _getBlockType2; - - const { - getBlockRootClientId, - getBlockTransformItems, - __experimentalGetPatternTransformItems - } = select(store["a" /* store */]); - const { - getBlockStyles, - getBlockType - } = select(external_wp_blocks_["store"]); - const { - canRemoveBlocks - } = select(store["a" /* store */]); - const rootClientId = getBlockRootClientId(Object(external_lodash_["castArray"])(clientIds)[0]); - const [{ - name: firstBlockName - }] = blocks; - - const _isSingleBlockSelected = blocks.length === 1; - - const styles = _isSingleBlockSelected && getBlockStyles(firstBlockName); - - let _icon; - - if (_isSingleBlockSelected) { - _icon = blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon; // Take into account active block variations. - } else { - var _getBlockType; - - const isSelectionOfSameType = Object(external_lodash_["uniq"])(blocks.map(_ref2 => { - let { - name - } = _ref2; - return name; - })).length === 1; // When selection consists of blocks of multiple types, display an - // appropriate icon to communicate the non-uniformity. - - _icon = isSelectionOfSameType ? (_getBlockType = getBlockType(firstBlockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon : stack["a" /* default */]; - } - - return { - possibleBlockTransformations: getBlockTransformItems(blocks, rootClientId), - canRemove: canRemoveBlocks(clientIds, rootClientId), - hasBlockStyles: !!(styles !== null && styles !== void 0 && styles.length), - icon: _icon, - blockTitle: (_getBlockType2 = getBlockType(firstBlockName)) === null || _getBlockType2 === void 0 ? void 0 : _getBlockType2.title, - patterns: __experimentalGetPatternTransformItems(blocks, rootClientId) - }; - }, [clientIds, blocks, blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon]); - const isReusable = blocks.length === 1 && Object(external_wp_blocks_["isReusableBlock"])(blocks[0]); - const isTemplate = blocks.length === 1 && Object(external_wp_blocks_["isTemplatePart"])(blocks[0]); // Simple block tranformation based on the `Block Transforms` API. - - const onBlockTransform = name => replaceBlocks(clientIds, Object(external_wp_blocks_["switchToBlockType"])(blocks, name)); // Pattern transformation through the `Patterns` API. - - - const onPatternTransform = transformedBlocks => replaceBlocks(clientIds, transformedBlocks); - - const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove; - const hasPatternTransformation = !!(patterns !== null && patterns !== void 0 && patterns.length) && canRemove; - - if (!hasBlockStyles && !hasPossibleBlockTransformations) { - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - disabled: true, - className: "block-editor-block-switcher__no-switcher-icon", - title: blockTitle, - icon: Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - icon: icon, - showColors: true - }) - })); - } - - const blockSwitcherLabel = blockTitle; - const blockSwitcherDescription = 1 === blocks.length ? Object(external_wp_i18n_["sprintf"])( - /* translators: %s: block title. */ - Object(external_wp_i18n_["__"])('%s: Change block type or style'), blockTitle) : Object(external_wp_i18n_["sprintf"])( - /* translators: %d: number of blocks. */ - Object(external_wp_i18n_["_n"])('Change type of %d block', 'Change type of %d blocks', blocks.length), blocks.length); - const showDropDown = hasBlockStyles || hasPossibleBlockTransformations || hasPatternTransformation; - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], null, toggleProps => Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { - className: "block-editor-block-switcher", - label: blockSwitcherLabel, - popoverProps: { - position: 'bottom right', - isAlternate: true, - className: 'block-editor-block-switcher__popover' - }, - icon: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - icon: icon, - className: "block-editor-block-switcher__toggle", - showColors: true - }), (isReusable || isTemplate) && Object(external_wp_element_["createElement"])("span", { - className: "block-editor-block-switcher__toggle-text" - }, Object(external_wp_element_["createElement"])(block_title["a" /* default */], { - clientId: clientIds - }))), - toggleProps: { - describedBy: blockSwitcherDescription, - ...toggleProps - }, - menuProps: { - orientation: 'both' - } - }, _ref3 => { - let { - onClose - } = _ref3; - return showDropDown && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-switcher__container" - }, hasPatternTransformation && Object(external_wp_element_["createElement"])(pattern_transformations_menu, { - blocks: blocks, - patterns: patterns, - onSelect: transformedBlocks => { - onPatternTransform(transformedBlocks); - onClose(); - } - }), hasPossibleBlockTransformations && Object(external_wp_element_["createElement"])(block_transformations_menu, { - className: "block-editor-block-switcher__transforms__menugroup", - possibleBlockTransformations: possibleBlockTransformations, - blocks: blocks, - onSelect: name => { - onBlockTransform(name); - onClose(); - } - }), hasBlockStyles && Object(external_wp_element_["createElement"])(BlockStylesMenu, { - hoveredBlock: blocks[0], - onSwitch: onClose - })); - }))); -}; -const BlockSwitcher = _ref4 => { - let { - clientIds - } = _ref4; - const blocks = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).getBlocksByClientId(clientIds), [clientIds]); - - if (!blocks.length || blocks.some(block => !block)) { - return null; - } - - return Object(external_wp_element_["createElement"])(BlockSwitcherDropdownMenu, { - clientIds: clientIds, - blocks: blocks - }); -}; -/* harmony default export */ var block_switcher = (BlockSwitcher); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js + 4 modules -var block_controls = __webpack_require__("fOYa"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/index.js -var block_settings_menu = __webpack_require__("U1WI"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - - - -function BlockToolbar(_ref) { - let { - hideDragHandle - } = _ref; - const { - blockClientIds, - blockClientId, - blockType, - hasFixedToolbar, - hasReducedUI, - isValid, - isVisual - } = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockName, - getBlockMode, - getSelectedBlockClientIds, - isBlockValid, - getBlockRootClientId, - getSettings - } = select(store["a" /* store */]); - const selectedBlockClientIds = getSelectedBlockClientIds(); - const selectedBlockClientId = selectedBlockClientIds[0]; - const blockRootClientId = getBlockRootClientId(selectedBlockClientId); - const settings = getSettings(); - return { - blockClientIds: selectedBlockClientIds, - blockClientId: selectedBlockClientId, - blockType: selectedBlockClientId && Object(external_wp_blocks_["getBlockType"])(getBlockName(selectedBlockClientId)), - hasFixedToolbar: settings.hasFixedToolbar, - hasReducedUI: settings.hasReducedUI, - rootClientId: blockRootClientId, - isValid: selectedBlockClientIds.every(id => isBlockValid(id)), - isVisual: selectedBlockClientIds.every(id => getBlockMode(id) === 'visual') - }; - }, []); // Handles highlighting the current block outline on hover or focus of the - // block type toolbar area. - - const { - toggleBlockHighlight - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const nodeRef = Object(external_wp_element_["useRef"])(); - const { - showMovers, - gestures: showMoversGestures - } = useShowMoversGestures({ - ref: nodeRef, - - onChange(isFocused) { - if (isFocused && hasReducedUI) { - return; - } - - toggleBlockHighlight(blockClientId, isFocused); - } - - }); // Account for the cases where the block toolbar is rendered within the - // header area and not contextually to the block. - - const displayHeaderToolbar = Object(external_wp_compose_["useViewportMatch"])('medium', '<') || hasFixedToolbar; - - if (blockType) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, '__experimentalToolbar', true)) { - return null; - } - } - - const shouldShowMovers = displayHeaderToolbar || showMovers; - - if (blockClientIds.length === 0) { - return null; - } - - const shouldShowVisualToolbar = isValid && isVisual; - const isMultiToolbar = blockClientIds.length > 1; - const classes = classnames_default()('block-editor-block-toolbar', shouldShowMovers && 'is-showing-movers'); - return Object(external_wp_element_["createElement"])("div", { - className: classes - }, !isMultiToolbar && !displayHeaderToolbar && Object(external_wp_element_["createElement"])(BlockParentSelector, { - clientIds: blockClientIds - }), Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ - ref: nodeRef - }, showMoversGestures), (shouldShowVisualToolbar || isMultiToolbar) && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], { - className: "block-editor-block-toolbar__block-controls" - }, Object(external_wp_element_["createElement"])(block_switcher, { - clientIds: blockClientIds - }), Object(external_wp_element_["createElement"])(block_mover["a" /* default */], { - clientIds: blockClientIds, - hideDragHandle: hideDragHandle || hasReducedUI - }))), shouldShowVisualToolbar && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(block_controls["b" /* default */].Slot, { - group: "parent", - className: "block-editor-block-toolbar__slot" - }), Object(external_wp_element_["createElement"])(block_controls["b" /* default */].Slot, { - group: "block", - className: "block-editor-block-toolbar__slot" - }), Object(external_wp_element_["createElement"])(block_controls["b" /* default */].Slot, { - className: "block-editor-block-toolbar__slot" - }), Object(external_wp_element_["createElement"])(block_controls["b" /* default */].Slot, { - group: "inline", - className: "block-editor-block-toolbar__slot" - }), Object(external_wp_element_["createElement"])(block_controls["b" /* default */].Slot, { - group: "other", - className: "block-editor-block-toolbar__slot" - })), Object(external_wp_element_["createElement"])(block_settings_menu["a" /* default */], { - clientIds: blockClientIds - })); -} - - -/***/ }), - -/***/ "//Lo": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const blockDefault = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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 */ __webpack_exports__["a"] = (blockDefault); - - -/***/ }), - -/***/ "/Hvg": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ TextTransformControl; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-uppercase.js - - -/** - * WordPress dependencies - */ - -const formatUppercase = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z" -})); -/* harmony default export */ var format_uppercase = (formatUppercase); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-lowercase.js - - -/** - * WordPress dependencies - */ - -const formatLowercase = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z" -})); -/* harmony default export */ var format_lowercase = (formatLowercase); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-capitalize.js - - -/** - * WordPress dependencies - */ - -const formatCapitalize = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z" -})); -/* harmony default export */ var format_capitalize = (formatCapitalize); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js - - -/** - * WordPress dependencies - */ - - - -const TEXT_TRANSFORMS = [{ - name: Object(external_wp_i18n_["__"])('Uppercase'), - value: 'uppercase', - icon: format_uppercase -}, { - name: Object(external_wp_i18n_["__"])('Lowercase'), - value: 'lowercase', - icon: format_lowercase -}, { - name: Object(external_wp_i18n_["__"])('Capitalize'), - value: 'capitalize', - icon: format_capitalize -}]; -/** - * Control to facilitate text transform selections. - * - * @param {Object} props Component props. - * @param {string} props.value Currently selected text transform. - * @param {Function} props.onChange Handles change in text transform selection. - * - * @return {WPElement} Text transform control. - */ - -function TextTransformControl(_ref) { - let { - value, - onChange - } = _ref; - return Object(external_wp_element_["createElement"])("fieldset", { - className: "block-editor-text-transform-control" - }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_i18n_["__"])('Letter case')), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-text-transform-control__buttons" - }, TEXT_TRANSFORMS.map(textTransform => { - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: textTransform.value, - icon: textTransform.icon, - isSmall: true, - isPressed: value === textTransform.value, - "aria-label": textTransform.name, - onClick: () => onChange(value === textTransform.value ? undefined : textTransform.value) - }); - }))); -} - - -/***/ }), - -/***/ "/QNa": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/constants.js -var constants = __webpack_require__("AHN3"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/with-registry-provider.js - - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -const withRegistryProvider = Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => { - return Object(external_wp_data_["withRegistry"])(_ref => { - let { - useSubRegistry = true, - registry, - ...props - } = _ref; - - if (!useSubRegistry) { - return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({ - registry: registry - }, props)); - } - - const [subRegistry, setSubRegistry] = Object(external_wp_element_["useState"])(null); - Object(external_wp_element_["useEffect"])(() => { - const newRegistry = Object(external_wp_data_["createRegistry"])({}, registry); - newRegistry.registerStore(constants["a" /* STORE_NAME */], store["b" /* storeConfig */]); - setSubRegistry(newRegistry); - }, [registry]); - - if (!subRegistry) { - return null; - } - - return Object(external_wp_element_["createElement"])(external_wp_data_["RegistryProvider"], { - value: subRegistry - }, Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({ - registry: subRegistry - }, props))); - }); -}, 'withRegistryProvider'); -/* harmony default export */ var with_registry_provider = (withRegistryProvider); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/use-block-sync.js -var use_block_sync = __webpack_require__("JGYp"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/block-refs-provider.js -var block_refs_provider = __webpack_require__("cDhi"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */ - -function BlockEditorProvider(props) { - const { - children, - settings - } = props; - const { - updateSettings - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - Object(external_wp_element_["useEffect"])(() => { - updateSettings(settings); - }, [settings]); // Syncs the entity provider with changes in the block-editor store. - - Object(use_block_sync["a" /* default */])(props); - return Object(external_wp_element_["createElement"])(block_refs_provider["b" /* BlockRefsProvider */], null, children); -} - -/* harmony default export */ var provider = __webpack_exports__["a"] = (with_registry_provider(BlockEditorProvider)); - - -/***/ }), - -/***/ "/lNF": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export parseDropEvent */ -/* unused harmony export onBlockDrop */ -/* unused harmony export onFilesDrop */ -/* unused harmony export onHTMLDrop */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useOnBlockDrop; }); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1CF3"); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */ - -/** - * Retrieve the data for a block drop event. - * - * @param {WPSyntheticEvent} event The drop event. - * - * @return {Object} An object with block drag and drop data. - */ - -function parseDropEvent(event) { - let result = { - srcRootClientId: null, - srcClientIds: null, - srcIndex: null, - type: null, - blocks: null - }; - - if (!event.dataTransfer) { - return result; - } - - try { - result = Object.assign(result, JSON.parse(event.dataTransfer.getData('wp-blocks'))); - } catch (err) { - return result; - } - - return result; -} -/** - * A function that returns an event handler function for block drop events. - * - * @param {string} targetRootClientId The root client id where the block(s) will be inserted. - * @param {number} targetBlockIndex The index where the block(s) will be inserted. - * @param {Function} getBlockIndex A function that gets the index of a block. - * @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks. - * @param {Function} moveBlocksToPosition A function that moves blocks. - * @param {Function} insertBlocks A function that inserts blocks. - * @param {Function} clearSelectedBlock A function that clears block selection. - * @return {Function} The event handler for a block drop event. - */ - -function onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocksToPosition, insertBlocks, clearSelectedBlock) { - return event => { - const { - srcRootClientId: sourceRootClientId, - srcClientIds: sourceClientIds, - type: dropType, - blocks - } = parseDropEvent(event); // If the user is inserting a block - - if (dropType === 'inserter') { - clearSelectedBlock(); - const blocksToInsert = blocks.map(block => Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["cloneBlock"])(block)); - insertBlocks(blocksToInsert, targetBlockIndex, targetRootClientId, true, null); - } // If the user is moving a block - - - if (dropType === 'block') { - const sourceBlockIndex = getBlockIndex(sourceClientIds[0]); // If the user is dropping to the same position, return early. - - if (sourceRootClientId === targetRootClientId && sourceBlockIndex === targetBlockIndex) { - return; - } // If the user is attempting to drop a block within its own - // nested blocks, return early as this would create infinite - // recursion. - - - if (sourceClientIds.includes(targetRootClientId) || getClientIdsOfDescendants(sourceClientIds).some(id => id === targetRootClientId)) { - return; - } - - const isAtSameLevel = sourceRootClientId === targetRootClientId; - const draggedBlockCount = sourceClientIds.length; // If the block is kept at the same level and moved downwards, - // subtract to take into account that the blocks being dragged - // were removed from the block list above the insertion point. - - const insertIndex = isAtSameLevel && sourceBlockIndex < targetBlockIndex ? targetBlockIndex - draggedBlockCount : targetBlockIndex; - moveBlocksToPosition(sourceClientIds, sourceRootClientId, targetRootClientId, insertIndex); - } - }; -} -/** - * A function that returns an event handler function for block-related file drop events. - * - * @param {string} targetRootClientId The root client id where the block(s) will be inserted. - * @param {number} targetBlockIndex The index where the block(s) will be inserted. - * @param {boolean} hasUploadPermissions Whether the user has upload permissions. - * @param {Function} updateBlockAttributes A function that updates a block's attributes. - * @param {Function} canInsertBlockType A function that returns checks whether a block type can be inserted. - * @param {Function} insertBlocks A function that inserts blocks. - * - * @return {Function} The event handler for a block-related file drop event. - */ - -function onFilesDrop(targetRootClientId, targetBlockIndex, hasUploadPermissions, updateBlockAttributes, canInsertBlockType, insertBlocks) { - return files => { - if (!hasUploadPermissions) { - return; - } - - const transformation = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["findTransform"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["getBlockTransforms"])('from'), transform => transform.type === 'files' && canInsertBlockType(transform.blockName, targetRootClientId) && transform.isMatch(files)); - - if (transformation) { - const blocks = transformation.transform(files, updateBlockAttributes); - insertBlocks(blocks, targetBlockIndex, targetRootClientId); - } - }; -} -/** - * A function that returns an event handler function for block-related HTML drop events. - * - * @param {string} targetRootClientId The root client id where the block(s) will be inserted. - * @param {number} targetBlockIndex The index where the block(s) will be inserted. - * @param {Function} insertBlocks A function that inserts blocks. - * - * @return {Function} The event handler for a block-related HTML drop event. - */ - -function onHTMLDrop(targetRootClientId, targetBlockIndex, insertBlocks) { - return HTML => { - const blocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["pasteHandler"])({ - HTML, - mode: 'BLOCKS' - }); - - if (blocks.length) { - insertBlocks(blocks, targetBlockIndex, targetRootClientId); - } - }; -} -/** - * A React hook for handling block drop events. - * - * @param {string} targetRootClientId The root client id where the block(s) will be inserted. - * @param {number} targetBlockIndex The index where the block(s) will be inserted. - * - * @return {Object} An object that contains the event handlers `onDrop`, `onFilesDrop` and `onHTMLDrop`. - */ - -function useOnBlockDrop(targetRootClientId, targetBlockIndex) { - const hasUploadPermissions = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => select(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]).getSettings().mediaUpload, []); - const { - canInsertBlockType, - getBlockIndex, - getClientIdsOfDescendants - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); - const { - insertBlocks, - moveBlocksToPosition, - updateBlockAttributes, - clearSelectedBlock - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); - - const _onDrop = onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocksToPosition, insertBlocks, clearSelectedBlock); - - const _onFilesDrop = onFilesDrop(targetRootClientId, targetBlockIndex, hasUploadPermissions, updateBlockAttributes, canInsertBlockType, insertBlocks); - - const _onHTMLDrop = onHTMLDrop(targetRootClientId, targetBlockIndex, insertBlocks); - - return event => { - const files = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__["getFilesFromDataTransfer"])(event.dataTransfer); - const html = event.dataTransfer.getData('text/html'); - - if (files.length) { - _onFilesDrop(files); - } else if (html) { - _onHTMLDrop(html); - } else { - _onDrop(event); - } - }; -} - - -/***/ }), - -/***/ "0E5u": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ JustifyContentControl; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ JustifyToolbar; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-left.js -var justify_left = __webpack_require__("kWXm"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-center.js -var justify_center = __webpack_require__("DmX/"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-right.js -var justify_right = __webpack_require__("suLj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-space-between.js -var justify_space_between = __webpack_require__("bTSr"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/ui.js - - - -/** - * WordPress dependencies - */ - - - -const icons = { - left: justify_left["a" /* default */], - center: justify_center["a" /* default */], - right: justify_right["a" /* default */], - 'space-between': justify_space_between["a" /* default */] -}; - -function JustifyContentUI(_ref) { - let { - allowedControls = ['left', 'center', 'right', 'space-between'], - isCollapsed = true, - onChange, - value, - popoverProps, - isToolbar - } = _ref; - - // If the control is already selected we want a click - // again on the control to deselect the item, so we - // call onChange( undefined ) - const handleClick = next => { - if (next === value) { - onChange(undefined); - } else { - onChange(next); - } - }; - - const icon = value ? icons[value] : icons.left; - const allControls = [{ - name: 'left', - icon: justify_left["a" /* default */], - title: Object(external_wp_i18n_["__"])('Justify items left'), - isActive: 'left' === value, - onClick: () => handleClick('left') - }, { - name: 'center', - icon: justify_center["a" /* default */], - title: Object(external_wp_i18n_["__"])('Justify items center'), - isActive: 'center' === value, - onClick: () => handleClick('center') - }, { - name: 'right', - icon: justify_right["a" /* default */], - title: Object(external_wp_i18n_["__"])('Justify items right'), - isActive: 'right' === value, - onClick: () => handleClick('right') - }, { - name: 'space-between', - icon: justify_space_between["a" /* default */], - title: Object(external_wp_i18n_["__"])('Space between items'), - isActive: 'space-between' === value, - onClick: () => handleClick('space-between') - }]; - const UIComponent = isToolbar ? external_wp_components_["ToolbarGroup"] : external_wp_components_["ToolbarDropdownMenu"]; - const extraProps = isToolbar ? { - isCollapsed - } : {}; - return Object(external_wp_element_["createElement"])(UIComponent, Object(esm_extends["a" /* default */])({ - icon: icon, - popoverProps: popoverProps, - label: Object(external_wp_i18n_["__"])('Change items justification'), - controls: allControls.filter(elem => allowedControls.includes(elem.name)) - }, extraProps)); -} - -/* harmony default export */ var ui = (JustifyContentUI); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/index.js - - - -/** - * Internal dependencies - */ - -function JustifyContentControl(props) { - return Object(external_wp_element_["createElement"])(ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: false - })); -} -function JustifyToolbar(props) { - return Object(external_wp_element_["createElement"])(ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: true - })); -} - - -/***/ }), - -/***/ "0LBR": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMultipleOriginColorsAndGradients; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _use_setting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("v5LD"); -/* harmony import */ var _use_common_single_multiple_selects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("pY5h"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -/** - * Retrieves color and gradient related settings. - * - * The arrays for colors and gradients are made up of color palettes from each - * origin i.e. "Core", "Theme", and "User". - * - * @return {Object} Color and gradient related settings. - */ - -function useMultipleOriginColorsAndGradients() { - const colorGradientSettings = Object(_use_common_single_multiple_selects__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(); - const customColors = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.palette.custom'); - const themeColors = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.palette.theme'); - const defaultColors = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.palette.default'); - const shouldDisplayDefaultColors = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.defaultPalette'); - colorGradientSettings.colors = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => { - const result = []; - - if (themeColors && themeColors.length) { - result.push({ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_x"])('Theme', 'Indicates this palette comes from the theme.'), - colors: themeColors - }); - } - - if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) { - result.push({ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_x"])('Default', 'Indicates this palette comes from WordPress.'), - colors: defaultColors - }); - } - - if (customColors && customColors.length) { - result.push({ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_x"])('Custom', 'Indicates this palette comes from the theme.'), - colors: customColors - }); - } - - return result; - }, [defaultColors, themeColors, customColors]); - const customGradients = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.gradients.custom'); - const themeGradients = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.gradients.theme'); - const defaultGradients = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.gradients.default'); - const shouldDisplayDefaultGradients = Object(_use_setting__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])('color.defaultGradients'); - colorGradientSettings.gradients = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => { - const result = []; - - if (themeGradients && themeGradients.length) { - result.push({ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_x"])('Theme', 'Indicates this palette comes from the theme.'), - gradients: themeGradients - }); - } - - if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) { - result.push({ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_x"])('Default', 'Indicates this palette comes from WordPress.'), - gradients: defaultGradients - }); - } - - if (customGradients && customGradients.length) { - result.push({ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_x"])('Custom', 'Indicates this palette is created by the user.'), - gradients: customGradients - }); - } - - return result; - }, [customGradients, themeGradients, defaultGradients]); - return colorGradientSettings; -} - - -/***/ }), - -/***/ "14PQ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "ic", function() { return /* reexport */ components_colors["b" /* getColorClassName */]; }); -__webpack_require__.d(__webpack_exports__, "jc", function() { return /* reexport */ components_colors["c" /* getColorObjectByAttributeValues */]; }); -__webpack_require__.d(__webpack_exports__, "kc", function() { return /* reexport */ components_colors["d" /* getColorObjectByColorValue */]; }); -__webpack_require__.d(__webpack_exports__, "hc", function() { return /* reexport */ components_colors["a" /* createCustomColorsHOC */]; }); -__webpack_require__.d(__webpack_exports__, "wc", function() { return /* reexport */ components_colors["e" /* withColors */]; }); -__webpack_require__.d(__webpack_exports__, "yb", function() { return /* reexport */ gradients["a" /* __experimentalGetGradientClass */]; }); -__webpack_require__.d(__webpack_exports__, "pc", function() { return /* reexport */ gradients["e" /* getGradientValueBySlug */]; }); -__webpack_require__.d(__webpack_exports__, "zb", function() { return /* reexport */ gradients["b" /* __experimentalGetGradientObjectByGradientValue */]; }); -__webpack_require__.d(__webpack_exports__, "oc", function() { return /* reexport */ gradients["d" /* getGradientSlugByValue */]; }); -__webpack_require__.d(__webpack_exports__, "Tb", function() { return /* reexport */ gradients["c" /* __experimentalUseGradient */]; }); -__webpack_require__.d(__webpack_exports__, "lc", function() { return /* reexport */ font_sizes["b" /* getFontSize */]; }); -__webpack_require__.d(__webpack_exports__, "mc", function() { return /* reexport */ font_sizes["c" /* getFontSizeClass */]; }); -__webpack_require__.d(__webpack_exports__, "nc", function() { return /* reexport */ font_sizes["d" /* getFontSizeObjectByValue */]; }); -__webpack_require__.d(__webpack_exports__, "I", function() { return /* reexport */ font_sizes["a" /* FontSizePicker */]; }); -__webpack_require__.d(__webpack_exports__, "xc", function() { return /* reexport */ font_sizes["e" /* withFontSizes */]; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ AlignmentControl; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ AlignmentToolbar; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ autocomplete; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ block_alignment_control["a" /* BlockAlignmentControl */]; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ block_alignment_control["b" /* BlockAlignmentToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "nb", function() { return /* reexport */ block_full_height_alignment_control; }); -__webpack_require__.d(__webpack_exports__, "lb", function() { return /* reexport */ block_alignment_matrix_control; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ block_breadcrumb; }); -__webpack_require__.d(__webpack_exports__, "mb", function() { return /* reexport */ BlockContentOverlay; }); -__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ block_context["a" /* BlockContextProvider */]; }); -__webpack_require__.d(__webpack_exports__, "i", function() { return /* reexport */ block_controls["b" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "m", function() { return /* reexport */ block_controls["a" /* BlockFormatControls */]; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ color_style_selector; }); -__webpack_require__.d(__webpack_exports__, "j", function() { return /* reexport */ block_edit["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "rc", function() { return /* reexport */ context["c" /* useBlockEditContext */]; }); -__webpack_require__.d(__webpack_exports__, "n", function() { return /* reexport */ block_icon["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "r", function() { return /* reexport */ dropdown; }); -__webpack_require__.d(__webpack_exports__, "pb", function() { return /* reexport */ block_variation_picker; }); -__webpack_require__.d(__webpack_exports__, "ob", function() { return /* reexport */ block_pattern_setup; }); -__webpack_require__.d(__webpack_exports__, "qb", function() { return /* reexport */ components_block_variation_transforms; }); -__webpack_require__.d(__webpack_exports__, "A", function() { return /* reexport */ BlockVerticalAlignmentToolbar; }); -__webpack_require__.d(__webpack_exports__, "z", function() { return /* reexport */ BlockVerticalAlignmentControl; }); -__webpack_require__.d(__webpack_exports__, "rb", function() { return /* reexport */ border_radius_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "sb", function() { return /* reexport */ border_style_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "C", function() { return /* reexport */ button_block_appender["a" /* ButtonBlockerAppender */]; }); -__webpack_require__.d(__webpack_exports__, "B", function() { return /* reexport */ button_block_appender["b" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "D", function() { return /* reexport */ color_palette; }); -__webpack_require__.d(__webpack_exports__, "E", function() { return /* reexport */ ColorPaletteControl; }); -__webpack_require__.d(__webpack_exports__, "F", function() { return /* reexport */ contrast_checker["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "vb", function() { return /* reexport */ duotone_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "wb", function() { return /* reexport */ font_appearance_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "xb", function() { return /* reexport */ font_family["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Fb", function() { return /* reexport */ letter_spacing_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Pb", function() { return /* reexport */ text_decoration_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Qb", function() { return /* reexport */ text_transform_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "tb", function() { return /* reexport */ control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "ub", function() { return /* reexport */ colors_gradients_dropdown["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Mb", function() { return /* reexport */ panel_color_gradient_settings["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Bb", function() { return /* reexport */ ImageEditor; }); -__webpack_require__.d(__webpack_exports__, "Ab", function() { return /* reexport */ ImageEditingProvider; }); -__webpack_require__.d(__webpack_exports__, "Cb", function() { return /* reexport */ ImageSizeControl; }); -__webpack_require__.d(__webpack_exports__, "J", function() { return /* reexport */ inner_blocks["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "tc", function() { return /* reexport */ inner_blocks["b" /* useInnerBlocksProps */]; }); -__webpack_require__.d(__webpack_exports__, "M", function() { return /* reexport */ inspector_controls["b" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "L", function() { return /* reexport */ inspector_controls["a" /* InspectorAdvancedControls */]; }); -__webpack_require__.d(__webpack_exports__, "O", function() { return /* reexport */ justify_content_control["b" /* JustifyToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "N", function() { return /* reexport */ justify_content_control["a" /* JustifyContentControl */]; }); -__webpack_require__.d(__webpack_exports__, "Hb", function() { return /* reexport */ link_control; }); -__webpack_require__.d(__webpack_exports__, "Ib", function() { return /* reexport */ search_input; }); -__webpack_require__.d(__webpack_exports__, "Kb", function() { return /* reexport */ LinkControlSearchResults; }); -__webpack_require__.d(__webpack_exports__, "Jb", function() { return /* reexport */ search_item; }); -__webpack_require__.d(__webpack_exports__, "P", function() { return /* reexport */ line_height_control["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Lb", function() { return /* reexport */ components_list_view; }); -__webpack_require__.d(__webpack_exports__, "R", function() { return /* reexport */ media_replace_flow; }); -__webpack_require__.d(__webpack_exports__, "Q", function() { return /* reexport */ media_placeholder; }); -__webpack_require__.d(__webpack_exports__, "S", function() { return /* reexport */ media_upload; }); -__webpack_require__.d(__webpack_exports__, "T", function() { return /* reexport */ media_upload_check; }); -__webpack_require__.d(__webpack_exports__, "X", function() { return /* reexport */ panel_color_settings; }); -__webpack_require__.d(__webpack_exports__, "Y", function() { return /* reexport */ plain_text; }); -__webpack_require__.d(__webpack_exports__, "Ob", function() { return /* reexport */ responsive_block_control; }); -__webpack_require__.d(__webpack_exports__, "ab", function() { return /* reexport */ rich_text; }); -__webpack_require__.d(__webpack_exports__, "bb", function() { return /* reexport */ RichTextShortcut; }); -__webpack_require__.d(__webpack_exports__, "cb", function() { return /* reexport */ RichTextToolbarButton; }); -__webpack_require__.d(__webpack_exports__, "ac", function() { return /* reexport */ __unstableRichTextInputEvent; }); -__webpack_require__.d(__webpack_exports__, "eb", function() { return /* reexport */ tool_selector; }); -__webpack_require__.d(__webpack_exports__, "Rb", function() { return /* reexport */ UnitControl; }); -__webpack_require__.d(__webpack_exports__, "gb", function() { return /* reexport */ url_input; }); -__webpack_require__.d(__webpack_exports__, "hb", function() { return /* reexport */ url_input_button; }); -__webpack_require__.d(__webpack_exports__, "ib", function() { return /* reexport */ url_popover; }); -__webpack_require__.d(__webpack_exports__, "Db", function() { return /* reexport */ ImageURLInputUI; }); -__webpack_require__.d(__webpack_exports__, "vc", function() { return /* reexport */ with_color_context; }); -__webpack_require__.d(__webpack_exports__, "Wb", function() { return /* reexport */ block_settings_menu_first_item["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Zb", function() { return /* reexport */ inserter_menu_extension["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Nb", function() { return /* reexport */ PreviewOptions; }); -__webpack_require__.d(__webpack_exports__, "Vb", function() { return /* reexport */ useResizeCanvas; }); -__webpack_require__.d(__webpack_exports__, "o", function() { return /* reexport */ block_inspector; }); -__webpack_require__.d(__webpack_exports__, "p", function() { return /* reexport */ block_list["c" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "sc", function() { return /* reexport */ use_block_props["a" /* useBlockProps */]; }); -__webpack_require__.d(__webpack_exports__, "Eb", function() { return /* reexport */ block_list_layout["b" /* LayoutStyle */]; }); -__webpack_require__.d(__webpack_exports__, "q", function() { return /* reexport */ block_mover["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "s", function() { return /* reexport */ block_preview["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Sb", function() { return /* reexport */ block_preview["b" /* useBlockPreview */]; }); -__webpack_require__.d(__webpack_exports__, "t", function() { return /* reexport */ block_selection_clearer["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "bc", function() { return /* reexport */ block_selection_clearer["b" /* useBlockSelectionClearer */]; }); -__webpack_require__.d(__webpack_exports__, "u", function() { return /* reexport */ block_settings_menu["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "v", function() { return /* reexport */ block_settings_menu_controls["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "w", function() { return /* reexport */ block_title["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "x", function() { return /* reexport */ block_toolbar["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "y", function() { return /* reexport */ BlockTools; }); -__webpack_require__.d(__webpack_exports__, "G", function() { return /* reexport */ copy_handler["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "dc", function() { return /* reexport */ copy_handler["b" /* useClipboardHandler */]; }); -__webpack_require__.d(__webpack_exports__, "H", function() { return /* reexport */ default_block_appender["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Xb", function() { return /* reexport */ editor_styles["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "K", function() { return /* reexport */ inserter["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Gb", function() { return /* reexport */ library; }); -__webpack_require__.d(__webpack_exports__, "k", function() { return /* reexport */ keyboard_shortcuts; }); -__webpack_require__.d(__webpack_exports__, "U", function() { return /* reexport */ MultiSelectScrollIntoView; }); -__webpack_require__.d(__webpack_exports__, "V", function() { return /* reexport */ navigable_toolbar["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "W", function() { return /* reexport */ observe_typing; }); -__webpack_require__.d(__webpack_exports__, "gc", function() { return /* reexport */ useTypingObserver; }); -__webpack_require__.d(__webpack_exports__, "ec", function() { return /* reexport */ useMouseMoveTypingReset; }); -__webpack_require__.d(__webpack_exports__, "Z", function() { return /* reexport */ PreserveScrollInReorder; }); -__webpack_require__.d(__webpack_exports__, "db", function() { return /* reexport */ skip_to_selected_block; }); -__webpack_require__.d(__webpack_exports__, "fb", function() { return /* reexport */ typewriter; }); -__webpack_require__.d(__webpack_exports__, "fc", function() { return /* reexport */ useTypewriter; }); -__webpack_require__.d(__webpack_exports__, "jb", function() { return /* reexport */ warning["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "kb", function() { return /* reexport */ writing_flow["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "cc", function() { return /* reexport */ useCanvasClickRedirect; }); -__webpack_require__.d(__webpack_exports__, "qc", function() { return /* reexport */ use_block_display_information["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Yb", function() { return /* reexport */ iframe["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "Ub", function() { return /* reexport */ useNoRecursiveRenders; }); -__webpack_require__.d(__webpack_exports__, "l", function() { return /* reexport */ provider["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "uc", function() { return /* reexport */ use_setting["a" /* default */]; }); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/index.js + 1 modules -var components_colors = __webpack_require__("5gPN"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/gradients/index.js -var gradients = __webpack_require__("zmSX"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js + 1 modules -var font_sizes = __webpack_require__("9XVa"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js -var align_left = __webpack_require__("fPbg"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js -var align_center = __webpack_require__("plpT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js -var align_right = __webpack_require__("ziDm"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/ui.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -const DEFAULT_ALIGNMENT_CONTROLS = [{ - icon: align_left["a" /* default */], - title: Object(external_wp_i18n_["__"])('Align text left'), - align: 'left' -}, { - icon: align_center["a" /* default */], - title: Object(external_wp_i18n_["__"])('Align text center'), - align: 'center' -}, { - icon: align_right["a" /* default */], - title: Object(external_wp_i18n_["__"])('Align text right'), - align: 'right' -}]; -const ui_POPOVER_PROPS = { - position: 'bottom right', - isAlternate: true -}; - -function AlignmentUI(_ref) { - let { - value, - onChange, - alignmentControls = DEFAULT_ALIGNMENT_CONTROLS, - label = Object(external_wp_i18n_["__"])('Align'), - describedBy = Object(external_wp_i18n_["__"])('Change text alignment'), - isCollapsed = true, - isToolbar - } = _ref; - - function applyOrUnset(align) { - return () => onChange(value === align ? undefined : align); - } - - const activeAlignment = Object(external_lodash_["find"])(alignmentControls, control => control.align === value); - - function setIcon() { - if (activeAlignment) return activeAlignment.icon; - return Object(external_wp_i18n_["isRTL"])() ? align_right["a" /* default */] : align_left["a" /* default */]; - } - - const UIComponent = isToolbar ? external_wp_components_["ToolbarGroup"] : external_wp_components_["ToolbarDropdownMenu"]; - const extraProps = isToolbar ? { - isCollapsed - } : {}; - return Object(external_wp_element_["createElement"])(UIComponent, Object(esm_extends["a" /* default */])({ - icon: setIcon(), - label: label, - toggleProps: { - describedBy - }, - popoverProps: ui_POPOVER_PROPS, - controls: alignmentControls.map(control => { - const { - align - } = control; - const isActive = value === align; - return { ...control, - isActive, - role: isCollapsed ? 'menuitemradio' : undefined, - onClick: applyOrUnset(align) - }; - }) - }, extraProps)); -} - -/* harmony default export */ var ui = (AlignmentUI); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/index.js - - - -/** - * Internal dependencies - */ - -function AlignmentControl(props) { - return Object(external_wp_element_["createElement"])(ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: false - })); -} -function AlignmentToolbar(props) { - return Object(external_wp_element_["createElement"])(ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: true - })); -} - -// EXTERNAL MODULE: external ["wp","hooks"] -var external_wp_hooks_ = __webpack_require__("g56x"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js -var context = __webpack_require__("ur0x"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js -var search_items = __webpack_require__("pOGT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-block-types-state.js -var use_block_types_state = __webpack_require__("+G0a"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js -var block_icon = __webpack_require__("7SSY"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/autocompleters/block.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - -const SHOWN_BLOCK_TYPES = 9; -/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */ - -/** - * Creates a blocks repeater for replacing the current block with a selected block type. - * - * @return {WPCompleter} A blocks completer. - */ - -function createBlockCompleter() { - return { - name: 'blocks', - className: 'block-editor-autocompleters__block', - triggerPrefix: '/', - - useItems(filterValue) { - const { - rootClientId, - selectedBlockName - } = Object(external_wp_data_["useSelect"])(select => { - const { - getSelectedBlockClientId, - getBlockName, - getBlockInsertionPoint - } = select(store["a" /* store */]); - const selectedBlockClientId = getSelectedBlockClientId(); - return { - selectedBlockName: selectedBlockClientId ? getBlockName(selectedBlockClientId) : null, - rootClientId: getBlockInsertionPoint().rootClientId - }; - }, []); - const [items, categories, collections] = Object(use_block_types_state["a" /* default */])(rootClientId, external_lodash_["noop"]); - const filteredItems = Object(external_wp_element_["useMemo"])(() => { - const initialFilteredItems = !!filterValue.trim() ? Object(search_items["a" /* searchBlockItems */])(items, categories, collections, filterValue) : Object(external_lodash_["orderBy"])(items, ['frecency'], ['desc']); - return initialFilteredItems.filter(item => item.name !== selectedBlockName).slice(0, SHOWN_BLOCK_TYPES); - }, [filterValue, selectedBlockName, items, categories, collections]); - const options = Object(external_wp_element_["useMemo"])(() => filteredItems.map(blockItem => { - const { - title, - icon, - isDisabled - } = blockItem; - return { - key: `block-${blockItem.id}`, - value: blockItem, - label: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - key: "icon", - icon: icon, - showColors: true - }), title), - isDisabled - }; - }), [filteredItems]); - return [options]; - }, - - allowContext(before, after) { - return !(/\S/.test(before) || /\S/.test(after)); - }, - - getOptionCompletion(inserterItem) { - const { - name, - initialAttributes, - innerBlocks - } = inserterItem; - return { - action: 'replace', - value: Object(external_wp_blocks_["createBlock"])(name, initialAttributes, Object(external_wp_blocks_["createBlocksFromInnerBlocksTemplate"])(innerBlocks)) - }; - } - - }; -} -/** - * Creates a blocks repeater for replacing the current block with a selected block type. - * - * @return {WPCompleter} A blocks completer. - */ - - -/* harmony default export */ var autocompleters_block = (createBlockCompleter()); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/autocomplete/index.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -/** - * Shared reference to an empty array for cases where it is important to avoid - * returning a new array reference on every invocation. - * - * @type {Array} - */ - -const EMPTY_ARRAY = []; - -function useCompleters(_ref) { - let { - completers = EMPTY_ARRAY - } = _ref; - const { - name - } = Object(context["c" /* useBlockEditContext */])(); - return Object(external_wp_element_["useMemo"])(() => { - let filteredCompleters = completers; - - if (name === Object(external_wp_blocks_["getDefaultBlockName"])() || Object(external_wp_blocks_["getBlockSupport"])(name, '__experimentalSlashInserter', false)) { - filteredCompleters = filteredCompleters.concat([autocompleters_block]); - } - - if (Object(external_wp_hooks_["hasFilter"])('editor.Autocomplete.completers')) { - // Provide copies so filters may directly modify them. - if (filteredCompleters === completers) { - filteredCompleters = filteredCompleters.map(external_lodash_["clone"]); - } - - filteredCompleters = Object(external_wp_hooks_["applyFilters"])('editor.Autocomplete.completers', filteredCompleters, name); - } - - return filteredCompleters; - }, [completers, name]); -} - -function useBlockEditorAutocompleteProps(props) { - return Object(external_wp_components_["__unstableUseAutocompleteProps"])({ ...props, - completers: useCompleters(props) - }); -} -/** - * Wrap the default Autocomplete component with one that supports a filter hook - * for customizing its list of autocompleters. - * - * @type {import('react').FC} - */ - -function BlockEditorAutocomplete(props) { - return Object(external_wp_element_["createElement"])(external_wp_components_["Autocomplete"], Object(esm_extends["a" /* default */])({}, props, { - completers: useCompleters(props) - })); -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/autocomplete/README.md - */ - - -/* harmony default export */ var autocomplete = (BlockEditorAutocomplete); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js + 4 modules -var block_alignment_control = __webpack_require__("vtO0"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/fullscreen.js - - -/** - * WordPress dependencies - */ - -const fullscreen = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z" -})); -/* harmony default export */ var library_fullscreen = (fullscreen); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-full-height-alignment-control/index.js - - -/** - * WordPress dependencies - */ - - - - -function BlockFullHeightAlignmentControl(_ref) { - let { - isActive, - label = Object(external_wp_i18n_["__"])('Toggle full height'), - onToggle, - isDisabled - } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - isActive: isActive, - icon: library_fullscreen, - label: label, - onClick: () => onToggle(!isActive), - disabled: isDisabled - }); -} - -/* harmony default export */ var block_full_height_alignment_control = (BlockFullHeightAlignmentControl); - -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-matrix-control/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -function BlockAlignmentMatrixControl(props) { - const { - label = Object(external_wp_i18n_["__"])('Change matrix alignment'), - onChange = external_lodash_["noop"], - value = 'center', - isDisabled - } = props; - const icon = Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalAlignmentMatrixControl"].Icon, { - value: value - }); - const className = 'block-editor-block-alignment-matrix-control'; - const popoverClassName = `${className}__popover`; - const isAlternate = true; - return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { - position: "bottom right", - className: className, - popoverProps: { - className: popoverClassName, - isAlternate - }, - renderToggle: _ref => { - let { - onToggle, - isOpen - } = _ref; - - const openOnArrowDown = event => { - if (!isOpen && event.keyCode === external_wp_keycodes_["DOWN"]) { - event.preventDefault(); - onToggle(); - } - }; - - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - onClick: onToggle, - "aria-haspopup": "true", - "aria-expanded": isOpen, - onKeyDown: openOnArrowDown, - label: label, - icon: icon, - showTooltip: true, - disabled: isDisabled - }); - }, - renderContent: () => Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalAlignmentMatrixControl"], { - hasFocusBorder: false, - onChange: onChange, - value: value - }) - }); -} - -/* harmony default export */ var block_alignment_matrix_control = (BlockAlignmentMatrixControl); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js -var build_module_icon = __webpack_require__("iClF"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js - - -/** - * WordPress dependencies - */ - -const chevronRightSmall = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["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 */ var chevron_right_small = (chevronRightSmall); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js -var block_title = __webpack_require__("f8JO"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-breadcrumb/index.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - -/** - * Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb. - * - * @param {Object} props Component props. - * @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail. - * @return {WPElement} Block Breadcrumb. - */ - -function BlockBreadcrumb(_ref) { - let { - rootLabelText - } = _ref; - const { - selectBlock, - clearSelectedBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const { - clientId, - parents, - hasSelection - } = Object(external_wp_data_["useSelect"])(select => { - const { - getSelectionStart, - getSelectedBlockClientId, - getBlockParents - } = select(store["a" /* store */]); - const selectedBlockClientId = getSelectedBlockClientId(); - return { - parents: getBlockParents(selectedBlockClientId), - clientId: selectedBlockClientId, - hasSelection: !!getSelectionStart().clientId - }; - }, []); - - const rootLabel = rootLabelText || Object(external_wp_i18n_["__"])('Document'); - /* - * Disable reason: The `list` ARIA role is redundant but - * Safari+VoiceOver won't announce the list otherwise. - */ - - /* eslint-disable jsx-a11y/no-redundant-roles */ - - - return Object(external_wp_element_["createElement"])("ul", { - className: "block-editor-block-breadcrumb", - role: "list", - "aria-label": Object(external_wp_i18n_["__"])('Block breadcrumb') - }, Object(external_wp_element_["createElement"])("li", { - className: !hasSelection ? 'block-editor-block-breadcrumb__current' : undefined, - "aria-current": !hasSelection ? 'true' : undefined - }, hasSelection && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-block-breadcrumb__button", - variant: "tertiary", - onClick: clearSelectedBlock - }, rootLabel), !hasSelection && rootLabel, !!clientId && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: chevron_right_small, - className: "block-editor-block-breadcrumb__separator" - })), parents.map(parentClientId => Object(external_wp_element_["createElement"])("li", { - key: parentClientId - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-block-breadcrumb__button", - variant: "tertiary", - onClick: () => selectBlock(parentClientId) - }, Object(external_wp_element_["createElement"])(block_title["a" /* default */], { - clientId: parentClientId - })), Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: chevron_right_small, - className: "block-editor-block-breadcrumb__separator" - }))), !!clientId && Object(external_wp_element_["createElement"])("li", { - className: "block-editor-block-breadcrumb__current", - "aria-current": "true" - }, Object(external_wp_element_["createElement"])(block_title["a" /* default */], { - clientId: clientId - }))) - /* eslint-enable jsx-a11y/no-redundant-roles */ - ; -} - -/* harmony default export */ var block_breadcrumb = (BlockBreadcrumb); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-content-overlay/index.js - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * External dependencies - */ - - -function BlockContentOverlay(_ref) { - let { - clientId, - tagName: TagName = 'div', - wrapperProps, - className - } = _ref; - const baseClassName = 'block-editor-block-content-overlay'; - const [isOverlayActive, setIsOverlayActive] = Object(external_wp_element_["useState"])(true); - const [isHovered, setIsHovered] = Object(external_wp_element_["useState"])(false); - const { - isParentSelected, - hasChildSelected, - isDraggingBlocks, - isParentHighlighted - } = Object(external_wp_data_["useSelect"])(select => { - const { - isBlockSelected, - hasSelectedInnerBlock, - isDraggingBlocks: _isDraggingBlocks, - isBlockHighlighted - } = select(store["a" /* store */]); - return { - isParentSelected: isBlockSelected(clientId), - hasChildSelected: hasSelectedInnerBlock(clientId, true), - isDraggingBlocks: _isDraggingBlocks(), - isParentHighlighted: isBlockHighlighted(clientId) - }; - }, [clientId]); - const classes = classnames_default()(baseClassName, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className, className, { - 'overlay-active': isOverlayActive, - 'parent-highlighted': isParentHighlighted, - 'is-dragging-blocks': isDraggingBlocks - }); - Object(external_wp_element_["useEffect"])(() => { - // Reenable when blocks are not in use. - if (!isParentSelected && !hasChildSelected && !isOverlayActive) { - setIsOverlayActive(true); - } // Disable if parent selected by another means (such as list view). - // We check hover to ensure the overlay click interaction is not taking place. - // Trying to click the overlay will select the parent block via its 'focusin' - // listener on the wrapper, so if the block is selected while hovered we will - // let the mouseup disable the overlay instead. - - - if (isParentSelected && !isHovered && isOverlayActive) { - setIsOverlayActive(false); - } // Ensure overlay is disabled if a child block is selected. - - - if (hasChildSelected && isOverlayActive) { - setIsOverlayActive(false); - } - }, [isParentSelected, hasChildSelected, isOverlayActive, isHovered]); // Disabled because the overlay div doesn't actually have a role or functionality - // as far as the a11y is concerned. We're just catching the first click so that - // the block can be selected without interacting with its contents. - - /* eslint-disable jsx-a11y/no-static-element-interactions */ - - return Object(external_wp_element_["createElement"])(TagName, Object(esm_extends["a" /* default */])({}, wrapperProps, { - className: classes, - onMouseEnter: () => setIsHovered(true), - onMouseLeave: () => setIsHovered(false), - onMouseUp: isOverlayActive ? () => setIsOverlayActive(false) : undefined - }), wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.children); -} -/* eslint-enable jsx-a11y/no-static-element-interactions */ - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-context/index.js -var block_context = __webpack_require__("uoCR"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js + 4 modules -var block_controls = __webpack_require__("fOYa"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-style-selector/index.js - - -/** - * WordPress dependencies - */ - - - - -const ColorSelectorSVGIcon = () => Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - xmlns: "https://www.w3.org/2000/svg", - viewBox: "0 0 20 20" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z" -})); -/** - * Color Selector Icon component. - * - * @param {Object} props Component properties. - * @param {Object} props.style Style object. - * @param {string} props.className Class name for component. - * - * @return {*} React Icon component. - */ - - -const ColorSelectorIcon = _ref => { - let { - style, - className - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - className: "block-library-colors-selector__icon-container" - }, Object(external_wp_element_["createElement"])("div", { - className: `${className} block-library-colors-selector__state-selection`, - style: style - }, Object(external_wp_element_["createElement"])(ColorSelectorSVGIcon, null))); -}; -/** - * Renders the Colors Selector Toolbar with the icon button. - * - * @param {Object} props Component properties. - * @param {Object} props.TextColor Text color component that wraps icon. - * @param {Object} props.BackgroundColor Background color component that wraps icon. - * - * @return {*} React toggle button component. - */ - - -const renderToggleComponent = _ref2 => { - let { - TextColor, - BackgroundColor - } = _ref2; - return _ref3 => { - let { - onToggle, - isOpen - } = _ref3; - - const openOnArrowDown = event => { - if (!isOpen && event.keyCode === external_wp_keycodes_["DOWN"]) { - event.preventDefault(); - onToggle(); - } - }; - - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - className: "components-toolbar__control block-library-colors-selector__toggle", - label: Object(external_wp_i18n_["__"])('Open Colors Selector'), - onClick: onToggle, - onKeyDown: openOnArrowDown, - icon: Object(external_wp_element_["createElement"])(BackgroundColor, null, Object(external_wp_element_["createElement"])(TextColor, null, Object(external_wp_element_["createElement"])(ColorSelectorIcon, null))) - })); - }; -}; - -const BlockColorsStyleSelector = _ref4 => { - let { - children, - ...other - } = _ref4; - return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { - position: "bottom right", - className: "block-library-colors-selector", - contentClassName: "block-library-colors-selector__popover", - renderToggle: renderToggleComponent(other), - renderContent: () => children - }); -}; - -/* harmony default export */ var color_style_selector = (BlockColorsStyleSelector); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js + 1 modules -var block_edit = __webpack_require__("JRTi"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js -var list_view = __webpack_require__("OzlF"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js -var more_vertical = __webpack_require__("VKE3"); - -// EXTERNAL MODULE: ./node_modules/@react-spring/web/dist/react-spring-web.esm.js -var react_spring_web_esm = __webpack_require__("+DUQ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-moving-animation/index.js -var use_moving_animation = __webpack_require__("Xkls"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/leaf.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -const AnimatedTreeGridRow = Object(react_spring_web_esm["animated"])(external_wp_components_["__experimentalTreeGridRow"]); -function ListViewLeaf(_ref) { - let { - isSelected, - position, - level, - rowCount, - children, - className, - path, - ...props - } = _ref; - const ref = Object(use_moving_animation["a" /* default */])({ - isSelected, - adjustScrolling: false, - enableAnimation: true, - triggerAnimationOnChange: path - }); - return Object(external_wp_element_["createElement"])(AnimatedTreeGridRow, Object(esm_extends["a" /* default */])({ - ref: ref, - className: classnames_default()('block-editor-list-view-leaf', className), - level: level, - positionInSet: position, - setSize: rowCount - }, props), children); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/button.js + 1 modules -var block_mover_button = __webpack_require__("9Ma0"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-display-information/index.js -var use_block_display_information = __webpack_require__("wC17"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/utils.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -const getBlockPositionDescription = (position, siblingCount, level) => Object(external_wp_i18n_["sprintf"])( -/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */ -Object(external_wp_i18n_["__"])('Block %1$d of %2$d, Level %3$d'), position, siblingCount, level); -/** - * Returns true if the client ID occurs within the block selection or multi-selection, - * or false otherwise. - * - * @param {string} clientId Block client ID. - * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs. - * - * @return {boolean} Whether the block is in multi-selection set. - */ - -const isClientIdSelected = (clientId, selectedBlockClientIds) => Object(external_lodash_["isArray"])(selectedBlockClientIds) && selectedBlockClientIds.length ? selectedBlockClientIds.indexOf(clientId) !== -1 : selectedBlockClientIds === clientId; - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/expander.js - - -/** - * WordPress dependencies - */ - -function ListViewExpander(_ref) { - let { - onClick - } = _ref; - return (// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js - // - // The expander component is implemented as a pseudo element in the w3 example - // https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html - // - // We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree. - // For the current tree grid implementation, please do not try to make this a button. - // - // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions - Object(external_wp_element_["createElement"])("span", { - className: "block-editor-list-view__expander", - onClick: event => onClick(event, { - forceToggle: true - }), - "aria-hidden": "true" - }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: chevron_right_small - })) - ); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-select-button.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - - -function ListViewBlockSelectButton(_ref, ref) { - let { - className, - block: { - clientId - }, - isSelected, - onClick, - onToggleExpanded, - position, - siblingBlockCount, - level, - tabIndex, - onFocus, - onDragStart, - onDragEnd, - draggable - } = _ref; - const blockInformation = Object(use_block_display_information["a" /* default */])(clientId); - const instanceId = Object(external_wp_compose_["useInstanceId"])(ListViewBlockSelectButton); - const descriptionId = `list-view-block-select-button__${instanceId}`; - const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: classnames_default()('block-editor-list-view-block-select-button', className), - onClick: onClick, - "aria-describedby": descriptionId, - ref: ref, - tabIndex: tabIndex, - onFocus: onFocus, - onDragStart: onDragStart, - onDragEnd: onDragEnd, - draggable: draggable - }, Object(external_wp_element_["createElement"])(ListViewExpander, { - onClick: onToggleExpanded - }), Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon, - showColors: true - }), Object(external_wp_element_["createElement"])(block_title["a" /* default */], { - clientId: clientId - }), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && Object(external_wp_element_["createElement"])("span", { - className: "block-editor-list-view-block-select-button__anchor" - }, blockInformation.anchor), isSelected && Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], null, Object(external_wp_i18n_["__"])('(selected block)'))), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-list-view-block-select-button__description", - id: descriptionId - }, blockPositionDescription)); -} - -/* harmony default export */ var block_select_button = (Object(external_wp_element_["forwardRef"])(ListViewBlockSelectButton)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js + 1 modules -var block_draggable = __webpack_require__("ZAjO"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-contents.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -const ListViewBlockContents = Object(external_wp_element_["forwardRef"])((_ref, ref) => { - let { - onClick, - onToggleExpanded, - block, - isSelected, - position, - siblingBlockCount, - level, - ...props - } = _ref; - const { - clientId - } = block; - const { - blockMovingClientId, - selectedBlockInBlockEditor - } = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockRootClientId, - hasBlockMovingClientId, - getSelectedBlockClientId - } = select(store["a" /* store */]); - return { - rootClientId: getBlockRootClientId(clientId) || '', - blockMovingClientId: hasBlockMovingClientId(), - selectedBlockInBlockEditor: getSelectedBlockClientId() - }; - }, [clientId]); - const isBlockMoveTarget = blockMovingClientId && selectedBlockInBlockEditor === clientId; - const className = classnames_default()('block-editor-list-view-block-contents', { - 'is-dropping-before': isBlockMoveTarget - }); - return Object(external_wp_element_["createElement"])(block_draggable["a" /* default */], { - clientIds: [block.clientId] - }, _ref2 => { - let { - draggable, - onDragStart, - onDragEnd - } = _ref2; - return Object(external_wp_element_["createElement"])(block_select_button, Object(esm_extends["a" /* default */])({ - ref: ref, - className: className, - block: block, - onClick: onClick, - onToggleExpanded: onToggleExpanded, - isSelected: isSelected, - position: position, - siblingBlockCount: siblingBlockCount, - level: level, - draggable: draggable, - onDragStart: onDragStart, - onDragEnd: onDragEnd - }, props)); - }); -}); -/* harmony default export */ var block_contents = (ListViewBlockContents); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-dropdown.js + 4 modules -var block_settings_dropdown = __webpack_require__("1eGn"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/context.js -/** - * WordPress dependencies - */ - -const ListViewContext = Object(external_wp_element_["createContext"])({ - __experimentalFeatures: false, - __experimentalPersistentListViewFeatures: false -}); -const useListViewContext = () => Object(external_wp_element_["useContext"])(ListViewContext); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - - - -function ListViewBlock(_ref) { - let { - block, - isDragged, - isSelected, - isBranchSelected, - selectBlock, - position, - level, - rowCount, - siblingBlockCount, - showBlockMovers, - path, - isExpanded - } = _ref; - const cellRef = Object(external_wp_element_["useRef"])(null); - const [isHovered, setIsHovered] = Object(external_wp_element_["useState"])(false); - const { - clientId - } = block; - const { - toggleBlockHighlight - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const { - __experimentalFeatures: withExperimentalFeatures, - __experimentalPersistentListViewFeatures: withExperimentalPersistentListViewFeatures, - __experimentalHideContainerBlockActions: hideContainerBlockActions, - isTreeGridMounted, - expand, - collapse - } = useListViewContext(); - const hasSiblings = siblingBlockCount > 0; - const hasRenderedMovers = showBlockMovers && hasSiblings; - const moverCellClassName = classnames_default()('block-editor-list-view-block__mover-cell', { - 'is-visible': isHovered || isSelected - }); - const listViewBlockSettingsClassName = classnames_default()('block-editor-list-view-block__menu-cell', { - 'is-visible': isHovered || isSelected - }); // If ListView has experimental features related to the Persistent List View, - // only focus the selected list item on mount; otherwise the list would always - // try to steal the focus from the editor canvas. - - Object(external_wp_element_["useEffect"])(() => { - if (withExperimentalPersistentListViewFeatures && !isTreeGridMounted && isSelected) { - cellRef.current.focus(); - } - }, []); - const highlightBlock = withExperimentalPersistentListViewFeatures ? toggleBlockHighlight : () => {}; - const onMouseEnter = Object(external_wp_element_["useCallback"])(() => { - setIsHovered(true); - highlightBlock(clientId, true); - }, [clientId, setIsHovered, highlightBlock]); - const onMouseLeave = Object(external_wp_element_["useCallback"])(() => { - setIsHovered(false); - highlightBlock(clientId, false); - }, [clientId, setIsHovered, highlightBlock]); - const selectEditorBlock = Object(external_wp_element_["useCallback"])(event => { - event.stopPropagation(); - selectBlock(clientId); - }, [clientId, selectBlock]); - const toggleExpanded = Object(external_wp_element_["useCallback"])(event => { - event.stopPropagation(); - - if (isExpanded === true) { - collapse(clientId); - } else if (isExpanded === false) { - expand(clientId); - } - }, [clientId, expand, collapse, isExpanded]); - const showBlockActions = withExperimentalFeatures && ( //hide actions for blocks like core/widget-areas - !hideContainerBlockActions || hideContainerBlockActions && level > 1); - const hideBlockActions = withExperimentalFeatures && !showBlockActions; - let colSpan; - - if (hasRenderedMovers) { - colSpan = 2; - } else if (hideBlockActions) { - colSpan = 3; - } - - const classes = classnames_default()({ - 'is-selected': isSelected, - 'is-branch-selected': withExperimentalPersistentListViewFeatures && isBranchSelected, - 'is-dragging': isDragged, - 'has-single-cell': hideBlockActions - }); - return Object(external_wp_element_["createElement"])(ListViewLeaf, { - className: classes, - onMouseEnter: onMouseEnter, - onMouseLeave: onMouseLeave, - onFocus: onMouseEnter, - onBlur: onMouseLeave, - level: level, - position: position, - rowCount: rowCount, - path: path, - id: `list-view-block-${clientId}`, - "data-block": clientId, - isExpanded: isExpanded - }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalTreeGridCell"], { - className: "block-editor-list-view-block__contents-cell", - colSpan: colSpan, - ref: cellRef - }, _ref2 => { - let { - ref, - tabIndex, - onFocus - } = _ref2; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-list-view-block__contents-container" - }, Object(external_wp_element_["createElement"])(block_contents, { - block: block, - onClick: selectEditorBlock, - onToggleExpanded: toggleExpanded, - isSelected: isSelected, - position: position, - siblingBlockCount: siblingBlockCount, - level: level, - ref: ref, - tabIndex: tabIndex, - onFocus: onFocus - })); - }), hasRenderedMovers && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalTreeGridCell"], { - className: moverCellClassName, - withoutGridItem: true - }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalTreeGridItem"], null, _ref3 => { - let { - ref, - tabIndex, - onFocus - } = _ref3; - return Object(external_wp_element_["createElement"])(block_mover_button["b" /* BlockMoverUpButton */], { - orientation: "vertical", - clientIds: [clientId], - ref: ref, - tabIndex: tabIndex, - onFocus: onFocus - }); - }), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalTreeGridItem"], null, _ref4 => { - let { - ref, - tabIndex, - onFocus - } = _ref4; - return Object(external_wp_element_["createElement"])(block_mover_button["a" /* BlockMoverDownButton */], { - orientation: "vertical", - clientIds: [clientId], - ref: ref, - tabIndex: tabIndex, - onFocus: onFocus - }); - }))), showBlockActions && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalTreeGridCell"], { - className: listViewBlockSettingsClassName - }, _ref5 => { - let { - ref, - tabIndex, - onFocus - } = _ref5; - return Object(external_wp_element_["createElement"])(block_settings_dropdown["a" /* default */], { - clientIds: [clientId], - icon: more_vertical["a" /* default */], - toggleProps: { - ref, - className: 'block-editor-list-view-block__menu', - tabIndex, - onFocus - }, - disableOpenOnArrowDown: true, - __experimentalSelectBlock: selectEditorBlock - }); - })); -} - -/* harmony default export */ var list_view_block = (Object(external_wp_element_["memo"])(ListViewBlock)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/branch.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -/** - * Given a block, returns the total number of blocks in that subtree. This is used to help determine - * the list position of a block. - * - * When a block is collapsed, we do not count their children as part of that total. In the current drag - * implementation dragged blocks and their children are not counted. - * - * @param {Object} block block tree - * @param {Object} expandedState state that notes which branches are collapsed - * @param {Array} draggedClientIds a list of dragged client ids - * @return {number} block count - */ - -function countBlocks(block, expandedState, draggedClientIds) { - var _expandedState$block$; - - const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId); - - if (isDragged) { - return 0; - } - - const isExpanded = (_expandedState$block$ = expandedState[block.clientId]) !== null && _expandedState$block$ !== void 0 ? _expandedState$block$ : true; - - if (isExpanded) { - return 1 + block.innerBlocks.reduce(countReducer(expandedState, draggedClientIds), 0); - } - - return 1; -} - -const countReducer = (expandedState, draggedClientIds) => (count, block) => { - var _expandedState$block$2; - - const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId); - - if (isDragged) { - return count; - } - - const isExpanded = (_expandedState$block$2 = expandedState[block.clientId]) !== null && _expandedState$block$2 !== void 0 ? _expandedState$block$2 : true; - - if (isExpanded && block.innerBlocks.length > 0) { - return count + countBlocks(block, expandedState, draggedClientIds); - } - - return count + 1; -}; - -function ListViewBranch(props) { - const { - blocks, - selectBlock, - showBlockMovers, - showNestedBlocks, - selectedClientIds, - level = 1, - path = '', - isBranchSelected = false, - listPosition = 0, - fixedListWindow - } = props; - const { - expandedState, - draggedClientIds, - __experimentalPersistentListViewFeatures - } = useListViewContext(); - const filteredBlocks = Object(external_lodash_["compact"])(blocks); - const blockCount = filteredBlocks.length; - let nextPosition = listPosition; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, filteredBlocks.map((block, index) => { - var _expandedState$client; - - const { - clientId, - innerBlocks - } = block; - - if (index > 0) { - nextPosition += countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds); - } - - const usesWindowing = __experimentalPersistentListViewFeatures; - const { - itemInView - } = fixedListWindow; - const blockInView = !usesWindowing || itemInView(nextPosition); - const position = index + 1; - const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`; - const hasNestedBlocks = showNestedBlocks && !!innerBlocks && !!innerBlocks.length; - const isExpanded = hasNestedBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : true : undefined; - const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId)); - const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous, - // but asynchronous for any other block. - - const isSelected = isClientIdSelected(clientId, selectedClientIds); - const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks; - return Object(external_wp_element_["createElement"])(external_wp_data_["AsyncModeProvider"], { - key: clientId, - value: !isSelected - }, showBlock && Object(external_wp_element_["createElement"])(list_view_block, { - block: block, - selectBlock: selectBlock, - isSelected: isSelected, - isBranchSelected: isSelectedBranch, - isDragged: isDragged, - level: level, - position: position, - rowCount: blockCount, - siblingBlockCount: blockCount, - showBlockMovers: showBlockMovers, - path: updatedPath, - isExpanded: isExpanded, - listPosition: nextPosition - }), !showBlock && Object(external_wp_element_["createElement"])("tr", null, Object(external_wp_element_["createElement"])("td", { - className: "block-editor-list-view-placeholder" - })), hasNestedBlocks && isExpanded && !isDragged && Object(external_wp_element_["createElement"])(ListViewBranch, { - blocks: innerBlocks, - selectBlock: selectBlock, - showBlockMovers: showBlockMovers, - showNestedBlocks: showNestedBlocks, - level: level + 1, - path: updatedPath, - listPosition: nextPosition + 1, - fixedListWindow: fixedListWindow, - isBranchSelected: isSelectedBranch, - selectedClientIds: selectedClientIds - })); - })); -} - -ListViewBranch.defaultProps = { - selectBlock: () => {} -}; -/* harmony default export */ var branch = (Object(external_wp_element_["memo"])(ListViewBranch)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/drop-indicator.js - - -/** - * WordPress dependencies - */ - - -function ListViewDropIndicator(_ref) { - let { - listViewRef, - blockDropTarget - } = _ref; - const { - rootClientId, - clientId, - dropPosition - } = blockDropTarget || {}; - const [rootBlockElement, blockElement] = Object(external_wp_element_["useMemo"])(() => { - if (!listViewRef.current) { - return []; - } // The rootClientId will be defined whenever dropping into inner - // block lists, but is undefined when dropping at the root level. - - - const _rootBlockElement = rootClientId ? listViewRef.current.querySelector(`[data-block="${rootClientId}"]`) : undefined; // The clientId represents the sibling block, the dragged block will - // usually be inserted adjacent to it. It will be undefined when - // dropping a block into an empty block list. - - - const _blockElement = clientId ? listViewRef.current.querySelector(`[data-block="${clientId}"]`) : undefined; - - return [_rootBlockElement, _blockElement]; - }, [rootClientId, clientId]); // The targetElement is the element that the drop indicator will appear - // before or after. When dropping into an empty block list, blockElement - // is undefined, so the indicator will appear after the rootBlockElement. - - const targetElement = blockElement || rootBlockElement; - const getDropIndicatorIndent = Object(external_wp_element_["useCallback"])(() => { - if (!rootBlockElement) { - return 0; - } // Calculate the indent using the block icon of the root block. - // Using a classname selector here might be flaky and could be - // improved. - - - const targetElementRect = targetElement.getBoundingClientRect(); - const rootBlockIconElement = rootBlockElement.querySelector('.block-editor-block-icon'); - const rootBlockIconRect = rootBlockIconElement.getBoundingClientRect(); - return rootBlockIconRect.right - targetElementRect.left; - }, [rootBlockElement, targetElement]); - const style = Object(external_wp_element_["useMemo"])(() => { - if (!targetElement) { - return {}; - } - - const indent = getDropIndicatorIndent(); - return { - width: targetElement.offsetWidth - indent - }; - }, [getDropIndicatorIndent, targetElement]); - const getAnchorRect = Object(external_wp_element_["useCallback"])(() => { - if (!targetElement) { - return {}; - } - - const ownerDocument = targetElement.ownerDocument; - const rect = targetElement.getBoundingClientRect(); - const indent = getDropIndicatorIndent(); - const anchorRect = { - left: rect.left + indent, - right: rect.right, - width: 0, - height: rect.height, - ownerDocument - }; - - if (dropPosition === 'top') { - return { ...anchorRect, - top: rect.top, - bottom: rect.top - }; - } - - if (dropPosition === 'bottom' || dropPosition === 'inside') { - return { ...anchorRect, - top: rect.bottom, - bottom: rect.bottom - }; - } - - return {}; - }, [targetElement, dropPosition, getDropIndicatorIndent]); - - if (!targetElement) { - return null; - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { - noArrow: true, - animate: false, - getAnchorRect: getAnchorRect, - focusOnMount: false, - className: "block-editor-list-view-drop-indicator" - }, Object(external_wp_element_["createElement"])("div", { - style: style, - className: "block-editor-list-view-drop-indicator__line" - })); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-client-ids.js -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -function useListViewClientIds(blocks) { - return Object(external_wp_data_["useSelect"])(select => { - const { - getDraggedBlockClientIds, - getSelectedBlockClientIds, - __unstableGetClientIdsTree - } = select(store["a" /* store */]); - return { - selectedClientIds: getSelectedBlockClientIds(), - draggedClientIds: getDraggedBlockClientIds(), - clientIdsTree: blocks ? blocks : __unstableGetClientIdsTree() - }; - }, [blocks]); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/math.js -var math = __webpack_require__("vIlp"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-on-block-drop/index.js -var use_on_block_drop = __webpack_require__("/lNF"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-drop-zone.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -/** @typedef {import('../../utils/math').WPPoint} WPPoint */ - -/** - * The type of a drag event. - * - * @typedef {'default'|'file'|'html'} WPDragEventType - */ - -/** - * An array representing data for blocks in the DOM used by drag and drop. - * - * @typedef {Object} WPListViewDropZoneBlocks - * @property {string} clientId The client id for the block. - * @property {string} rootClientId The root client id for the block. - * @property {number} blockIndex The block's index. - * @property {Element} element The DOM element representing the block. - * @property {number} innerBlockCount The number of inner blocks the block has. - * @property {boolean} isDraggedBlock Whether the block is currently being dragged. - * @property {boolean} canInsertDraggedBlocksAsSibling Whether the dragged block can be a sibling of this block. - * @property {boolean} canInsertDraggedBlocksAsChild Whether the dragged block can be a child of this block. - */ - -/** - * An object containing details of a drop target. - * - * @typedef {Object} WPListViewDropZoneTarget - * @property {string} blockIndex The insertion index. - * @property {string} rootClientId The root client id for the block. - * @property {string|undefined} clientId The client id for the block. - * @property {'top'|'bottom'|'inside'} dropPosition The position relative to the block that the user is dropping to. - * 'inside' refers to nesting as an inner block. - */ - -/** - * Is the point contained by the rectangle. - * - * @param {WPPoint} point The point. - * @param {DOMRect} rect The rectangle. - * - * @return {boolean} True if the point is contained by the rectangle, false otherwise. - */ - -function isPointContainedByRect(point, rect) { - return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y; -} -/** - * Determines whether the user positioning the dragged block to nest as an - * inner block. - * - * Presently this is determined by whether the cursor is on the right hand side - * of the block. - * - * @param {WPPoint} point The point representing the cursor position when dragging. - * @param {DOMRect} rect The rectangle. - */ - - -function isNestingGesture(point, rect) { - const blockCenterX = rect.left + rect.width / 2; - return point.x > blockCenterX; -} // Block navigation is always a vertical list, so only allow dropping -// to the above or below a block. - - -const ALLOWED_DROP_EDGES = ['top', 'bottom']; -/** - * Given blocks data and the cursor position, compute the drop target. - * - * @param {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. - * @param {WPPoint} position The point representing the cursor position when dragging. - * - * @return {WPListViewDropZoneTarget} An object containing data about the drop target. - */ - -function getListViewDropTarget(blocksData, position) { - let candidateEdge; - let candidateBlockData; - let candidateDistance; - let candidateRect; - - for (const blockData of blocksData) { - if (blockData.isDraggedBlock) { - continue; - } - - const rect = blockData.element.getBoundingClientRect(); - const [distance, edge] = Object(math["a" /* getDistanceToNearestEdge */])(position, rect, ALLOWED_DROP_EDGES); - const isCursorWithinBlock = isPointContainedByRect(position, rect); - - if (candidateDistance === undefined || distance < candidateDistance || isCursorWithinBlock) { - candidateDistance = distance; - const index = blocksData.indexOf(blockData); - const previousBlockData = blocksData[index - 1]; // If dragging near the top of a block and the preceding block - // is at the same level, use the preceding block as the candidate - // instead, as later it makes determining a nesting drop easier. - - if (edge === 'top' && previousBlockData && previousBlockData.rootClientId === blockData.rootClientId && !previousBlockData.isDraggedBlock) { - candidateBlockData = previousBlockData; - candidateEdge = 'bottom'; - candidateRect = previousBlockData.element.getBoundingClientRect(); - } else { - candidateBlockData = blockData; - candidateEdge = edge; - candidateRect = rect; - } // If the mouse position is within the block, break early - // as the user would intend to drop either before or after - // this block. - // - // This solves an issue where some rows in the list view - // tree overlap slightly due to sub-pixel rendering. - - - if (isCursorWithinBlock) { - break; - } - } - } - - if (!candidateBlockData) { - return; - } - - const isDraggingBelow = candidateEdge === 'bottom'; // If the user is dragging towards the bottom of the block check whether - // they might be trying to nest the block as a child. - // If the block already has inner blocks, this should always be treated - // as nesting since the next block in the tree will be the first child. - - if (isDraggingBelow && candidateBlockData.canInsertDraggedBlocksAsChild && (candidateBlockData.innerBlockCount > 0 || isNestingGesture(position, candidateRect))) { - return { - rootClientId: candidateBlockData.clientId, - blockIndex: 0, - dropPosition: 'inside' - }; - } // If dropping as a sibling, but block cannot be inserted in - // this context, return early. - - - if (!candidateBlockData.canInsertDraggedBlocksAsSibling) { - return; - } - - const offset = isDraggingBelow ? 1 : 0; - return { - rootClientId: candidateBlockData.rootClientId, - clientId: candidateBlockData.clientId, - blockIndex: candidateBlockData.blockIndex + offset, - dropPosition: candidateEdge - }; -} -/** - * A react hook for implementing a drop zone in list view. - * - * @return {WPListViewDropZoneTarget} The drop target. - */ - - -function useListViewDropZone() { - const { - getBlockRootClientId, - getBlockIndex, - getBlockCount, - getDraggedBlockClientIds, - canInsertBlocks - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const [target, setTarget] = Object(external_wp_element_["useState"])(); - const { - rootClientId: targetRootClientId, - blockIndex: targetBlockIndex - } = target || {}; - const onBlockDrop = Object(use_on_block_drop["a" /* default */])(targetRootClientId, targetBlockIndex); - const draggedBlockClientIds = getDraggedBlockClientIds(); - const throttled = Object(external_wp_compose_["useThrottle"])(Object(external_wp_element_["useCallback"])((event, currentTarget) => { - const position = { - x: event.clientX, - y: event.clientY - }; - const isBlockDrag = !!(draggedBlockClientIds !== null && draggedBlockClientIds !== void 0 && draggedBlockClientIds.length); - const blockElements = Array.from(currentTarget.querySelectorAll('[data-block]')); - const blocksData = blockElements.map(blockElement => { - const clientId = blockElement.dataset.block; - const rootClientId = getBlockRootClientId(clientId); - return { - clientId, - rootClientId, - blockIndex: getBlockIndex(clientId), - element: blockElement, - isDraggedBlock: isBlockDrag ? draggedBlockClientIds.includes(clientId) : false, - innerBlockCount: getBlockCount(clientId), - canInsertDraggedBlocksAsSibling: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, rootClientId) : true, - canInsertDraggedBlocksAsChild: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, clientId) : true - }; - }); - const newTarget = getListViewDropTarget(blocksData, position); - - if (newTarget) { - setTarget(newTarget); - } - }, [draggedBlockClientIds]), 200); - const ref = Object(external_wp_compose_["__experimentalUseDropZone"])({ - onDrop: onBlockDrop, - - onDragOver(event) { - // `currentTarget` is only available while the event is being - // handled, so get it now and pass it to the thottled function. - // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget - throttled(event, event.currentTarget); - }, - - onDragEnd() { - throttled.cancel(); - setTarget(null); - } - - }); - return { - ref, - target - }; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/index.js - - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - - - -const noop = () => {}; - -const list_view_expanded = (state, action) => { - switch (action.type) { - case 'expand': - return { ...state, - ...{ - [action.clientId]: true - } - }; - - case 'collapse': - return { ...state, - ...{ - [action.clientId]: false - } - }; - - default: - return state; - } -}; -/** - * Wrap `ListViewRows` with `TreeGrid`. ListViewRows is a - * recursive component (it renders itself), so this ensures TreeGrid is only - * present at the very top of the navigation grid. - * - * @param {Object} props Components props. - * @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy. - * @param {Function} props.onSelect Block selection callback. - * @param {boolean} props.showNestedBlocks Flag to enable displaying nested blocks. - * @param {boolean} props.showBlockMovers Flag to enable block movers - * @param {boolean} props.__experimentalFeatures Flag to enable experimental features. - * @param {boolean} props.__experimentalPersistentListViewFeatures Flag to enable features for the Persistent List View experiment. - * @param {boolean} props.__experimentalHideContainerBlockActions Flag to hide actions of top level blocks (like core/widget-area) - * @param {Object} ref Forwarded ref - */ - - -function ListView(_ref, ref) { - let { - blocks, - onSelect = noop, - __experimentalFeatures, - __experimentalPersistentListViewFeatures, - __experimentalHideContainerBlockActions, - showNestedBlocks, - showBlockMovers, - ...props - } = _ref; - const { - clientIdsTree, - draggedClientIds, - selectedClientIds - } = useListViewClientIds(blocks); - const { - selectBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const { - visibleBlockCount - } = Object(external_wp_data_["useSelect"])(select => { - const { - getGlobalBlockCount, - getClientIdsOfDescendants - } = select(store["a" /* store */]); - const draggedBlockCount = (draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.length) > 0 ? getClientIdsOfDescendants(draggedClientIds).length + 1 : 0; - return { - visibleBlockCount: getGlobalBlockCount() - draggedBlockCount - }; - }, [draggedClientIds]); - const selectEditorBlock = Object(external_wp_element_["useCallback"])(clientId => { - selectBlock(clientId); - onSelect(clientId); - }, [selectBlock, onSelect]); - const [expandedState, setExpandedState] = Object(external_wp_element_["useReducer"])(list_view_expanded, {}); - const { - ref: dropZoneRef, - target: blockDropTarget - } = useListViewDropZone(); - const elementRef = Object(external_wp_element_["useRef"])(); - const treeGridRef = Object(external_wp_compose_["useMergeRefs"])([elementRef, dropZoneRef, ref]); - const isMounted = Object(external_wp_element_["useRef"])(false); - Object(external_wp_element_["useEffect"])(() => { - isMounted.current = true; - }, []); // List View renders a fixed number of items and relies on each having a fixed item height of 36px. - // If this value changes, we should also change the itemHeight value set in useFixedWindowList. - // See: https://github.com/WordPress/gutenberg/pull/35230 for additional context. - - const [fixedListWindow] = Object(external_wp_compose_["__experimentalUseFixedWindowList"])(elementRef, 36, visibleBlockCount, { - useWindowing: __experimentalPersistentListViewFeatures, - windowOverscan: 40 - }); - const expand = Object(external_wp_element_["useCallback"])(clientId => { - if (!clientId) { - return; - } - - setExpandedState({ - type: 'expand', - clientId - }); - }, [setExpandedState]); - const collapse = Object(external_wp_element_["useCallback"])(clientId => { - if (!clientId) { - return; - } - - setExpandedState({ - type: 'collapse', - clientId - }); - }, [setExpandedState]); - const expandRow = Object(external_wp_element_["useCallback"])(row => { - var _row$dataset; - - expand(row === null || row === void 0 ? void 0 : (_row$dataset = row.dataset) === null || _row$dataset === void 0 ? void 0 : _row$dataset.block); - }, [expand]); - const collapseRow = Object(external_wp_element_["useCallback"])(row => { - var _row$dataset2; - - collapse(row === null || row === void 0 ? void 0 : (_row$dataset2 = row.dataset) === null || _row$dataset2 === void 0 ? void 0 : _row$dataset2.block); - }, [collapse]); - const contextValue = Object(external_wp_element_["useMemo"])(() => ({ - __experimentalFeatures, - __experimentalPersistentListViewFeatures, - __experimentalHideContainerBlockActions, - isTreeGridMounted: isMounted.current, - draggedClientIds, - expandedState, - expand, - collapse - }), [__experimentalFeatures, __experimentalPersistentListViewFeatures, __experimentalHideContainerBlockActions, isMounted.current, draggedClientIds, expandedState, expand, collapse]); - return Object(external_wp_element_["createElement"])(external_wp_data_["AsyncModeProvider"], { - value: true - }, Object(external_wp_element_["createElement"])(ListViewDropIndicator, { - listViewRef: elementRef, - blockDropTarget: blockDropTarget - }), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalTreeGrid"], { - className: "block-editor-list-view-tree", - "aria-label": Object(external_wp_i18n_["__"])('Block navigation structure'), - ref: treeGridRef, - onCollapseRow: collapseRow, - onExpandRow: expandRow - }, Object(external_wp_element_["createElement"])(ListViewContext.Provider, { - value: contextValue - }, Object(external_wp_element_["createElement"])(branch, Object(esm_extends["a" /* default */])({ - blocks: clientIdsTree, - selectBlock: selectEditorBlock, - showNestedBlocks: showNestedBlocks, - showBlockMovers: showBlockMovers, - fixedListWindow: fixedListWindow, - selectedClientIds: selectedClientIds - }, props))))); -} - -/* harmony default export */ var components_list_view = (Object(external_wp_element_["forwardRef"])(ListView)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-navigation/dropdown.js - - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -function BlockNavigationDropdownToggle(_ref) { - let { - isEnabled, - onToggle, - isOpen, - innerRef, - ...props - } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, props, { - ref: innerRef, - icon: list_view["a" /* default */], - "aria-expanded": isOpen, - "aria-haspopup": "true", - onClick: isEnabled ? onToggle : undefined - /* translators: button label text should, if possible, be under 16 characters. */ - , - label: Object(external_wp_i18n_["__"])('List view'), - className: "block-editor-block-navigation", - "aria-disabled": !isEnabled - })); -} - -function BlockNavigationDropdown(_ref2, ref) { - let { - isDisabled, - __experimentalFeatures, - ...props - } = _ref2; - const hasBlocks = Object(external_wp_data_["useSelect"])(select => !!select(store["a" /* store */]).getBlockCount(), []); - const isEnabled = hasBlocks && !isDisabled; - return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { - contentClassName: "block-editor-block-navigation__popover", - position: "bottom right", - renderToggle: _ref3 => { - let { - isOpen, - onToggle - } = _ref3; - return Object(external_wp_element_["createElement"])(BlockNavigationDropdownToggle, Object(esm_extends["a" /* default */])({}, props, { - innerRef: ref, - isOpen: isOpen, - onToggle: onToggle, - isEnabled: isEnabled - })); - }, - renderContent: () => Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-navigation__container" - }, Object(external_wp_element_["createElement"])("p", { - className: "block-editor-block-navigation__label" - }, Object(external_wp_i18n_["__"])('List view')), Object(external_wp_element_["createElement"])(components_list_view, { - showNestedBlocks: true, - __experimentalFeatures: __experimentalFeatures - })) - }); -} - -/* harmony default export */ var dropdown = (Object(external_wp_element_["forwardRef"])(BlockNavigationDropdown)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js -var layout = __webpack_require__("Civd"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-variation-picker/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -function BlockVariationPicker(_ref) { - let { - icon = layout["a" /* default */], - label = Object(external_wp_i18n_["__"])('Choose variation'), - instructions = Object(external_wp_i18n_["__"])('Select a variation to start with.'), - variations, - onSelect, - allowSkip - } = _ref; - const classes = classnames_default()('block-editor-block-variation-picker', { - 'has-many-variations': variations.length > 4 - }); - return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], { - icon: icon, - label: label, - instructions: instructions, - className: classes - }, Object(external_wp_element_["createElement"])("ul", { - className: "block-editor-block-variation-picker__variations", - role: "list", - "aria-label": Object(external_wp_i18n_["__"])('Block variations') - }, variations.map(variation => Object(external_wp_element_["createElement"])("li", { - key: variation.name - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "secondary", - icon: variation.icon, - iconSize: 48, - onClick: () => onSelect(variation), - className: "block-editor-block-variation-picker__variation", - label: variation.description || variation.title - }), Object(external_wp_element_["createElement"])("span", { - className: "block-editor-block-variation-picker__variation-label", - role: "presentation" - }, variation.title)))), allowSkip && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-variation-picker__skip" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "link", - onClick: () => onSelect() - }, Object(external_wp_i18n_["__"])('Skip')))); -} - -/* harmony default export */ var block_variation_picker = (BlockVariationPicker); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js + 2 modules -var block_preview = __webpack_require__("REKd"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js -var chevron_left = __webpack_require__("2gm7"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js -var chevron_right = __webpack_require__("1iEr"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-full-width.js -var stretch_full_width = __webpack_require__("XNw2"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js -var grid = __webpack_require__("b2RC"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/constants.js -const VIEWMODES = { - carousel: 'carousel', - grid: 'grid' -}; - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/setup-toolbar.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -const Actions = _ref => { - let { - onStartBlank, - onBlockPatternSelect - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-pattern-setup__actions" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - onClick: onStartBlank - }, Object(external_wp_i18n_["__"])('Start blank')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "primary", - onClick: onBlockPatternSelect - }, Object(external_wp_i18n_["__"])('Choose'))); -}; - -const CarouselNavigation = _ref2 => { - let { - handlePrevious, - handleNext, - activeSlide, - totalSlides - } = _ref2; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-pattern-setup__navigation" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: chevron_left["a" /* default */], - label: Object(external_wp_i18n_["__"])('Previous pattern'), - onClick: handlePrevious, - disabled: activeSlide === 0 - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: chevron_right["a" /* default */], - label: Object(external_wp_i18n_["__"])('Next pattern'), - onClick: handleNext, - disabled: activeSlide === totalSlides - 1 - })); -}; - -const SetupToolbar = _ref3 => { - let { - viewMode, - setViewMode, - handlePrevious, - handleNext, - activeSlide, - totalSlides, - onBlockPatternSelect, - onStartBlank - } = _ref3; - const isCarouselView = viewMode === VIEWMODES.carousel; - const displayControls = Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-pattern-setup__display-controls" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: stretch_full_width["a" /* default */], - label: Object(external_wp_i18n_["__"])('Carousel view'), - onClick: () => setViewMode(VIEWMODES.carousel), - isPressed: isCarouselView - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: grid["a" /* default */], - label: Object(external_wp_i18n_["__"])('Grid view'), - onClick: () => setViewMode(VIEWMODES.grid), - isPressed: viewMode === VIEWMODES.grid - })); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-pattern-setup__toolbar" - }, isCarouselView && Object(external_wp_element_["createElement"])(CarouselNavigation, { - handlePrevious: handlePrevious, - handleNext: handleNext, - activeSlide: activeSlide, - totalSlides: totalSlides - }), displayControls, isCarouselView && Object(external_wp_element_["createElement"])(Actions, { - onBlockPatternSelect: onBlockPatternSelect, - onStartBlank: onStartBlank - })); -}; - -/* harmony default export */ var setup_toolbar = (SetupToolbar); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/use-patterns-setup.js -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - -function usePatternsSetup(clientId, blockName, filterPatternsFn) { - return Object(external_wp_data_["useSelect"])(select => { - const { - getBlockRootClientId, - __experimentalGetPatternsByBlockTypes, - __experimentalGetAllowedPatterns - } = select(store["a" /* store */]); - const rootClientId = getBlockRootClientId(clientId); - - if (filterPatternsFn) { - return __experimentalGetAllowedPatterns(rootClientId).filter(filterPatternsFn); - } - - return __experimentalGetPatternsByBlockTypes(blockName, rootClientId); - }, [clientId, blockName, filterPatternsFn]); -} - -/* harmony default export */ var use_patterns_setup = (usePatternsSetup); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/index.js - - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - - -const SetupContent = _ref => { - let { - viewMode, - activeSlide, - patterns, - onBlockPatternSelect - } = _ref; - const composite = Object(external_wp_components_["__unstableUseCompositeState"])(); - const containerClass = 'block-editor-block-pattern-setup__container'; - - if (viewMode === VIEWMODES.carousel) { - const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]); - return Object(external_wp_element_["createElement"])("div", { - className: containerClass - }, Object(external_wp_element_["createElement"])("ul", { - className: "carousel-container" - }, patterns.map((pattern, index) => Object(external_wp_element_["createElement"])(BlockPatternSlide, { - className: slideClass.get(index) || '', - key: pattern.name, - pattern: pattern - })))); - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["__unstableComposite"], Object(esm_extends["a" /* default */])({}, composite, { - role: "listbox", - className: containerClass, - "aria-label": Object(external_wp_i18n_["__"])('Patterns list') - }), patterns.map(pattern => Object(external_wp_element_["createElement"])(BlockPattern, { - key: pattern.name, - pattern: pattern, - onSelect: onBlockPatternSelect, - composite: composite - }))); -}; - -function BlockPattern(_ref2) { - let { - pattern, - onSelect, - composite - } = _ref2; - const baseClassName = 'block-editor-block-pattern-setup-list'; - const { - blocks, - title, - description, - viewportWidth = 700 - } = pattern; - const descriptionId = Object(external_wp_compose_["useInstanceId"])(BlockPattern, `${baseClassName}__item-description`); - return Object(external_wp_element_["createElement"])("div", { - className: `${baseClassName}__list-item`, - "aria-label": pattern.title, - "aria-describedby": pattern.description ? descriptionId : undefined - }, Object(external_wp_element_["createElement"])(external_wp_components_["__unstableCompositeItem"], Object(esm_extends["a" /* default */])({ - role: "option", - as: "div" - }, composite, { - className: `${baseClassName}__item`, - onClick: () => onSelect(blocks) - }), Object(external_wp_element_["createElement"])(block_preview["a" /* default */], { - blocks: blocks, - viewportWidth: viewportWidth - }), Object(external_wp_element_["createElement"])("div", { - className: `${baseClassName}__item-title` - }, title)), !!description && Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { - id: descriptionId - }, description)); -} - -function BlockPatternSlide(_ref3) { - let { - className, - pattern - } = _ref3; - const { - blocks, - title, - description - } = pattern; - const descriptionId = Object(external_wp_compose_["useInstanceId"])(BlockPatternSlide, 'block-editor-block-pattern-setup-list__item-description'); - return Object(external_wp_element_["createElement"])("li", { - className: `pattern-slide ${className}`, - "aria-label": title, - "aria-describedby": description ? descriptionId : undefined - }, Object(external_wp_element_["createElement"])(block_preview["a" /* default */], { - blocks: blocks, - __experimentalLive: true - }), !!description && Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { - id: descriptionId - }, description)); -} - -const BlockPatternSetup = _ref4 => { - let { - clientId, - blockName, - filterPatternsFn, - startBlankComponent, - onBlockPatternSelect - } = _ref4; - const [viewMode, setViewMode] = Object(external_wp_element_["useState"])(VIEWMODES.carousel); - const [activeSlide, setActiveSlide] = Object(external_wp_element_["useState"])(0); - const [showBlank, setShowBlank] = Object(external_wp_element_["useState"])(false); - const { - replaceBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const patterns = use_patterns_setup(clientId, blockName, filterPatternsFn); - - if (!(patterns !== null && patterns !== void 0 && patterns.length) || showBlank) { - return startBlankComponent; - } - - const onBlockPatternSelectDefault = blocks => { - const clonedBlocks = blocks.map(block => Object(external_wp_blocks_["cloneBlock"])(block)); - replaceBlock(clientId, clonedBlocks); - }; - - const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault; - return Object(external_wp_element_["createElement"])("div", { - className: `block-editor-block-pattern-setup view-mode-${viewMode}` - }, Object(external_wp_element_["createElement"])(setup_toolbar, { - viewMode: viewMode, - setViewMode: setViewMode, - activeSlide: activeSlide, - totalSlides: patterns.length, - handleNext: () => { - setActiveSlide(active => active + 1); - }, - handlePrevious: () => { - setActiveSlide(active => active - 1); - }, - onBlockPatternSelect: () => { - onPatternSelectCallback(patterns[activeSlide].blocks); - }, - onStartBlank: () => { - setShowBlank(true); - } - }), Object(external_wp_element_["createElement"])(SetupContent, { - viewMode: viewMode, - activeSlide: activeSlide, - patterns: patterns, - onBlockPatternSelect: onPatternSelectCallback - })); -}; - -/* harmony default export */ var block_pattern_setup = (BlockPatternSetup); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js -var chevron_down = __webpack_require__("NWDH"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/block-variation-transforms.js -var block_variation_transforms = __webpack_require__("Btt3"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-variation-transforms/index.js - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -function __experimentalBlockVariationTransforms(_ref) { - let { - blockClientId - } = _ref; - const [selectedValue, setSelectedValue] = Object(external_wp_element_["useState"])(); - const { - updateBlockAttributes - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const { - variations, - blockAttributes - } = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockVariations - } = select(external_wp_blocks_["store"]); - const { - getBlockName, - getBlockAttributes - } = select(store["a" /* store */]); - const blockName = blockClientId && getBlockName(blockClientId); - return { - variations: blockName && getBlockVariations(blockName, 'transform'), - blockAttributes: getBlockAttributes(blockClientId) - }; - }, [blockClientId]); - Object(external_wp_element_["useEffect"])(() => { - var _getMatchingVariation; - - setSelectedValue((_getMatchingVariation = Object(block_variation_transforms["a" /* __experimentalGetMatchingVariation */])(blockAttributes, variations)) === null || _getMatchingVariation === void 0 ? void 0 : _getMatchingVariation.name); - }, [blockAttributes, variations]); - if (!(variations !== null && variations !== void 0 && variations.length)) return null; - const selectOptions = variations.map(_ref2 => { - let { - name, - title, - description - } = _ref2; - return { - value: name, - label: title, - info: description - }; - }); - - const onSelectVariation = variationName => { - updateBlockAttributes(blockClientId, { ...variations.find(_ref3 => { - let { - name - } = _ref3; - return name === variationName; - }).attributes - }); - }; - - const baseClass = 'block-editor-block-variation-transforms'; - return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { - className: baseClass, - label: Object(external_wp_i18n_["__"])('Transform to variation'), - text: Object(external_wp_i18n_["__"])('Transform to variation'), - popoverProps: { - position: 'bottom center', - className: `${baseClass}__popover` - }, - icon: chevron_down["a" /* default */], - toggleProps: { - iconPosition: 'right' - } - }, () => Object(external_wp_element_["createElement"])("div", { - className: `${baseClass}__container` - }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItemsChoice"], { - choices: selectOptions, - value: selectedValue, - onSelect: onSelectVariation - })))); -} - -/* harmony default export */ var components_block_variation_transforms = (__experimentalBlockVariationTransforms); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/icons.js - - -/** - * WordPress dependencies - */ - -const alignBottom = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z" -})); -const alignCenter = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" -})); -const alignTop = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z" -})); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/ui.js - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -const BLOCK_ALIGNMENTS_CONTROLS = { - top: { - icon: alignTop, - title: Object(external_wp_i18n_["_x"])('Align top', 'Block vertical alignment setting') - }, - center: { - icon: alignCenter, - title: Object(external_wp_i18n_["_x"])('Align middle', 'Block vertical alignment setting') - }, - bottom: { - icon: alignBottom, - title: Object(external_wp_i18n_["_x"])('Align bottom', 'Block vertical alignment setting') - } -}; -const DEFAULT_CONTROLS = ['top', 'center', 'bottom']; -const DEFAULT_CONTROL = 'top'; -const block_vertical_alignment_control_ui_POPOVER_PROPS = { - isAlternate: true -}; - -function BlockVerticalAlignmentUI(_ref) { - let { - value, - onChange, - controls = DEFAULT_CONTROLS, - isCollapsed = true, - isToolbar - } = _ref; - - function applyOrUnset(align) { - return () => onChange(value === align ? undefined : align); - } - - const activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[value]; - const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL]; - const UIComponent = isToolbar ? external_wp_components_["ToolbarGroup"] : external_wp_components_["ToolbarDropdownMenu"]; - const extraProps = isToolbar ? { - isCollapsed - } : {}; - return Object(external_wp_element_["createElement"])(UIComponent, Object(esm_extends["a" /* default */])({ - popoverProps: block_vertical_alignment_control_ui_POPOVER_PROPS, - icon: activeAlignment ? activeAlignment.icon : defaultAlignmentControl.icon, - label: Object(external_wp_i18n_["_x"])('Change vertical alignment', 'Block vertical alignment setting label'), - controls: controls.map(control => { - return { ...BLOCK_ALIGNMENTS_CONTROLS[control], - isActive: value === control, - role: isCollapsed ? 'menuitemradio' : undefined, - onClick: applyOrUnset(control) - }; - }) - }, extraProps)); -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md - */ - - -/* harmony default export */ var block_vertical_alignment_control_ui = (BlockVerticalAlignmentUI); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/index.js - - - -/** - * Internal dependencies - */ - -function BlockVerticalAlignmentControl(props) { - return Object(external_wp_element_["createElement"])(block_vertical_alignment_control_ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: false - })); -} -function BlockVerticalAlignmentToolbar(props) { - return Object(external_wp_element_["createElement"])(block_vertical_alignment_control_ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: true - })); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js + 4 modules -var border_radius_control = __webpack_require__("Wy3j"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-style-control/index.js + 2 modules -var border_style_control = __webpack_require__("2YCo"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js -var button_block_appender = __webpack_require__("I5Hl"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js -var use_setting = __webpack_require__("v5LD"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-palette/with-color-context.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/* harmony default export */ var with_color_context = (Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => { - return props => { - const colorsFeature = Object(use_setting["a" /* default */])('color.palette'); - const disableCustomColorsFeature = !Object(use_setting["a" /* default */])('color.custom'); - const colors = props.colors === undefined ? colorsFeature : props.colors; - const disableCustomColors = props.disableCustomColors === undefined ? disableCustomColorsFeature : props.disableCustomColors; - const hasColorsToChoose = !Object(external_lodash_["isEmpty"])(colors) || !disableCustomColors; - return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, props, { - colors, - disableCustomColors, - hasColorsToChoose - })); - }; -}, 'withColorContext')); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-palette/index.js -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -/* harmony default export */ var color_palette = (with_color_context(external_wp_components_["ColorPalette"])); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/control.js -var control = __webpack_require__("hMaJ"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-palette/control.js - - - -/** - * Internal dependencies - */ - -function ColorPaletteControl(_ref) { - let { - onChange, - value, - ...otherProps - } = _ref; - return Object(external_wp_element_["createElement"])(control["a" /* default */], Object(esm_extends["a" /* default */])({}, otherProps, { - onColorChange: onChange, - colorValue: value, - gradients: [], - disableCustomGradients: true - })); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/contrast-checker/index.js -var contrast_checker = __webpack_require__("6c9H"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/duotone-control/index.js -var duotone_control = __webpack_require__("1uGa"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-appearance-control/index.js -var font_appearance_control = __webpack_require__("Bo0k"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-family/index.js -var font_family = __webpack_require__("GKUk"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/letter-spacing-control/index.js -var letter_spacing_control = __webpack_require__("xBDm"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js + 1 modules -var text_decoration_control = __webpack_require__("kVRd"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js + 3 modules -var text_transform_control = __webpack_require__("/Hvg"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/dropdown.js -var colors_gradients_dropdown = __webpack_require__("dchM"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js -var panel_color_gradient_settings = __webpack_require__("yU1v"); - -// CONCATENATED MODULE: ./node_modules/react-easy-crop/node_modules/tslib/tslib.es6.js -/*! ***************************************************************************** -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 */ - -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) { - 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 __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; - return g = { next: verb(0), "throw": verb(1), "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 (_) 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; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (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; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -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 __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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - 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: n === "return" } : 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, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); -} - -function __classPrivateFieldSet(receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; -} - -// EXTERNAL MODULE: external "React" -var external_React_ = __webpack_require__("cDcd"); -var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); - -// EXTERNAL MODULE: ./node_modules/normalize-wheel/index.js -var normalize_wheel = __webpack_require__("wJiJ"); -var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel); - -// CONCATENATED MODULE: ./node_modules/react-easy-crop/index.module.js - - - - -/** - * Compute the dimension of the crop area based on media size, - * aspect ratio and optionally rotation - */ - -function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) { - if (rotation === void 0) { - rotation = 0; - } - - var _a = translateSize(mediaWidth, mediaHeight, rotation), - width = _a.width, - height = _a.height; - - var fittingWidth = Math.min(width, containerWidth); - var fittingHeight = Math.min(height, containerHeight); - - if (fittingWidth > fittingHeight * aspect) { - return { - width: fittingHeight * aspect, - height: fittingHeight - }; - } - - return { - width: fittingWidth, - height: fittingWidth / aspect - }; -} -/** - * Ensure a new media position stays in the crop area. - */ - -function index_module_restrictPosition(position, mediaSize, cropSize, zoom, rotation) { - if (rotation === void 0) { - rotation = 0; - } - - var _a = translateSize(mediaSize.width, mediaSize.height, rotation), - width = _a.width, - height = _a.height; - - return { - x: restrictPositionCoord(position.x, width, cropSize.width, zoom), - y: restrictPositionCoord(position.y, height, cropSize.height, zoom) - }; -} - -function restrictPositionCoord(position, mediaSize, cropSize, zoom) { - var maxPosition = mediaSize * zoom / 2 - cropSize / 2; - return Math.min(maxPosition, Math.max(position, -maxPosition)); -} - -function getDistanceBetweenPoints(pointA, pointB) { - return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2)); -} -function getRotationBetweenPoints(pointA, pointB) { - return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI; -} -/** - * Compute the output cropped area of the media in percentages and pixels. - * x/y are the top-left coordinates on the src media - */ - -function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) { - if (rotation === void 0) { - rotation = 0; - } - - if (restrictPosition === void 0) { - restrictPosition = true; - } // if the media is rotated by the user, we cannot limit the position anymore - // as it might need to be negative. - - - var limitAreaFn = restrictPosition && rotation === 0 ? limitArea : noOp; - var croppedAreaPercentages = { - x: limitAreaFn(100, ((mediaSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaSize.width * 100), - y: limitAreaFn(100, ((mediaSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaSize.height * 100), - width: limitAreaFn(100, cropSize.width / mediaSize.width * 100 / zoom), - height: limitAreaFn(100, cropSize.height / mediaSize.height * 100 / zoom) - }; // we compute the pixels size naively - - var widthInPixels = Math.round(limitAreaFn(mediaSize.naturalWidth, croppedAreaPercentages.width * mediaSize.naturalWidth / 100)); - var heightInPixels = Math.round(limitAreaFn(mediaSize.naturalHeight, croppedAreaPercentages.height * mediaSize.naturalHeight / 100)); - var isImgWiderThanHigh = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; // then we ensure the width and height exactly match the aspect (to avoid rounding approximations) - // if the media is wider than high, when zoom is 0, the crop height will be equals to iamge height - // thus we want to compute the width from the height and aspect for accuracy. - // Otherwise, we compute the height from width and aspect. - - var sizePixels = isImgWiderThanHigh ? { - width: Math.round(heightInPixels * aspect), - height: heightInPixels - } : { - width: widthInPixels, - height: Math.round(widthInPixels / aspect) - }; - - var croppedAreaPixels = __assign(__assign({}, sizePixels), { - x: Math.round(limitAreaFn(mediaSize.naturalWidth - sizePixels.width, croppedAreaPercentages.x * mediaSize.naturalWidth / 100)), - y: Math.round(limitAreaFn(mediaSize.naturalHeight - sizePixels.height, croppedAreaPercentages.y * mediaSize.naturalHeight / 100)) - }); - - return { - croppedAreaPercentages: croppedAreaPercentages, - croppedAreaPixels: croppedAreaPixels - }; -} -/** - * Ensure the returned value is between 0 and max - */ - -function limitArea(max, value) { - return Math.min(max, Math.max(0, value)); -} - -function noOp(_max, value) { - return value; -} -/** - * Compute the crop and zoom from the croppedAreaPixels - */ - - -function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { - var mediaZoom = mediaSize.width / mediaSize.naturalWidth; - - if (cropSize) { - var isHeightMaxSize_1 = cropSize.height > cropSize.width; - return isHeightMaxSize_1 ? cropSize.height / mediaZoom / croppedAreaPixels.height : cropSize.width / mediaZoom / croppedAreaPixels.width; - } - - var aspect = croppedAreaPixels.width / croppedAreaPixels.height; - var isHeightMaxSize = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; - return isHeightMaxSize ? mediaSize.naturalHeight / croppedAreaPixels.height : mediaSize.naturalWidth / croppedAreaPixels.width; -} -/** - * Compute the crop and zoom from the croppedAreaPixels - */ - - -function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { - var mediaZoom = mediaSize.width / mediaSize.naturalWidth; - var zoom = getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize); - var cropZoom = mediaZoom * zoom; - var crop = { - x: ((mediaSize.naturalWidth - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom, - y: ((mediaSize.naturalHeight - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom - }; - return { - crop: crop, - zoom: zoom - }; -} -/** - * Return the point that is the center of point a and b - */ - -function getCenter(a, b) { - return { - x: (b.x + a.x) / 2, - y: (b.y + a.y) / 2 - }; -} -/** - * - * Returns an x,y point once rotated around xMid,yMid - */ - -function rotateAroundMidPoint(x, y, xMid, yMid, degrees) { - var cos = Math.cos; - var sin = Math.sin; - var radian = degrees * Math.PI / 180; // Convert to radians - // Subtract midpoints, so that midpoint is translated to origin - // and add it in the end again - - var xr = (x - xMid) * cos(radian) - (y - yMid) * sin(radian) + xMid; - var yr = (x - xMid) * sin(radian) + (y - yMid) * cos(radian) + yMid; - return [xr, yr]; -} -/** - * Returns the new bounding area of a rotated rectangle. - */ - -function translateSize(width, height, rotation) { - var centerX = width / 2; - var centerY = height / 2; - var outerBounds = [rotateAroundMidPoint(0, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, height, centerX, centerY, rotation), rotateAroundMidPoint(0, height, centerX, centerY, rotation)]; - var minX = Math.min.apply(Math, outerBounds.map(function (p) { - return p[0]; - })); - var maxX = Math.max.apply(Math, outerBounds.map(function (p) { - return p[0]; - })); - var minY = Math.min.apply(Math, outerBounds.map(function (p) { - return p[1]; - })); - var maxY = Math.max.apply(Math, outerBounds.map(function (p) { - return p[1]; - })); - return { - width: maxX - minX, - height: maxY - minY - }; -} -/** - * Combine multiple class names into a single string. - */ - -function classNames() { - var args = []; - - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - - return args.filter(function (value) { - if (typeof value === 'string' && value.length > 0) { - return true; - } - - return false; - }).join(' ').trim(); -} - -var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n"; - -var MIN_ZOOM = 1; -var MAX_ZOOM = 3; - -var index_module_Cropper = -/** @class */ -function (_super) { - __extends(Cropper, _super); - - function Cropper() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.imageRef = null; - _this.videoRef = null; - _this.containerRef = null; - _this.styleRef = null; - _this.containerRect = null; - _this.mediaSize = { - width: 0, - height: 0, - naturalWidth: 0, - naturalHeight: 0 - }; - _this.dragStartPosition = { - x: 0, - y: 0 - }; - _this.dragStartCrop = { - x: 0, - y: 0 - }; - _this.lastPinchDistance = 0; - _this.lastPinchRotation = 0; - _this.rafDragTimeout = null; - _this.rafPinchTimeout = null; - _this.wheelTimer = null; - _this.state = { - cropSize: null, - hasWheelJustStarted: false - }; // this is to prevent Safari on iOS >= 10 to zoom the page - - _this.preventZoomSafari = function (e) { - return e.preventDefault(); - }; - - _this.cleanEvents = function () { - document.removeEventListener('mousemove', _this.onMouseMove); - document.removeEventListener('mouseup', _this.onDragStopped); - document.removeEventListener('touchmove', _this.onTouchMove); - document.removeEventListener('touchend', _this.onDragStopped); - }; - - _this.clearScrollEvent = function () { - if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel); - - if (_this.wheelTimer) { - clearTimeout(_this.wheelTimer); - } - }; - - _this.onMediaLoad = function () { - _this.computeSizes(); - - _this.emitCropData(); - - _this.setInitialCrop(); - - if (_this.props.onMediaLoaded) { - _this.props.onMediaLoaded(_this.mediaSize); - } - }; - - _this.setInitialCrop = function () { - var _a = _this.props, - initialCroppedAreaPixels = _a.initialCroppedAreaPixels, - cropSize = _a.cropSize; - - if (!initialCroppedAreaPixels) { - return; - } - - var _b = getInitialCropFromCroppedAreaPixels(initialCroppedAreaPixels, _this.mediaSize, cropSize), - crop = _b.crop, - zoom = _b.zoom; - - _this.props.onCropChange(crop); - - _this.props.onZoomChange && _this.props.onZoomChange(zoom); - }; - - _this.computeSizes = function () { - var _a, _b, _c, _d, _e, _f; - - var mediaRef = _this.imageRef || _this.videoRef; - - if (mediaRef && _this.containerRef) { - _this.containerRect = _this.containerRef.getBoundingClientRect(); - _this.mediaSize = { - width: mediaRef.offsetWidth, - height: mediaRef.offsetHeight, - naturalWidth: ((_a = _this.imageRef) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0, - naturalHeight: ((_c = _this.imageRef) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0 - }; - var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(mediaRef.offsetWidth, mediaRef.offsetHeight, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation); - - if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) { - _this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize); - } - - _this.setState({ - cropSize: cropSize - }, _this.recomputeCropPosition); - } - }; - - _this.onMouseDown = function (e) { - e.preventDefault(); - document.addEventListener('mousemove', _this.onMouseMove); - document.addEventListener('mouseup', _this.onDragStopped); - - _this.onDragStart(Cropper.getMousePoint(e)); - }; - - _this.onMouseMove = function (e) { - return _this.onDrag(Cropper.getMousePoint(e)); - }; - - _this.onTouchStart = function (e) { - document.addEventListener('touchmove', _this.onTouchMove, { - passive: false - }); // iOS 11 now defaults to passive: true - - document.addEventListener('touchend', _this.onDragStopped); - - if (e.touches.length === 2) { - _this.onPinchStart(e); - } else if (e.touches.length === 1) { - _this.onDragStart(Cropper.getTouchPoint(e.touches[0])); - } - }; - - _this.onTouchMove = function (e) { - // Prevent whole page from scrolling on iOS. - e.preventDefault(); - - if (e.touches.length === 2) { - _this.onPinchMove(e); - } else if (e.touches.length === 1) { - _this.onDrag(Cropper.getTouchPoint(e.touches[0])); - } - }; - - _this.onDragStart = function (_a) { - var _b, _c; - - var x = _a.x, - y = _a.y; - _this.dragStartPosition = { - x: x, - y: y - }; - _this.dragStartCrop = __assign({}, _this.props.crop); - (_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b); - }; - - _this.onDrag = function (_a) { - var x = _a.x, - y = _a.y; - if (_this.rafDragTimeout) window.cancelAnimationFrame(_this.rafDragTimeout); - _this.rafDragTimeout = window.requestAnimationFrame(function () { - if (!_this.state.cropSize) return; - if (x === undefined || y === undefined) return; - var offsetX = x - _this.dragStartPosition.x; - var offsetY = y - _this.dragStartPosition.y; - var requestedPosition = { - x: _this.dragStartCrop.x + offsetX, - y: _this.dragStartCrop.y + offsetY - }; - var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition; - - _this.props.onCropChange(newPosition); - }); - }; - - _this.onDragStopped = function () { - var _a, _b; - - _this.cleanEvents(); - - _this.emitCropData(); - - (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); - }; - - _this.onWheel = function (e) { - e.preventDefault(); - var point = Cropper.getMousePoint(e); - var pixelY = normalize_wheel_default()(e).pixelY; - var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200; - - _this.setNewZoom(newZoom, point); - - if (!_this.state.hasWheelJustStarted) { - _this.setState({ - hasWheelJustStarted: true - }, function () { - var _a, _b; - - return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a); - }); - } - - if (_this.wheelTimer) { - clearTimeout(_this.wheelTimer); - } - - _this.wheelTimer = window.setTimeout(function () { - return _this.setState({ - hasWheelJustStarted: false - }, function () { - var _a, _b; - - return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); - }); - }, 250); - }; - - _this.getPointOnContainer = function (_a) { - var x = _a.x, - y = _a.y; - - if (!_this.containerRect) { - throw new Error('The Cropper is not mounted'); - } - - return { - x: _this.containerRect.width / 2 - (x - _this.containerRect.left), - y: _this.containerRect.height / 2 - (y - _this.containerRect.top) - }; - }; - - _this.getPointOnMedia = function (_a) { - var x = _a.x, - y = _a.y; - var _b = _this.props, - crop = _b.crop, - zoom = _b.zoom; - return { - x: (x + crop.x) / zoom, - y: (y + crop.y) / zoom - }; - }; - - _this.setNewZoom = function (zoom, point) { - if (!_this.state.cropSize || !_this.props.onZoomChange) return; - - var zoomPoint = _this.getPointOnContainer(point); - - var zoomTarget = _this.getPointOnMedia(zoomPoint); - - var newZoom = Math.min(_this.props.maxZoom, Math.max(zoom, _this.props.minZoom)); - var requestedPosition = { - x: zoomTarget.x * newZoom - zoomPoint.x, - y: zoomTarget.y * newZoom - zoomPoint.y - }; - var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition; - - _this.props.onCropChange(newPosition); - - _this.props.onZoomChange(newZoom); - }; - - _this.getCropData = function () { - if (!_this.state.cropSize) { - return null; - } // this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ricardo-ch/react-easy-crop/issues/6) - - - var restrictedPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; - return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition); - }; - - _this.emitCropData = function () { - var cropData = _this.getCropData(); - - if (!cropData) return; - var croppedAreaPercentages = cropData.croppedAreaPercentages, - croppedAreaPixels = cropData.croppedAreaPixels; - - if (_this.props.onCropComplete) { - _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels); - } - - if (_this.props.onCropAreaChange) { - _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); - } - }; - - _this.emitCropAreaChange = function () { - var cropData = _this.getCropData(); - - if (!cropData) return; - var croppedAreaPercentages = cropData.croppedAreaPercentages, - croppedAreaPixels = cropData.croppedAreaPixels; - - if (_this.props.onCropAreaChange) { - _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); - } - }; - - _this.recomputeCropPosition = function () { - if (!_this.state.cropSize) return; - var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; - - _this.props.onCropChange(newPosition); - - _this.emitCropData(); - }; - - return _this; - } - - Cropper.prototype.componentDidMount = function () { - window.addEventListener('resize', this.computeSizes); - - if (this.containerRef) { - this.props.zoomWithScroll && this.containerRef.addEventListener('wheel', this.onWheel, { - passive: false - }); - this.containerRef.addEventListener('gesturestart', this.preventZoomSafari); - this.containerRef.addEventListener('gesturechange', this.preventZoomSafari); - } - - if (!this.props.disableAutomaticStylesInjection) { - this.styleRef = document.createElement('style'); - this.styleRef.setAttribute('type', 'text/css'); - this.styleRef.innerHTML = css_248z; - document.head.appendChild(this.styleRef); - } // when rendered via SSR, the image can already be loaded and its onLoad callback will never be called - - - if (this.imageRef && this.imageRef.complete) { - this.onMediaLoad(); - } - }; - - Cropper.prototype.componentWillUnmount = function () { - var _a; - - window.removeEventListener('resize', this.computeSizes); - - if (this.containerRef) { - this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari); - this.containerRef.removeEventListener('gesturechange', this.preventZoomSafari); - } - - if (this.styleRef) { - (_a = this.styleRef.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this.styleRef); - } - - this.cleanEvents(); - this.props.zoomWithScroll && this.clearScrollEvent(); - }; - - Cropper.prototype.componentDidUpdate = function (prevProps) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j; - - if (prevProps.rotation !== this.props.rotation) { - this.computeSizes(); - this.recomputeCropPosition(); - } else if (prevProps.aspect !== this.props.aspect) { - this.computeSizes(); - } else if (prevProps.zoom !== this.props.zoom) { - this.recomputeCropPosition(); - } else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) { - this.computeSizes(); - } else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) { - this.emitCropAreaChange(); - } - - if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) { - this.props.zoomWithScroll ? this.containerRef.addEventListener('wheel', this.onWheel, { - passive: false - }) : this.clearScrollEvent(); - } - - if (prevProps.video !== this.props.video) { - (_j = this.videoRef) === null || _j === void 0 ? void 0 : _j.load(); - } - }; - - Cropper.prototype.getAspect = function () { - var _a = this.props, - cropSize = _a.cropSize, - aspect = _a.aspect; - - if (cropSize) { - return cropSize.width / cropSize.height; - } - - return aspect; - }; - - Cropper.prototype.onPinchStart = function (e) { - var pointA = Cropper.getTouchPoint(e.touches[0]); - var pointB = Cropper.getTouchPoint(e.touches[1]); - this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB); - this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB); - this.onDragStart(getCenter(pointA, pointB)); - }; - - Cropper.prototype.onPinchMove = function (e) { - var _this = this; - - var pointA = Cropper.getTouchPoint(e.touches[0]); - var pointB = Cropper.getTouchPoint(e.touches[1]); - var center = getCenter(pointA, pointB); - this.onDrag(center); - if (this.rafPinchTimeout) window.cancelAnimationFrame(this.rafPinchTimeout); - this.rafPinchTimeout = window.requestAnimationFrame(function () { - var distance = getDistanceBetweenPoints(pointA, pointB); - var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance); - - _this.setNewZoom(newZoom, center); - - _this.lastPinchDistance = distance; - var rotation = getRotationBetweenPoints(pointA, pointB); - var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation); - _this.props.onRotationChange && _this.props.onRotationChange(newRotation); - _this.lastPinchRotation = rotation; - }); - }; - - Cropper.prototype.render = function () { - var _this = this; - - var _a = this.props, - image = _a.image, - video = _a.video, - mediaProps = _a.mediaProps, - transform = _a.transform, - _b = _a.crop, - x = _b.x, - y = _b.y, - rotation = _a.rotation, - zoom = _a.zoom, - cropShape = _a.cropShape, - showGrid = _a.showGrid, - _c = _a.style, - containerStyle = _c.containerStyle, - cropAreaStyle = _c.cropAreaStyle, - mediaStyle = _c.mediaStyle, - _d = _a.classes, - containerClassName = _d.containerClassName, - cropAreaClassName = _d.cropAreaClassName, - mediaClassName = _d.mediaClassName, - objectFit = _a.objectFit; - return /*#__PURE__*/external_React_default.a.createElement("div", { - onMouseDown: this.onMouseDown, - onTouchStart: this.onTouchStart, - ref: function ref(el) { - return _this.containerRef = el; - }, - "data-testid": "container", - style: containerStyle, - className: classNames('reactEasyCrop_Container', containerClassName) - }, image ? /*#__PURE__*/external_React_default.a.createElement("img", __assign({ - alt: "", - className: classNames('reactEasyCrop_Image', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName) - }, mediaProps, { - src: image, - ref: function ref(el) { - return _this.imageRef = el; - }, - style: __assign(__assign({}, mediaStyle), { - transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" - }), - onLoad: this.onMediaLoad - })) : video && /*#__PURE__*/external_React_default.a.createElement("video", __assign({ - autoPlay: true, - loop: true, - muted: true, - className: classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName) - }, mediaProps, { - ref: function ref(el) { - return _this.videoRef = el; - }, - onLoadedMetadata: this.onMediaLoad, - style: __assign(__assign({}, mediaStyle), { - transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" - }), - controls: false - }), (Array.isArray(video) ? video : [{ - src: video - }]).map(function (item) { - return /*#__PURE__*/external_React_default.a.createElement("source", __assign({ - key: item.src - }, item)); - })), this.state.cropSize && /*#__PURE__*/external_React_default.a.createElement("div", { - style: __assign(__assign({}, cropAreaStyle), { - width: this.state.cropSize.width, - height: this.state.cropSize.height - }), - "data-testid": "cropper", - className: classNames('reactEasyCrop_CropArea', cropShape === 'round' && 'reactEasyCrop_CropAreaRound', showGrid && 'reactEasyCrop_CropAreaGrid', cropAreaClassName) - })); - }; - - Cropper.defaultProps = { - zoom: 1, - rotation: 0, - aspect: 4 / 3, - maxZoom: MAX_ZOOM, - minZoom: MIN_ZOOM, - cropShape: 'rect', - objectFit: 'contain', - showGrid: true, - style: {}, - classes: {}, - mediaProps: {}, - zoomSpeed: 1, - restrictPosition: true, - zoomWithScroll: true - }; - - Cropper.getMousePoint = function (e) { - return { - x: Number(e.clientX), - y: Number(e.clientY) - }; - }; - - Cropper.getTouchPoint = function (touch) { - return { - x: Number(touch.clientX), - y: Number(touch.clientY) - }; - }; - - return Cropper; -}(external_React_default.a.Component); - -/* harmony default export */ var index_module = (index_module_Cropper); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/constants.js -const constants_MIN_ZOOM = 100; -const constants_MAX_ZOOM = 300; -const constants_POPOVER_PROPS = { - position: 'bottom right', - isAlternate: true -}; - -// EXTERNAL MODULE: external ["wp","apiFetch"] -var external_wp_apiFetch_ = __webpack_require__("ywyh"); -var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_); - -// EXTERNAL MODULE: external ["wp","notices"] -var external_wp_notices_ = __webpack_require__("onLe"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-save-image.js -/** - * WordPress dependencies - */ - - - - - -function useSaveImage(_ref) { - let { - crop, - rotation, - height, - width, - aspect, - url, - id, - onSaveImage, - onFinishEditing - } = _ref; - const { - createErrorNotice - } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]); - const [isInProgress, setIsInProgress] = Object(external_wp_element_["useState"])(false); - const cancel = Object(external_wp_element_["useCallback"])(() => { - setIsInProgress(false); - onFinishEditing(); - }, [setIsInProgress, onFinishEditing]); - const apply = Object(external_wp_element_["useCallback"])(() => { - setIsInProgress(true); - let attrs = {}; // The crop script may return some very small, sub-pixel values when the image was not cropped. - // Crop only when the new size has changed by more than 0.1%. - - if (crop.width < 99.9 || crop.height < 99.9) { - attrs = crop; - } - - if (rotation > 0) { - attrs.rotation = rotation; - } - - attrs.src = url; - external_wp_apiFetch_default()({ - path: `/wp/v2/media/${id}/edit`, - method: 'POST', - data: attrs - }).then(response => { - onSaveImage({ - id: response.id, - url: response.source_url, - height: height && width ? width / aspect : undefined - }); - }).catch(error => { - createErrorNotice(Object(external_wp_i18n_["sprintf"])( - /* translators: 1. Error message */ - Object(external_wp_i18n_["__"])('Could not edit image. %s'), error.message), { - id: 'image-editing-error', - type: 'snackbar' - }); - }).finally(() => { - setIsInProgress(false); - onFinishEditing(); - }); - }, [setIsInProgress, crop, rotation, height, width, aspect, url, onSaveImage, createErrorNotice, setIsInProgress, onFinishEditing]); - return Object(external_wp_element_["useMemo"])(() => ({ - isInProgress, - apply, - cancel - }), [isInProgress, apply, cancel]); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-transform-image.js -/** - * WordPress dependencies - */ - - - -function useTransformState(_ref) { - let { - url, - naturalWidth, - naturalHeight - } = _ref; - const [editedUrl, setEditedUrl] = Object(external_wp_element_["useState"])(); - const [crop, setCrop] = Object(external_wp_element_["useState"])(); - const [position, setPosition] = Object(external_wp_element_["useState"])({ - x: 0, - y: 0 - }); - const [zoom, setZoom] = Object(external_wp_element_["useState"])(); - const [rotation, setRotation] = Object(external_wp_element_["useState"])(); - const [aspect, setAspect] = Object(external_wp_element_["useState"])(); - const [defaultAspect, setDefaultAspect] = Object(external_wp_element_["useState"])(); - const initializeTransformValues = Object(external_wp_element_["useCallback"])(() => { - setPosition({ - x: 0, - y: 0 - }); - setZoom(100); - setRotation(0); - setAspect(naturalWidth / naturalHeight); - setDefaultAspect(naturalWidth / naturalHeight); - }, [naturalWidth, naturalHeight, setPosition, setZoom, setRotation, setAspect, setDefaultAspect]); - const rotateClockwise = Object(external_wp_element_["useCallback"])(() => { - const angle = (rotation + 90) % 360; - let naturalAspectRatio = naturalWidth / naturalHeight; - - if (rotation % 180 === 90) { - naturalAspectRatio = naturalHeight / naturalWidth; - } - - if (angle === 0) { - setEditedUrl(); - setRotation(angle); - setAspect(1 / aspect); - setPosition({ - x: -(position.y * naturalAspectRatio), - y: position.x * naturalAspectRatio - }); - return; - } - - function editImage(event) { - const canvas = document.createElement('canvas'); - let translateX = 0; - let translateY = 0; - - if (angle % 180) { - canvas.width = event.target.height; - canvas.height = event.target.width; - } else { - canvas.width = event.target.width; - canvas.height = event.target.height; - } - - if (angle === 90 || angle === 180) { - translateX = canvas.width; - } - - if (angle === 270 || angle === 180) { - translateY = canvas.height; - } - - const context = canvas.getContext('2d'); - context.translate(translateX, translateY); - context.rotate(angle * Math.PI / 180); - context.drawImage(event.target, 0, 0); - canvas.toBlob(blob => { - setEditedUrl(URL.createObjectURL(blob)); - setRotation(angle); - setAspect(1 / aspect); - setPosition({ - x: -(position.y * naturalAspectRatio), - y: position.x * naturalAspectRatio - }); - }); - } - - const el = new window.Image(); - el.src = url; - el.onload = editImage; - const imgCrossOrigin = Object(external_wp_hooks_["applyFilters"])('media.crossOrigin', undefined, url); - - if (typeof imgCrossOrigin === 'string') { - el.crossOrigin = imgCrossOrigin; - } - }, [rotation, naturalWidth, naturalHeight, setEditedUrl, setRotation, setAspect, setPosition]); - return Object(external_wp_element_["useMemo"])(() => ({ - editedUrl, - setEditedUrl, - crop, - setCrop, - position, - setPosition, - zoom, - setZoom, - rotation, - setRotation, - rotateClockwise, - aspect, - setAspect, - defaultAspect, - initializeTransformValues - }), [editedUrl, setEditedUrl, crop, setCrop, position, setPosition, zoom, setZoom, rotation, setRotation, rotateClockwise, aspect, setAspect, defaultAspect, initializeTransformValues]); -} - -function useTransformImage(imageProperties, isEditing) { - const transformState = useTransformState(imageProperties); - const { - initializeTransformValues - } = transformState; - Object(external_wp_element_["useEffect"])(() => { - if (isEditing) { - initializeTransformValues(); - } - }, [isEditing, initializeTransformValues]); - return transformState; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/context.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - -const ImageEditingContext = Object(external_wp_element_["createContext"])({}); -const useImageEditingContext = () => Object(external_wp_element_["useContext"])(ImageEditingContext); -function ImageEditingProvider(_ref) { - let { - id, - url, - naturalWidth, - naturalHeight, - isEditing, - onFinishEditing, - onSaveImage, - children - } = _ref; - const transformImage = useTransformImage({ - url, - naturalWidth, - naturalHeight - }, isEditing); - const saveImage = useSaveImage({ - id, - url, - onSaveImage, - onFinishEditing, - ...transformImage - }); - const providerValue = Object(external_wp_element_["useMemo"])(() => ({ ...transformImage, - ...saveImage - }), [transformImage, saveImage]); - return Object(external_wp_element_["createElement"])(ImageEditingContext.Provider, { - value: providerValue - }, children); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/cropper.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function ImageCropper(_ref) { - let { - url, - width, - height, - clientWidth, - naturalHeight, - naturalWidth - } = _ref; - const { - isInProgress, - editedUrl, - position, - zoom, - aspect, - setPosition, - setCrop, - setZoom, - rotation - } = useImageEditingContext(); - let editedHeight = height || clientWidth * naturalHeight / naturalWidth; - - if (rotation % 180 === 90) { - editedHeight = clientWidth * naturalWidth / naturalHeight; - } - - return Object(external_wp_element_["createElement"])("div", { - className: classnames_default()('wp-block-image__crop-area', { - 'is-applying': isInProgress - }), - style: { - width: width || clientWidth, - height: editedHeight - } - }, Object(external_wp_element_["createElement"])(index_module, { - image: editedUrl || url, - disabled: isInProgress, - minZoom: constants_MIN_ZOOM / 100, - maxZoom: constants_MAX_ZOOM / 100, - crop: position, - zoom: zoom / 100, - aspect: aspect, - onCropChange: setPosition, - onCropComplete: newCropPercent => { - setCrop(newCropPercent); - }, - onZoomChange: newZoom => { - setZoom(newZoom * 100); - } - }), isInProgress && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js -var search = __webpack_require__("cGtP"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/zoom-dropdown.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function ZoomDropdown() { - const { - isInProgress, - zoom, - setZoom - } = useImageEditingContext(); - return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { - contentClassName: "wp-block-image__zoom", - popoverProps: constants_POPOVER_PROPS, - renderToggle: _ref => { - let { - isOpen, - onToggle - } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - icon: search["a" /* default */], - label: Object(external_wp_i18n_["__"])('Zoom'), - onClick: onToggle, - "aria-expanded": isOpen, - disabled: isInProgress - }); - }, - renderContent: () => Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], { - label: Object(external_wp_i18n_["__"])('Zoom'), - min: constants_MIN_ZOOM, - max: constants_MAX_ZOOM, - value: Math.round(zoom), - onChange: setZoom - }) - }); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js -var check = __webpack_require__("RMJe"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/aspect-ratio.js - - -/** - * WordPress dependencies - */ - -const aspectRatio = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" -})); -/* harmony default export */ var aspect_ratio = (aspectRatio); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/aspect-ratio-dropdown.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function AspectGroup(_ref) { - let { - aspectRatios, - isDisabled, - label, - onClick, - value - } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { - label: label - }, aspectRatios.map(_ref2 => { - let { - title, - aspect - } = _ref2; - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - key: aspect, - disabled: isDisabled, - onClick: () => { - onClick(aspect); - }, - role: "menuitemradio", - isSelected: aspect === value, - icon: aspect === value ? check["a" /* default */] : undefined - }, title); - })); -} - -function AspectRatioDropdown(_ref3) { - let { - toggleProps - } = _ref3; - const { - isInProgress, - aspect, - setAspect, - defaultAspect - } = useImageEditingContext(); - return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { - icon: aspect_ratio, - label: Object(external_wp_i18n_["__"])('Aspect Ratio'), - popoverProps: constants_POPOVER_PROPS, - toggleProps: toggleProps, - className: "wp-block-image__aspect-ratio" - }, _ref4 => { - let { - onClose - } = _ref4; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(AspectGroup, { - isDisabled: isInProgress, - onClick: newAspect => { - setAspect(newAspect); - onClose(); - }, - value: aspect, - aspectRatios: [{ - title: Object(external_wp_i18n_["__"])('Original'), - aspect: defaultAspect - }, { - title: Object(external_wp_i18n_["__"])('Square'), - aspect: 1 - }] - }), Object(external_wp_element_["createElement"])(AspectGroup, { - label: Object(external_wp_i18n_["__"])('Landscape'), - isDisabled: isInProgress, - onClick: newAspect => { - setAspect(newAspect); - onClose(); - }, - value: aspect, - aspectRatios: [{ - title: Object(external_wp_i18n_["__"])('16:10'), - aspect: 16 / 10 - }, { - title: Object(external_wp_i18n_["__"])('16:9'), - aspect: 16 / 9 - }, { - title: Object(external_wp_i18n_["__"])('4:3'), - aspect: 4 / 3 - }, { - title: Object(external_wp_i18n_["__"])('3:2'), - aspect: 3 / 2 - }] - }), Object(external_wp_element_["createElement"])(AspectGroup, { - label: Object(external_wp_i18n_["__"])('Portrait'), - isDisabled: isInProgress, - onClick: newAspect => { - setAspect(newAspect); - onClose(); - }, - value: aspect, - aspectRatios: [{ - title: Object(external_wp_i18n_["__"])('10:16'), - aspect: 10 / 16 - }, { - title: Object(external_wp_i18n_["__"])('9:16'), - aspect: 9 / 16 - }, { - title: Object(external_wp_i18n_["__"])('3:4'), - aspect: 3 / 4 - }, { - title: Object(external_wp_i18n_["__"])('2:3'), - aspect: 2 / 3 - }] - })); - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rotate-right.js - - -/** - * WordPress dependencies - */ - -const rotateRight = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["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" -})); -/* harmony default export */ var rotate_right = (rotateRight); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/rotation-button.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function RotationButton() { - const { - isInProgress, - rotateClockwise - } = useImageEditingContext(); - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - icon: rotate_right, - label: Object(external_wp_i18n_["__"])('Rotate'), - onClick: rotateClockwise, - disabled: isInProgress - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/form-controls.js - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function FormControls() { - const { - isInProgress, - apply, - cancel - } = useImageEditingContext(); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - onClick: apply, - disabled: isInProgress - }, Object(external_wp_i18n_["__"])('Apply')), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - onClick: cancel - }, Object(external_wp_i18n_["__"])('Cancel'))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/index.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - - - - -function ImageEditor(_ref) { - let { - url, - width, - height, - clientWidth, - naturalHeight, - naturalWidth - } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(ImageCropper, { - url: url, - width: width, - height: height, - clientWidth: clientWidth, - naturalHeight: naturalHeight, - naturalWidth: naturalWidth - }), Object(external_wp_element_["createElement"])(block_controls["b" /* default */], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(ZoomDropdown, null), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], null, toggleProps => Object(external_wp_element_["createElement"])(AspectRatioDropdown, { - toggleProps: toggleProps - })), Object(external_wp_element_["createElement"])(RotationButton, null)), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(FormControls, null)))); -} - - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/use-dimension-handler.js -/** - * WordPress dependencies - */ - -function useDimensionHandler(customHeight, customWidth, defaultHeight, defaultWidth, onChange) { - var _ref, _ref2; - - const [currentWidth, setCurrentWidth] = Object(external_wp_element_["useState"])((_ref = customWidth !== null && customWidth !== void 0 ? customWidth : defaultWidth) !== null && _ref !== void 0 ? _ref : ''); - const [currentHeight, setCurrentHeight] = Object(external_wp_element_["useState"])((_ref2 = customHeight !== null && customHeight !== void 0 ? customHeight : defaultHeight) !== null && _ref2 !== void 0 ? _ref2 : ''); // When an image is first inserted, the default dimensions are initially - // undefined. This effect updates the dimensions when the default values - // come through. - - Object(external_wp_element_["useEffect"])(() => { - if (customWidth === undefined && defaultWidth !== undefined) { - setCurrentWidth(defaultWidth); - } - - if (customHeight === undefined && defaultHeight !== undefined) { - setCurrentHeight(defaultHeight); - } - }, [defaultWidth, defaultHeight]); // If custom values change, it means an outsider has resized the image using some other method (eg resize box) - // this keeps track of these values too. We need to parse before comparing; custom values can be strings. - - Object(external_wp_element_["useEffect"])(() => { - if (customWidth !== undefined && Number.parseInt(customWidth) !== Number.parseInt(currentWidth)) { - setCurrentWidth(customWidth); - } - - if (customHeight !== undefined && Number.parseInt(customHeight) !== Number.parseInt(currentHeight)) { - setCurrentHeight(customHeight); - } - }, [customWidth, customHeight]); - - const updateDimension = (dimension, value) => { - if (dimension === 'width') { - setCurrentWidth(value); - } else { - setCurrentHeight(value); - } - - onChange({ - [dimension]: value === '' ? undefined : parseInt(value, 10) - }); - }; - - const updateDimensions = (nextHeight, nextWidth) => { - setCurrentHeight(nextHeight !== null && nextHeight !== void 0 ? nextHeight : defaultHeight); - setCurrentWidth(nextWidth !== null && nextWidth !== void 0 ? nextWidth : defaultWidth); - onChange({ - height: nextHeight, - width: nextWidth - }); - }; - - return { - currentHeight, - currentWidth, - updateDimension, - updateDimensions - }; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -const IMAGE_SIZE_PRESETS = [25, 50, 75, 100]; -function ImageSizeControl(_ref) { - let { - imageWidth, - imageHeight, - imageSizeOptions = [], - isResizable = true, - slug, - width, - height, - onChange, - onChangeImage = external_lodash_["noop"] - } = _ref; - const { - currentHeight, - currentWidth, - updateDimension, - updateDimensions - } = useDimensionHandler(height, width, imageHeight, imageWidth, onChange); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !Object(external_lodash_["isEmpty"])(imageSizeOptions) && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["__"])('Image size'), - value: slug, - options: imageSizeOptions, - onChange: onChangeImage - }), isResizable && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-image-size-control" - }, Object(external_wp_element_["createElement"])("p", { - className: "block-editor-image-size-control__row" - }, Object(external_wp_i18n_["__"])('Image dimensions')), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-image-size-control__row" - }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - type: "number", - className: "block-editor-image-size-control__width", - label: Object(external_wp_i18n_["__"])('Width'), - value: currentWidth, - min: 1, - onChange: value => updateDimension('width', value) - }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - type: "number", - className: "block-editor-image-size-control__height", - label: Object(external_wp_i18n_["__"])('Height'), - value: currentHeight, - min: 1, - onChange: value => updateDimension('height', value) - })), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-image-size-control__row" - }, Object(external_wp_element_["createElement"])(external_wp_components_["ButtonGroup"], { - "aria-label": Object(external_wp_i18n_["__"])('Image size presets') - }, IMAGE_SIZE_PRESETS.map(scale => { - const scaledWidth = Math.round(imageWidth * (scale / 100)); - const scaledHeight = Math.round(imageHeight * (scale / 100)); - const isCurrent = currentWidth === scaledWidth && currentHeight === scaledHeight; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: scale, - isSmall: true, - variant: isCurrent ? 'primary' : undefined, - isPressed: isCurrent, - onClick: () => updateDimensions(scaledHeight, scaledWidth) - }, scale, "%"); - })), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - isSmall: true, - onClick: () => updateDimensions() - }, Object(external_wp_i18n_["__"])('Reset'))))); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js + 7 modules -var inner_blocks = __webpack_require__("p3NJ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/index.js -var inspector_controls = __webpack_require__("1oY3"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/index.js + 1 modules -var justify_content_control = __webpack_require__("0E5u"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js -var keyboard_return = __webpack_require__("btIw"); - -// EXTERNAL MODULE: external ["wp","dom"] -var external_wp_dom_ = __webpack_require__("1CF3"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/settings-drawer.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -const LinkControlSettingsDrawer = _ref => { - let { - value, - onChange = external_lodash_["noop"], - settings - } = _ref; - - if (!settings || !settings.length) { - return null; - } - - const handleSettingChange = setting => newValue => { - onChange({ ...value, - [setting.id]: newValue - }); - }; - - const theSettings = settings.map(setting => Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - className: "block-editor-link-control__setting", - key: setting.id, - label: setting.title, - onChange: handleSettingChange(setting), - checked: value ? !!value[setting.id] : false - })); - return Object(external_wp_element_["createElement"])("fieldset", { - className: "block-editor-link-control__settings" - }, Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { - as: "legend" - }, Object(external_wp_i18n_["__"])('Currently selected link settings')), theSettings); -}; - -/* harmony default export */ var settings_drawer = (LinkControlSettingsDrawer); - -// EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js -var lib = __webpack_require__("9Do8"); -var lib_default = /*#__PURE__*/__webpack_require__.n(lib); - -// EXTERNAL MODULE: external ["wp","url"] -var external_wp_url_ = __webpack_require__("Mmq9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-input/index.js - - - -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - -class url_input_URLInput extends external_wp_element_["Component"] { - constructor(props) { - super(props); - this.onChange = this.onChange.bind(this); - this.onFocus = this.onFocus.bind(this); - this.onKeyDown = this.onKeyDown.bind(this); - this.selectLink = this.selectLink.bind(this); - this.handleOnClick = this.handleOnClick.bind(this); - this.bindSuggestionNode = this.bindSuggestionNode.bind(this); - this.autocompleteRef = props.autocompleteRef || Object(external_wp_element_["createRef"])(); - this.inputRef = Object(external_wp_element_["createRef"])(); - this.updateSuggestions = Object(external_lodash_["debounce"])(this.updateSuggestions.bind(this), 200); - this.suggestionNodes = []; - this.isUpdatingSuggestions = false; - this.state = { - suggestions: [], - showSuggestions: false, - selectedSuggestion: null, - suggestionsListboxId: '', - suggestionOptionIdPrefix: '' - }; - } - - componentDidUpdate(prevProps) { - const { - showSuggestions, - selectedSuggestion - } = this.state; - const { - value, - __experimentalShowInitialSuggestions = false - } = this.props; // only have to worry about scrolling selected suggestion into view - // when already expanded - - if (showSuggestions && selectedSuggestion !== null && this.suggestionNodes[selectedSuggestion] && !this.scrollingIntoView) { - this.scrollingIntoView = true; - lib_default()(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, { - onlyScrollIfNeeded: true - }); - this.props.setTimeout(() => { - this.scrollingIntoView = false; - }, 100); - } // Update suggestions when the value changes - - - if (prevProps.value !== value && !this.props.disableSuggestions && !this.isUpdatingSuggestions) { - if (value !== null && value !== void 0 && value.length) { - // If the new value is not empty we need to update with suggestions for it - this.updateSuggestions(value); - } else if (__experimentalShowInitialSuggestions) { - // If the new value is empty and we can show initial suggestions, then show initial suggestions - this.updateSuggestions(); - } - } - } - - componentDidMount() { - if (this.shouldShowInitialSuggestions()) { - this.updateSuggestions(); - } - } - - componentWillUnmount() { - var _this$suggestionsRequ, _this$suggestionsRequ2; - - (_this$suggestionsRequ = this.suggestionsRequest) === null || _this$suggestionsRequ === void 0 ? void 0 : (_this$suggestionsRequ2 = _this$suggestionsRequ.cancel) === null || _this$suggestionsRequ2 === void 0 ? void 0 : _this$suggestionsRequ2.call(_this$suggestionsRequ); - delete this.suggestionsRequest; - } - - bindSuggestionNode(index) { - return ref => { - this.suggestionNodes[index] = ref; - }; - } - - shouldShowInitialSuggestions() { - const { - suggestions - } = this.state; - const { - __experimentalShowInitialSuggestions = false, - value - } = this.props; - return !this.isUpdatingSuggestions && __experimentalShowInitialSuggestions && !(value && value.length) && !(suggestions && suggestions.length); - } - - updateSuggestions() { - var _value; - - let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - const { - __experimentalFetchLinkSuggestions: fetchLinkSuggestions, - __experimentalHandleURLSuggestions: handleURLSuggestions - } = this.props; - - if (!fetchLinkSuggestions) { - return; - } // Initial suggestions may only show if there is no value - // (note: this includes whitespace). - - - const isInitialSuggestions = !((_value = value) !== null && _value !== void 0 && _value.length); // Trim only now we've determined whether or not it originally had a "length" - // (even if that value was all whitespace). - - value = value.trim(); // Allow a suggestions request if: - // - there are at least 2 characters in the search input (except manual searches where - // search input length is not required to trigger a fetch) - // - this is a direct entry (eg: a URL) - - if (!isInitialSuggestions && (value.length < 2 || !handleURLSuggestions && Object(external_wp_url_["isURL"])(value))) { - this.setState({ - showSuggestions: false, - selectedSuggestion: null, - loading: false - }); - return; - } - - this.isUpdatingSuggestions = true; - this.setState({ - selectedSuggestion: null, - loading: true - }); - const request = fetchLinkSuggestions(value, { - isInitialSuggestions - }); - request.then(suggestions => { - // A fetch Promise doesn't have an abort option. It's mimicked by - // comparing the request reference in on the instance, which is - // reset or deleted on subsequent requests or unmounting. - if (this.suggestionsRequest !== request) { - return; - } - - this.setState({ - suggestions, - loading: false, - showSuggestions: !!suggestions.length - }); - - if (!!suggestions.length) { - this.props.debouncedSpeak(Object(external_wp_i18n_["sprintf"])( - /* translators: %s: number of results. */ - Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', suggestions.length), suggestions.length), 'assertive'); - } else { - this.props.debouncedSpeak(Object(external_wp_i18n_["__"])('No results.'), 'assertive'); - } - - this.isUpdatingSuggestions = false; - }).catch(() => { - if (this.suggestionsRequest === request) { - this.setState({ - loading: false - }); - this.isUpdatingSuggestions = false; - } - }); // Note that this assignment is handled *before* the async search request - // as a Promise always resolves on the next tick of the event loop. - - this.suggestionsRequest = request; - } - - onChange(event) { - const inputValue = event.target.value; - this.props.onChange(inputValue); - - if (!this.props.disableSuggestions) { - this.updateSuggestions(inputValue); - } - } - - onFocus() { - const { - suggestions - } = this.state; - const { - disableSuggestions, - value - } = this.props; // When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value - // Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons) - - if (value && !disableSuggestions && !this.isUpdatingSuggestions && !(suggestions && suggestions.length)) { - // Ensure the suggestions are updated with the current input value - this.updateSuggestions(value); - } - } - - onKeyDown(event) { - const { - showSuggestions, - selectedSuggestion, - suggestions, - loading - } = this.state; // If the suggestions are not shown or loading, we shouldn't handle the arrow keys - // We shouldn't preventDefault to allow block arrow keys navigation - - if (!showSuggestions || !suggestions.length || loading) { - // In the Windows version of Firefox the up and down arrows don't move the caret - // within an input field like they do for Mac Firefox/Chrome/Safari. This causes - // a form of focus trapping that is disruptive to the user experience. This disruption - // only happens if the caret is not in the first or last position in the text input. - // See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747 - switch (event.keyCode) { - // When UP is pressed, if the caret is at the start of the text, move it to the 0 - // position. - case external_wp_keycodes_["UP"]: - { - if (0 !== event.target.selectionStart) { - event.preventDefault(); // Set the input caret to position 0 - - event.target.setSelectionRange(0, 0); - } - - break; - } - // When DOWN is pressed, if the caret is not at the end of the text, move it to the - // last position. - - case external_wp_keycodes_["DOWN"]: - { - if (this.props.value.length !== event.target.selectionStart) { - event.preventDefault(); // Set the input caret to the last position - - event.target.setSelectionRange(this.props.value.length, this.props.value.length); - } - - break; - } - // Submitting while loading should trigger onSubmit - - case external_wp_keycodes_["ENTER"]: - { - if (this.props.onSubmit) { - this.props.onSubmit(null, event); - } - - break; - } - } - - return; - } - - const suggestion = this.state.suggestions[this.state.selectedSuggestion]; - - switch (event.keyCode) { - case external_wp_keycodes_["UP"]: - { - event.preventDefault(); - const previousIndex = !selectedSuggestion ? suggestions.length - 1 : selectedSuggestion - 1; - this.setState({ - selectedSuggestion: previousIndex - }); - break; - } - - case external_wp_keycodes_["DOWN"]: - { - event.preventDefault(); - const nextIndex = selectedSuggestion === null || selectedSuggestion === suggestions.length - 1 ? 0 : selectedSuggestion + 1; - this.setState({ - selectedSuggestion: nextIndex - }); - break; - } - - case external_wp_keycodes_["TAB"]: - { - if (this.state.selectedSuggestion !== null) { - this.selectLink(suggestion); // Announce a link has been selected when tabbing away from the input field. - - this.props.speak(Object(external_wp_i18n_["__"])('Link selected.')); - } - - break; - } - - case external_wp_keycodes_["ENTER"]: - { - if (this.state.selectedSuggestion !== null) { - this.selectLink(suggestion); - - if (this.props.onSubmit) { - this.props.onSubmit(suggestion, event); - } - } else if (this.props.onSubmit) { - this.props.onSubmit(null, event); - } - - break; - } - } - } - - selectLink(suggestion) { - this.props.onChange(suggestion.url, suggestion); - this.setState({ - selectedSuggestion: null, - showSuggestions: false - }); - } - - handleOnClick(suggestion) { - this.selectLink(suggestion); // Move focus to the input field when a link suggestion is clicked. - - this.inputRef.current.focus(); - } - - static getDerivedStateFromProps(_ref, _ref2) { - let { - value, - instanceId, - disableSuggestions, - __experimentalShowInitialSuggestions = false - } = _ref; - let { - showSuggestions - } = _ref2; - let shouldShowSuggestions = showSuggestions; - const hasValue = value && value.length; - - if (!__experimentalShowInitialSuggestions && !hasValue) { - shouldShowSuggestions = false; - } - - if (disableSuggestions === true) { - shouldShowSuggestions = false; - } - - return { - showSuggestions: shouldShowSuggestions, - suggestionsListboxId: `block-editor-url-input-suggestions-${instanceId}`, - suggestionOptionIdPrefix: `block-editor-url-input-suggestion-${instanceId}` - }; - } - - render() { - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, this.renderControl(), this.renderSuggestions()); - } - - renderControl() { - const { - label, - className, - isFullWidth, - instanceId, - placeholder = Object(external_wp_i18n_["__"])('Paste URL or type to search'), - __experimentalRenderControl: renderControl, - value = '' - } = this.props; - const { - loading, - showSuggestions, - selectedSuggestion, - suggestionsListboxId, - suggestionOptionIdPrefix - } = this.state; - const controlProps = { - id: `url-input-control-${instanceId}`, - label, - className: classnames_default()('block-editor-url-input', className, { - 'is-full-width': isFullWidth - }) - }; - const inputProps = { - value, - required: true, - className: 'block-editor-url-input__input', - type: 'text', - onChange: this.onChange, - onFocus: this.onFocus, - placeholder, - onKeyDown: this.onKeyDown, - role: 'combobox', - 'aria-label': Object(external_wp_i18n_["__"])('URL'), - 'aria-expanded': showSuggestions, - 'aria-autocomplete': 'list', - 'aria-owns': suggestionsListboxId, - 'aria-activedescendant': selectedSuggestion !== null ? `${suggestionOptionIdPrefix}-${selectedSuggestion}` : undefined, - ref: this.inputRef - }; - - if (renderControl) { - return renderControl(controlProps, inputProps, loading); - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], controlProps, Object(external_wp_element_["createElement"])("input", inputProps), loading && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)); - } - - renderSuggestions() { - const { - className, - __experimentalRenderSuggestions: renderSuggestions, - value = '', - __experimentalShowInitialSuggestions = false - } = this.props; - const { - showSuggestions, - suggestions, - selectedSuggestion, - suggestionsListboxId, - suggestionOptionIdPrefix, - loading - } = this.state; - const suggestionsListProps = { - id: suggestionsListboxId, - ref: this.autocompleteRef, - role: 'listbox' - }; - - const buildSuggestionItemProps = (suggestion, index) => { - return { - role: 'option', - tabIndex: '-1', - id: `${suggestionOptionIdPrefix}-${index}`, - ref: this.bindSuggestionNode(index), - 'aria-selected': index === selectedSuggestion - }; - }; - - if (Object(external_lodash_["isFunction"])(renderSuggestions) && showSuggestions && !!suggestions.length) { - return renderSuggestions({ - suggestions, - selectedSuggestion, - suggestionsListProps, - buildSuggestionItemProps, - isLoading: loading, - handleSuggestionClick: this.handleOnClick, - isInitialSuggestions: __experimentalShowInitialSuggestions && !(value && value.length) - }); - } - - if (!Object(external_lodash_["isFunction"])(renderSuggestions) && showSuggestions && !!suggestions.length) { - return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { - position: "bottom", - noArrow: true, - focusOnMount: false - }, Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, suggestionsListProps, { - className: classnames_default()('block-editor-url-input__suggestions', `${className}__suggestions`) - }), suggestions.map((suggestion, index) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, buildSuggestionItemProps(suggestion, index), { - key: suggestion.id, - className: classnames_default()('block-editor-url-input__suggestion', { - 'is-selected': index === selectedSuggestion - }), - onClick: () => this.handleOnClick(suggestion) - }), suggestion.title)))); - } - - return null; - } - -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md - */ - - -/* harmony default export */ var url_input = (Object(external_wp_compose_["compose"])(external_wp_compose_["withSafeTimeout"], external_wp_components_["withSpokenMessages"], external_wp_compose_["withInstanceId"], Object(external_wp_data_["withSelect"])((select, props) => { - // If a link suggestions handler is already provided then - // bail - if (Object(external_lodash_["isFunction"])(props.__experimentalFetchLinkSuggestions)) { - return; - } - - const { - getSettings - } = select(store["a" /* store */]); - return { - __experimentalFetchLinkSuggestions: getSettings().__experimentalFetchLinkSuggestions - }; -}))(url_input_URLInput)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js -var plus = __webpack_require__("Q4Sy"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-create-button.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - -const LinkControlSearchCreate = _ref => { - let { - searchTerm, - onClick, - itemProps, - isSelected, - buttonText - } = _ref; - - if (!searchTerm) { - return null; - } - - let text; - - if (buttonText) { - text = Object(external_lodash_["isFunction"])(buttonText) ? buttonText(searchTerm) : buttonText; - } else { - text = Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["sprintf"])( - /* translators: %s: search term. */ - Object(external_wp_i18n_["__"])('Create: %s'), searchTerm), { - mark: Object(external_wp_element_["createElement"])("mark", null) - }); - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, itemProps, { - className: classnames_default()('block-editor-link-control__search-create block-editor-link-control__search-item', { - 'is-selected': isSelected - }), - onClick: onClick - }), Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - className: "block-editor-link-control__search-item-icon", - icon: plus["a" /* default */] - }), Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-header" - }, Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-title" - }, text))); -}; -/* harmony default export */ var search_create_button = (LinkControlSearchCreate); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/globe.js -var globe = __webpack_require__("K8zD"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-item.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -const LinkControlSearchItem = _ref => { - let { - itemProps, - suggestion, - isSelected = false, - onClick, - isURL = false, - searchTerm = '', - shouldShowType = false - } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, itemProps, { - onClick: onClick, - className: classnames_default()('block-editor-link-control__search-item', { - 'is-selected': isSelected, - 'is-url': isURL, - 'is-entity': !isURL - }) - }), isURL && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - className: "block-editor-link-control__search-item-icon", - icon: globe["a" /* default */] - }), Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-header" - }, Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-title" - }, Object(external_wp_element_["createElement"])(external_wp_components_["TextHighlight"], { - text: suggestion.title, - highlight: searchTerm - })), Object(external_wp_element_["createElement"])("span", { - "aria-hidden": !isURL, - className: "block-editor-link-control__search-item-info" - }, !isURL && (Object(external_wp_url_["filterURLForDisplay"])(Object(external_wp_url_["safeDecodeURI"])(suggestion.url)) || ''), isURL && Object(external_wp_i18n_["__"])('Press ENTER to add this link'))), shouldShowType && suggestion.type && Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-type" - }, suggestion.type === 'post_tag' ? 'tag' : suggestion.type)); -}; -/* harmony default export */ var search_item = (LinkControlSearchItem); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/constants.js -/** - * WordPress dependencies - */ - // Used as a unique identifier for the "Create" option within search results. -// Used to help distinguish the "Create" suggestion within the search results in -// order to handle it as a unique case. - -const CREATE_TYPE = '__CREATE__'; -const DEFAULT_LINK_SETTINGS = [{ - id: 'opensInNewTab', - title: Object(external_wp_i18n_["__"])('Open in new tab') -}]; - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-results.js - - -/** - * WordPress dependencies - */ - - -/** - * External dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function LinkControlSearchResults(_ref) { - let { - instanceId, - withCreateSuggestion, - currentInputValue, - handleSuggestionClick, - suggestionsListProps, - buildSuggestionItemProps, - suggestions, - selectedSuggestion, - isLoading, - isInitialSuggestions, - createSuggestionButtonText, - suggestionsQuery - } = _ref; - const resultsListClasses = classnames_default()('block-editor-link-control__search-results', { - 'is-loading': isLoading - }); - const directLinkEntryTypes = ['url', 'mailto', 'tel', 'internal']; - const isSingleDirectEntryResult = suggestions.length === 1 && directLinkEntryTypes.includes(suggestions[0].type.toLowerCase()); - const shouldShowCreateSuggestion = withCreateSuggestion && !isSingleDirectEntryResult && !isInitialSuggestions; // If the query has a specified type, then we can skip showing them in the result. See #24839. - - const shouldShowSuggestionsTypes = !(suggestionsQuery !== null && suggestionsQuery !== void 0 && suggestionsQuery.type); // According to guidelines aria-label should be added if the label - // itself is not visible. - // See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role - - const searchResultsLabelId = `block-editor-link-control-search-results-label-${instanceId}`; - const labelText = isInitialSuggestions ? Object(external_wp_i18n_["__"])('Recently updated') : Object(external_wp_i18n_["sprintf"])( - /* translators: %s: search term. */ - Object(external_wp_i18n_["__"])('Search results for "%s"'), currentInputValue); // VisuallyHidden rightly doesn't accept custom classNames - // so we conditionally render it as a wrapper to visually hide the label - // when that is required. - - const searchResultsLabel = Object(external_wp_element_["createElement"])(isInitialSuggestions ? external_wp_element_["Fragment"] : external_wp_components_["VisuallyHidden"], {}, // empty props - Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-results-label", - id: searchResultsLabelId - }, labelText)); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-link-control__search-results-wrapper" - }, searchResultsLabel, Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, suggestionsListProps, { - className: resultsListClasses, - "aria-labelledby": searchResultsLabelId - }), suggestions.map((suggestion, index) => { - if (shouldShowCreateSuggestion && CREATE_TYPE === suggestion.type) { - return Object(external_wp_element_["createElement"])(search_create_button, { - searchTerm: currentInputValue, - buttonText: createSuggestionButtonText, - onClick: () => handleSuggestionClick(suggestion) // Intentionally only using `type` here as - // the constant is enough to uniquely - // identify the single "CREATE" suggestion. - , - key: suggestion.type, - itemProps: buildSuggestionItemProps(suggestion, index), - isSelected: index === selectedSuggestion - }); - } // If we're not handling "Create" suggestions above then - // we don't want them in the main results so exit early - - - if (CREATE_TYPE === suggestion.type) { - return null; - } - - return Object(external_wp_element_["createElement"])(search_item, { - key: `${suggestion.id}-${suggestion.type}`, - itemProps: buildSuggestionItemProps(suggestion, index), - suggestion: suggestion, - index: index, - onClick: () => { - handleSuggestionClick(suggestion); - }, - isSelected: index === selectedSuggestion, - isURL: directLinkEntryTypes.includes(suggestion.type.toLowerCase()), - searchTerm: currentInputValue, - shouldShowType: shouldShowSuggestionsTypes - }); - }))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/is-url-like.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Determines whether a given value could be a URL. Note this does not - * guarantee the value is a URL only that it looks like it might be one. For - * example, just because a string has `www.` in it doesn't make it a URL, - * but it does make it highly likely that it will be so in the context of - * creating a link it makes sense to treat it like one. - * - * @param {string} val the candidate for being URL-like (or not). - * - * @return {boolean} whether or not the value is potentially a URL. - */ - -function isURLLike(val) { - const isInternal = Object(external_lodash_["startsWith"])(val, '#'); - return Object(external_wp_url_["isURL"])(val) || val && val.includes('www.') || isInternal; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-search-handler.js -/** - * WordPress dependencies - */ - - - -/** - * External dependencies - */ - - -/** - * Internal dependencies - */ - - - - -const handleNoop = () => Promise.resolve([]); -const handleDirectEntry = val => { - let type = 'URL'; - const protocol = Object(external_wp_url_["getProtocol"])(val) || ''; - - if (protocol.includes('mailto')) { - type = 'mailto'; - } - - if (protocol.includes('tel')) { - type = 'tel'; - } - - if (Object(external_lodash_["startsWith"])(val, '#')) { - type = 'internal'; - } - - return Promise.resolve([{ - id: val, - title: val, - url: type === 'URL' ? Object(external_wp_url_["prependHTTP"])(val) : val, - type - }]); -}; - -const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion) => { - const { - isInitialSuggestions - } = suggestionsQuery; - let results = await Promise.all([fetchSearchSuggestions(val, suggestionsQuery), directEntryHandler(val)]); - const couldBeURL = !val.includes(' '); // If it's potentially a URL search then concat on a URL search suggestion - // just for good measure. That way once the actual results run out we always - // have a URL option to fallback on. - - if (couldBeURL && withURLSuggestion && !isInitialSuggestions) { - results = results[0].concat(results[1]); - } else { - results = results[0]; - } // If displaying initial suggestions just return plain results. - - - if (isInitialSuggestions) { - return results; - } // Here we append a faux suggestion to represent a "CREATE" option. This - // is detected in the rendering of the search results and handled as a - // special case. This is currently necessary because the suggestions - // dropdown will only appear if there are valid suggestions and - // therefore unless the create option is a suggestion it will not - // display in scenarios where there are no results returned from the - // API. In addition promoting CREATE to a first class suggestion affords - // the a11y benefits afforded by `URLInput` to all suggestions (eg: - // keyboard handling, ARIA roles...etc). - // - // Note also that the value of the `title` and `url` properties must correspond - // to the text value of the ``. This is because `title` is used - // when creating the suggestion. Similarly `url` is used when using keyboard to select - // the suggestion (the

`onSubmit` handler falls-back to `url`). - - - return isURLLike(val) || !withCreateSuggestion ? results : results.concat({ - // the `id` prop is intentionally ommitted here because it - // is never exposed as part of the component's public API. - // see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316. - title: val, - // must match the existing ``s text value - url: val, - // must match the existing ``s text value - type: CREATE_TYPE - }); -}; - -function useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion, withURLSuggestion) { - const { - fetchSearchSuggestions - } = Object(external_wp_data_["useSelect"])(select => { - const { - getSettings - } = select(store["a" /* store */]); - return { - fetchSearchSuggestions: getSettings().__experimentalFetchLinkSuggestions - }; - }, []); - const directEntryHandler = allowDirectEntry ? handleDirectEntry : handleNoop; - return Object(external_wp_element_["useCallback"])((val, _ref) => { - let { - isInitialSuggestions - } = _ref; - return isURLLike(val) ? directEntryHandler(val, { - isInitialSuggestions - }) : handleEntitySearch(val, { ...suggestionsQuery, - isInitialSuggestions - }, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion); - }, [directEntryHandler, fetchSearchSuggestions, withCreateSuggestion]); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-input.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - // Must be a function as otherwise URLInput will default -// to the fetchLinkSuggestions passed in block editor settings -// which will cause an unintended http request. - -const noopSearchHandler = () => Promise.resolve([]); - -const LinkControlSearchInput = Object(external_wp_element_["forwardRef"])((_ref, ref) => { - let { - value, - children, - currentLink = {}, - className = null, - placeholder = null, - withCreateSuggestion = false, - onCreateSuggestion = external_lodash_["noop"], - onChange = external_lodash_["noop"], - onSelect = external_lodash_["noop"], - showSuggestions = true, - renderSuggestions = props => Object(external_wp_element_["createElement"])(LinkControlSearchResults, props), - fetchSuggestions = null, - allowDirectEntry = true, - showInitialSuggestions = false, - suggestionsQuery = {}, - withURLSuggestion = true, - createSuggestionButtonText, - useLabel = false - } = _ref; - const genericSearchHandler = useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion, withURLSuggestion); - const searchHandler = showSuggestions ? fetchSuggestions || genericSearchHandler : noopSearchHandler; - const instanceId = Object(external_wp_compose_["useInstanceId"])(LinkControlSearchInput); - const [focusedSuggestion, setFocusedSuggestion] = Object(external_wp_element_["useState"])(); - /** - * Handles the user moving between different suggestions. Does not handle - * choosing an individual item. - * - * @param {string} selection the url of the selected suggestion. - * @param {Object} suggestion the suggestion object. - */ - - const onInputChange = (selection, suggestion) => { - onChange(selection); - setFocusedSuggestion(suggestion); - }; - - const handleRenderSuggestions = props => renderSuggestions({ ...props, - instanceId, - withCreateSuggestion, - currentInputValue: value, - createSuggestionButtonText, - suggestionsQuery, - handleSuggestionClick: suggestion => { - if (props.handleSuggestionClick) { - props.handleSuggestionClick(suggestion); - } - - onSuggestionSelected(suggestion); - } - }); - - const onSuggestionSelected = async selectedSuggestion => { - let suggestion = selectedSuggestion; - - if (CREATE_TYPE === selectedSuggestion.type) { - // Create a new page and call onSelect with the output from the onCreateSuggestion callback - try { - var _suggestion; - - suggestion = await onCreateSuggestion(selectedSuggestion.title); - - if ((_suggestion = suggestion) !== null && _suggestion !== void 0 && _suggestion.url) { - onSelect(suggestion); - } - } catch (e) {} - - return; - } - - if (allowDirectEntry || suggestion && Object.keys(suggestion).length >= 1) { - onSelect( // Some direct entries don't have types or IDs, and we still need to clear the previous ones. - { ...Object(external_lodash_["omit"])(currentLink, 'id', 'url'), - ...suggestion - }, suggestion); - } - }; - - const inputClasses = classnames_default()(className, { - 'has-no-label': !useLabel - }); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-link-control__search-input-container" - }, Object(external_wp_element_["createElement"])(url_input, { - label: useLabel ? 'URL' : undefined, - className: inputClasses, - value: value, - onChange: onInputChange, - placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : Object(external_wp_i18n_["__"])('Search or type url'), - __experimentalRenderSuggestions: showSuggestions ? handleRenderSuggestions : null, - __experimentalFetchLinkSuggestions: searchHandler, - __experimentalHandleURLSuggestions: true, - __experimentalShowInitialSuggestions: showInitialSuggestions, - onSubmit: (suggestion, event) => { - var _value$trim; - - const hasSuggestion = suggestion || focusedSuggestion; // If there is no suggestion and the value (ie: any manually entered URL) is empty - // then don't allow submission otherwise we get empty links. - - if (!hasSuggestion && !(value !== null && value !== void 0 && (_value$trim = value.trim()) !== null && _value$trim !== void 0 && _value$trim.length)) { - event.preventDefault(); - } else { - onSuggestionSelected(hasSuggestion || { - url: value - }); - } - }, - ref: ref - }), children); -}); -/* harmony default export */ var search_input = (LinkControlSearchInput); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/info.js -var info = __webpack_require__("FnAh"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js + 1 modules -var edit = __webpack_require__("B9Az"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js -var link_off = __webpack_require__("Mp0b"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/viewer-slot.js -/** - * WordPress dependencies - */ - -const { - Slot: ViewerSlot, - Fill: ViewerFill -} = Object(external_wp_components_["createSlotFill"])('BlockEditorLinkControlViewer'); - -/* harmony default export */ var viewer_slot = (ViewerSlot); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-rich-url-data.js -/** - * Internal dependencies - */ - -/** - * WordPress dependencies - */ - - - - -function reducer(state, action) { - switch (action.type) { - case 'RESOLVED': - return { ...state, - isFetching: false, - richData: action.richData - }; - - case 'ERROR': - return { ...state, - isFetching: false, - richData: null - }; - - case 'LOADING': - return { ...state, - isFetching: true - }; - - default: - throw new Error(`Unexpected action type ${action.type}`); - } -} - -function useRemoteUrlData(url) { - const [state, dispatch] = Object(external_wp_element_["useReducer"])(reducer, { - richData: null, - isFetching: false - }); - const { - fetchRichUrlData - } = Object(external_wp_data_["useSelect"])(select => { - const { - getSettings - } = select(store["a" /* store */]); - return { - fetchRichUrlData: getSettings().__experimentalFetchRichUrlData - }; - }, []); - Object(external_wp_element_["useEffect"])(() => { - // Only make the request if we have an actual URL - // and the fetching util is available. In some editors - // there may not be such a util. - if (url !== null && url !== void 0 && url.length && fetchRichUrlData && typeof AbortController !== 'undefined') { - dispatch({ - type: 'LOADING' - }); - const controller = new window.AbortController(); - const signal = controller.signal; - fetchRichUrlData(url, { - signal - }).then(urlData => { - dispatch({ - type: 'RESOLVED', - richData: urlData - }); - }).catch(() => { - // Avoid setting state on unmounted component - if (!signal.aborted) { - dispatch({ - type: 'ERROR' - }); - } - }); // Cleanup: when the URL changes the abort the current request - - return () => { - controller.abort(); - }; - } - }, [url]); - return state; -} - -/* harmony default export */ var use_rich_url_data = (useRemoteUrlData); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/link-preview.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -function LinkPreview(_ref) { - var _value$url; - - let { - value, - onEditClick, - hasRichPreviews = false, - hasUnlinkControl = false, - onRemove - } = _ref; - // Avoid fetching if rich previews are not desired. - const showRichPreviews = hasRichPreviews ? value === null || value === void 0 ? void 0 : value.url : null; - const { - richData, - isFetching - } = use_rich_url_data(showRichPreviews); // Rich data may be an empty object so test for that. - - const hasRichData = richData && Object.keys(richData).length; - const displayURL = value && Object(external_wp_url_["filterURLForDisplay"])(Object(external_wp_url_["safeDecodeURI"])(value.url), 16) || ''; - const displayTitle = (richData === null || richData === void 0 ? void 0 : richData.title) || (value === null || value === void 0 ? void 0 : value.title) || displayURL; // url can be undefined if the href attribute is unset - - const isEmptyURL = !(value !== null && value !== void 0 && (_value$url = value.url) !== null && _value$url !== void 0 && _value$url.length); - let icon; - - if (richData !== null && richData !== void 0 && richData.icon) { - icon = Object(external_wp_element_["createElement"])("img", { - src: richData === null || richData === void 0 ? void 0 : richData.icon, - alt: "" - }); - } else if (isEmptyURL) { - icon = Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: info["a" /* default */], - size: 32 - }); - } else { - icon = Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: globe["a" /* default */] - }); - } - - return Object(external_wp_element_["createElement"])("div", { - "aria-label": Object(external_wp_i18n_["__"])('Currently selected'), - "aria-selected": "true", - className: classnames_default()('block-editor-link-control__search-item', { - 'is-current': true, - 'is-rich': hasRichData, - 'is-fetching': !!isFetching, - 'is-preview': true, - 'is-error': isEmptyURL - }) - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-link-control__search-item-top" - }, Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-header" - }, Object(external_wp_element_["createElement"])("span", { - className: classnames_default()('block-editor-link-control__search-item-icon', { - 'is-image': richData === null || richData === void 0 ? void 0 : richData.icon - }) - }, icon), Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-details" - }, !isEmptyURL ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { - className: "block-editor-link-control__search-item-title", - href: value.url - }, Object(external_wp_dom_["__unstableStripHTML"])(displayTitle)), (value === null || value === void 0 ? void 0 : value.url) && Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-info" - }, displayURL)) : Object(external_wp_element_["createElement"])("span", { - className: "block-editor-link-control__search-item-error-notice" - }, "Link is empty"))), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: edit["a" /* default */], - label: Object(external_wp_i18n_["__"])('Edit'), - className: "block-editor-link-control__search-item-action", - onClick: onEditClick, - iconSize: 24 - }), hasUnlinkControl && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: link_off["a" /* default */], - label: Object(external_wp_i18n_["__"])('Unlink'), - className: "block-editor-link-control__search-item-action block-editor-link-control__unlink", - onClick: onRemove, - iconSize: 24 - }), Object(external_wp_element_["createElement"])(ViewerSlot, { - fillProps: value - })), (hasRichData && ((richData === null || richData === void 0 ? void 0 : richData.image) || (richData === null || richData === void 0 ? void 0 : richData.description)) || isFetching) && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-link-control__search-item-bottom" - }, ((richData === null || richData === void 0 ? void 0 : richData.image) || isFetching) && Object(external_wp_element_["createElement"])("div", { - "aria-hidden": !(richData !== null && richData !== void 0 && richData.image), - className: classnames_default()('block-editor-link-control__search-item-image', { - 'is-placeholder': !(richData !== null && richData !== void 0 && richData.image) - }) - }, (richData === null || richData === void 0 ? void 0 : richData.image) && Object(external_wp_element_["createElement"])("img", { - src: richData === null || richData === void 0 ? void 0 : richData.image, - alt: "" - })), ((richData === null || richData === void 0 ? void 0 : richData.description) || isFetching) && Object(external_wp_element_["createElement"])("div", { - "aria-hidden": !(richData !== null && richData !== void 0 && richData.description), - className: classnames_default()('block-editor-link-control__search-item-description', { - 'is-placeholder': !(richData !== null && richData !== void 0 && richData.description) - }) - }, (richData === null || richData === void 0 ? void 0 : richData.description) && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalText"], { - truncate: true, - numberOfLines: "2" - }, richData.description)))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-create-page.js -/** - * WordPress dependencies - */ - - -function useCreatePage(handleCreatePage) { - const cancelableCreateSuggestion = Object(external_wp_element_["useRef"])(); - const [isCreatingPage, setIsCreatingPage] = Object(external_wp_element_["useState"])(false); - const [errorMessage, setErrorMessage] = Object(external_wp_element_["useState"])(null); - - const createPage = async function (suggestionTitle) { - setIsCreatingPage(true); - setErrorMessage(null); - - try { - // Make cancellable in order that we can avoid setting State - // if the component unmounts during the call to `createSuggestion` - cancelableCreateSuggestion.current = makeCancelable( // Using Promise.resolve to allow createSuggestion to return a - // non-Promise based value. - Promise.resolve(handleCreatePage(suggestionTitle))); - return await cancelableCreateSuggestion.current.promise; - } catch (error) { - if (error && error.isCanceled) { - return; // bail if canceled to avoid setting state - } - - setErrorMessage(error.message || Object(external_wp_i18n_["__"])('An unknown error occurred during creation. Please try again.')); - throw error; - } finally { - setIsCreatingPage(false); - } - }; - /** - * Handles cancelling any pending Promises that have been made cancelable. - */ - - - Object(external_wp_element_["useEffect"])(() => { - return () => { - // componentDidUnmount - if (cancelableCreateSuggestion.current) { - cancelableCreateSuggestion.current.cancel(); - } - }; - }, []); - return { - createPage, - isCreatingPage, - errorMessage - }; -} -/** - * Creates a wrapper around a promise which allows it to be programmatically - * cancelled. - * See: https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html - * - * @param {Promise} promise the Promise to make cancelable - */ - -const makeCancelable = promise => { - let hasCanceled_ = false; - const wrappedPromise = new Promise((resolve, reject) => { - promise.then(val => hasCanceled_ ? reject({ - isCanceled: true - }) : resolve(val), error => hasCanceled_ ? reject({ - isCanceled: true - }) : reject(error)); - }); - return { - promise: wrappedPromise, - - cancel() { - hasCanceled_ = true; - } - - }; -}; - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/index.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - - - -/** - * Default properties associated with a link control value. - * - * @typedef WPLinkControlDefaultValue - * - * @property {string} url Link URL. - * @property {string=} title Link title. - * @property {boolean=} opensInNewTab Whether link should open in a new browser - * tab. This value is only assigned if not - * providing a custom `settings` prop. - */ - -/* eslint-disable jsdoc/valid-types */ - -/** - * Custom settings values associated with a link. - * - * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue - */ - -/* eslint-enable */ - -/** - * Custom settings values associated with a link. - * - * @typedef WPLinkControlSetting - * - * @property {string} id Identifier to use as property for setting value. - * @property {string} title Human-readable label to show in user interface. - */ - -/** - * Properties associated with a link control value, composed as a union of the - * default properties and any custom settings values. - * - * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue - */ - -/** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */ - -/** - * Properties associated with a search suggestion used within the LinkControl. - * - * @typedef WPLinkControlSuggestion - * - * @property {string} id Identifier to use to uniquely identify the suggestion. - * @property {string} type Identifies the type of the suggestion (eg: `post`, - * `page`, `url`...etc) - * @property {string} title Human-readable label to show in user interface. - * @property {string} url A URL for the suggestion. - */ - -/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */ - -/** - * @typedef WPLinkControlProps - * - * @property {(WPLinkControlSetting[])=} settings An array of settings objects. Each object will used to - * render a `ToggleControl` for that setting. - * @property {boolean=} forceIsEditingLink If passed as either `true` or `false`, controls the - * internal editing state of the component to respective - * show or not show the URL input field. - * @property {WPLinkControlValue=} value Current link value. - * @property {WPLinkControlOnChangeProp=} onChange Value change handler, called with the updated value if - * the user selects a new link or updates settings. - * @property {boolean=} noDirectEntry Whether to allow turning a URL-like search query directly into a link. - * @property {boolean=} showSuggestions Whether to present suggestions when typing the URL. - * @property {boolean=} showInitialSuggestions Whether to present initial suggestions immediately. - * @property {boolean=} withCreateSuggestion Whether to allow creation of link value from suggestion. - * @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions. - * @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL. - * @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion. - * @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component. - */ - -/** - * Renders a link control. A link control is a controlled input which maintains - * a value associated with a link (HTML anchor element) and relevant settings - * for how that link is expected to behave. - * - * @param {WPLinkControlProps} props Component props. - */ - -function LinkControl(_ref) { - var _currentInputValue$tr, _value$url, _value$url$trim; - - let { - searchInputPlaceholder, - value, - settings = DEFAULT_LINK_SETTINGS, - onChange = external_lodash_["noop"], - onRemove, - noDirectEntry = false, - showSuggestions = true, - showInitialSuggestions, - forceIsEditingLink, - createSuggestion, - withCreateSuggestion, - inputValue: propInputValue = '', - suggestionsQuery = {}, - noURLSuggestion = false, - createSuggestionButtonText, - hasRichPreviews = false, - hasTextControl = false, - renderControlBottom = null - } = _ref; - - if (withCreateSuggestion === undefined && createSuggestion) { - withCreateSuggestion = true; - } - - const isMounting = Object(external_wp_element_["useRef"])(true); - const wrapperNode = Object(external_wp_element_["useRef"])(); - const textInputRef = Object(external_wp_element_["useRef"])(); - const [internalInputValue, setInternalInputValue] = Object(external_wp_element_["useState"])((value === null || value === void 0 ? void 0 : value.url) || ''); - const [internalTextValue, setInternalTextValue] = Object(external_wp_element_["useState"])((value === null || value === void 0 ? void 0 : value.title) || ''); - const currentInputValue = propInputValue || internalInputValue; - const [isEditingLink, setIsEditingLink] = Object(external_wp_element_["useState"])(forceIsEditingLink !== undefined ? forceIsEditingLink : !value || !value.url); - const isEndingEditWithFocus = Object(external_wp_element_["useRef"])(false); - const currentInputIsEmpty = !(currentInputValue !== null && currentInputValue !== void 0 && (_currentInputValue$tr = currentInputValue.trim()) !== null && _currentInputValue$tr !== void 0 && _currentInputValue$tr.length); - Object(external_wp_element_["useEffect"])(() => { - if (forceIsEditingLink !== undefined && forceIsEditingLink !== isEditingLink) { - setIsEditingLink(forceIsEditingLink); - } - }, [forceIsEditingLink]); - Object(external_wp_element_["useEffect"])(() => { - // We don't auto focus into the Link UI on mount - // because otherwise using the keyboard to select text - // *within* the link format is not possible. - if (isMounting.current) { - isMounting.current = false; - return; - } // Unless we are mounting, we always want to focus either: - // - the URL input - // - the first focusable element in the Link UI. - // But in editing mode if there is a text input present then - // the URL input is at index 1. If not then it is at index 0. - - - const whichFocusTargetIndex = textInputRef !== null && textInputRef !== void 0 && textInputRef.current ? 1 : 0; // Scenario - when: - // - switching between editable and non editable LinkControl - // - clicking on a link - // ...then move focus to the *first* element to avoid focus loss - // and to ensure focus is *within* the Link UI. - - const nextFocusTarget = external_wp_dom_["focus"].focusable.find(wrapperNode.current)[whichFocusTargetIndex] || wrapperNode.current; - nextFocusTarget.focus(); - isEndingEditWithFocus.current = false; - }, [isEditingLink]); - Object(external_wp_element_["useEffect"])(() => { - /** - * If the value's `text` property changes then sync this - * back up with state. - */ - if (value !== null && value !== void 0 && value.title && value.title !== internalTextValue) { - setInternalTextValue(value.title); - } - /** - * Update the state value internalInputValue if the url value changes - * for example when clicking on another anchor - */ - - - if (value !== null && value !== void 0 && value.url) { - setInternalInputValue(value.url); - } - }, [value]); - /** - * Cancels editing state and marks that focus may need to be restored after - * the next render, if focus was within the wrapper when editing finished. - */ - - function stopEditing() { - var _wrapperNode$current; - - isEndingEditWithFocus.current = !!((_wrapperNode$current = wrapperNode.current) !== null && _wrapperNode$current !== void 0 && _wrapperNode$current.contains(wrapperNode.current.ownerDocument.activeElement)); - setIsEditingLink(false); - } - - const { - createPage, - isCreatingPage, - errorMessage - } = useCreatePage(createSuggestion); - - const handleSelectSuggestion = updatedValue => { - onChange({ ...updatedValue, - title: internalTextValue || (updatedValue === null || updatedValue === void 0 ? void 0 : updatedValue.title) - }); - stopEditing(); - }; - - const handleSubmit = () => { - if (currentInputValue !== (value === null || value === void 0 ? void 0 : value.url) || internalTextValue !== (value === null || value === void 0 ? void 0 : value.title)) { - onChange({ - url: currentInputValue, - title: internalTextValue - }); - } - - stopEditing(); - }; - - const handleSubmitWithEnter = event => { - const { - keyCode - } = event; - - if (keyCode === external_wp_keycodes_["ENTER"] && !currentInputIsEmpty // disallow submitting empty values. - ) { - event.preventDefault(); - handleSubmit(); - } - }; - - const shownUnlinkControl = onRemove && value && !isEditingLink && !isCreatingPage; - const showSettingsDrawer = !!(settings !== null && settings !== void 0 && settings.length); // Only show text control once a URL value has been committed - // and it isn't just empty whitespace. - // See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927. - - const showTextControl = (value === null || value === void 0 ? void 0 : (_value$url = value.url) === null || _value$url === void 0 ? void 0 : (_value$url$trim = _value$url.trim()) === null || _value$url$trim === void 0 ? void 0 : _value$url$trim.length) > 0 && hasTextControl; - return Object(external_wp_element_["createElement"])("div", { - tabIndex: -1, - ref: wrapperNode, - className: "block-editor-link-control" - }, isCreatingPage && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-link-control__loading" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), " ", Object(external_wp_i18n_["__"])('Creating'), "\u2026"), (isEditingLink || !value) && !isCreatingPage && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { - className: classnames_default()({ - 'block-editor-link-control__search-input-wrapper': true, - 'has-text-control': showTextControl - }) - }, showTextControl && Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - ref: textInputRef, - className: "block-editor-link-control__field block-editor-link-control__text-content", - label: "Text", - value: internalTextValue, - onChange: setInternalTextValue, - onKeyDown: handleSubmitWithEnter - }), Object(external_wp_element_["createElement"])(search_input, { - currentLink: value, - className: "block-editor-link-control__field block-editor-link-control__search-input", - placeholder: searchInputPlaceholder, - value: currentInputValue, - withCreateSuggestion: withCreateSuggestion, - onCreateSuggestion: createPage, - onChange: setInternalInputValue, - onSelect: handleSelectSuggestion, - showInitialSuggestions: showInitialSuggestions, - allowDirectEntry: !noDirectEntry, - showSuggestions: showSuggestions, - suggestionsQuery: suggestionsQuery, - withURLSuggestion: !noURLSuggestion, - createSuggestionButtonText: createSuggestionButtonText, - useLabel: showTextControl - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-link-control__search-actions" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - onClick: handleSubmit, - label: Object(external_wp_i18n_["__"])('Submit'), - icon: keyboard_return["a" /* default */], - className: "block-editor-link-control__search-submit", - disabled: currentInputIsEmpty // disallow submitting empty values. - - })))), errorMessage && Object(external_wp_element_["createElement"])(external_wp_components_["Notice"], { - className: "block-editor-link-control__search-error", - status: "error", - isDismissible: false - }, errorMessage)), value && !isEditingLink && !isCreatingPage && Object(external_wp_element_["createElement"])(LinkPreview, { - key: value === null || value === void 0 ? void 0 : value.url // force remount when URL changes to avoid race conditions for rich previews - , - value: value, - onEditClick: () => setIsEditingLink(true), - hasRichPreviews: hasRichPreviews, - hasUnlinkControl: shownUnlinkControl, - onRemove: onRemove - }), showSettingsDrawer && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-link-control__tools" - }, Object(external_wp_element_["createElement"])(settings_drawer, { - value: value, - settings: settings, - onChange: onChange - })), renderControlBottom && renderControlBottom()); -} - -LinkControl.ViewerFill = ViewerFill; -/* harmony default export */ var link_control = (LinkControl); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js + 1 modules -var line_height_control = __webpack_require__("weEX"); - -// EXTERNAL MODULE: external ["wp","a11y"] -var external_wp_a11y_ = __webpack_require__("gdqT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js -var library_media = __webpack_require__("rH4q"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js -var upload = __webpack_require__("NTP4"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-upload/index.js -/** - * WordPress dependencies - */ - -/** - * This is a placeholder for the media upload component necessary to make it possible to provide - * an integration with the core blocks that handle media files. By default it renders nothing but - * it provides a way to have it overridden with the `editor.MediaUpload` filter. - * - * @return {WPComponent} The component to be rendered. - */ - -const MediaUpload = () => null; -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md - */ - - -/* harmony default export */ var media_upload = (Object(external_wp_components_["withFilters"])('editor.MediaUpload')(MediaUpload)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-upload/check.js -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -function MediaUploadCheck(_ref) { - let { - fallback = null, - children - } = _ref; - const hasUploadPermissions = Object(external_wp_data_["useSelect"])(select => { - const { - getSettings - } = select(store["a" /* store */]); - return !!getSettings().mediaUpload; - }, []); - return hasUploadPermissions ? children : fallback; -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md - */ - -/* harmony default export */ var media_upload_check = (MediaUploadCheck); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-replace-flow/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - -const MediaReplaceFlow = _ref => { - let { - mediaURL, - mediaId, - allowedTypes, - accept, - onSelect, - onSelectURL, - onFilesUpload = external_lodash_["noop"], - name = Object(external_wp_i18n_["__"])('Replace'), - createNotice, - removeNotice, - children - } = _ref; - const [mediaURLValue, setMediaURLValue] = Object(external_wp_element_["useState"])(mediaURL); - const mediaUpload = Object(external_wp_data_["useSelect"])(select => { - return select(store["a" /* store */]).getSettings().mediaUpload; - }, []); - const editMediaButtonRef = Object(external_wp_element_["createRef"])(); - const errorNoticeID = Object(external_lodash_["uniqueId"])('block-editor/media-replace-flow/error-notice/'); - - const onError = message => { - const errorElement = document.createElement('div'); - errorElement.innerHTML = Object(external_wp_element_["renderToString"])(message); // The default error contains some HTML that, - // for example, makes the filename bold. - // The notice, by default, accepts strings only and so - // we need to remove the html from the error. - - const renderMsg = errorElement.textContent || errorElement.innerText || ''; // We need to set a timeout for showing the notice - // so that VoiceOver and possibly other screen readers - // can announce the error afer the toolbar button - // regains focus once the upload dialog closes. - // Otherwise VO simply skips over the notice and announces - // the focused element and the open menu. - - setTimeout(() => { - createNotice('error', renderMsg, { - speak: true, - id: errorNoticeID, - isDismissible: true - }); - }, 1000); - }; - - const selectMedia = media => { - setMediaURLValue(media.url); // Calling `onSelect` after the state update since it might unmount the component. - - onSelect(media); - Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('The media file has been replaced')); - removeNotice(errorNoticeID); - }; - - const selectURL = newURL => { - onSelectURL(newURL); - }; - - const uploadFiles = event => { - const files = event.target.files; - onFilesUpload(files); - - const setMedia = _ref2 => { - let [media] = _ref2; - selectMedia(media); - }; - - mediaUpload({ - allowedTypes, - filesList: files, - onFileChange: setMedia, - onError - }); - }; - - const openOnArrowDown = event => { - if (event.keyCode === external_wp_keycodes_["DOWN"]) { - event.preventDefault(); - event.target.click(); - } - }; - - const POPOVER_PROPS = { - isAlternate: true - }; - return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { - popoverProps: POPOVER_PROPS, - contentClassName: "block-editor-media-replace-flow__options", - renderToggle: _ref3 => { - let { - isOpen, - onToggle - } = _ref3; - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - ref: editMediaButtonRef, - "aria-expanded": isOpen, - "aria-haspopup": "true", - onClick: onToggle, - onKeyDown: openOnArrowDown - }, name); - }, - renderContent: _ref4 => { - let { - onClose - } = _ref4; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["NavigableMenu"], { - className: "block-editor-media-replace-flow__media-upload-menu" - }, Object(external_wp_element_["createElement"])(media_upload, { - value: mediaId, - onSelect: media => selectMedia(media), - allowedTypes: allowedTypes, - render: _ref5 => { - let { - open - } = _ref5; - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - icon: library_media["a" /* default */], - onClick: open - }, Object(external_wp_i18n_["__"])('Open Media Library')); - } - }), Object(external_wp_element_["createElement"])(media_upload_check, null, Object(external_wp_element_["createElement"])(external_wp_components_["FormFileUpload"], { - onChange: event => { - uploadFiles(event, onClose); - }, - accept: accept, - render: _ref6 => { - let { - openFileDialog - } = _ref6; - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - icon: upload["a" /* default */], - onClick: () => { - openFileDialog(); - } - }, Object(external_wp_i18n_["__"])('Upload')); - } - })), children), onSelectURL && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions - Object(external_wp_element_["createElement"])("form", { - className: "block-editor-media-flow__url-input" - }, Object(external_wp_element_["createElement"])("span", { - className: "block-editor-media-replace-flow__image-url-label" - }, Object(external_wp_i18n_["__"])('Current media URL:')), Object(external_wp_element_["createElement"])(link_control, { - value: { - url: mediaURLValue - }, - settings: [], - showSuggestions: false, - onChange: _ref7 => { - let { - url - } = _ref7; - setMediaURLValue(url); - selectURL(url); - editMediaButtonRef.current.focus(); - } - }))); - } - }); -}; - -/* harmony default export */ var media_replace_flow = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withDispatch"])(dispatch => { - const { - createNotice, - removeNotice - } = dispatch(external_wp_notices_["store"]); - return { - createNotice, - removeNotice - }; -}), Object(external_wp_components_["withFilters"])('editor.MediaReplaceFlow')])(MediaReplaceFlow)); - -// EXTERNAL MODULE: external ["wp","deprecated"] -var external_wp_deprecated_ = __webpack_require__("NMb1"); -var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer-url.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -function LinkViewerURL(_ref) { - let { - url, - urlLabel, - className - } = _ref; - const linkClassName = classnames_default()(className, 'block-editor-url-popover__link-viewer-url'); - - if (!url) { - return Object(external_wp_element_["createElement"])("span", { - className: linkClassName - }); - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { - className: linkClassName, - href: url - }, urlLabel || Object(external_wp_url_["filterURLForDisplay"])(Object(external_wp_url_["safeDecodeURI"])(url))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -function LinkViewer(_ref) { - let { - className, - linkClassName, - onEditLinkClick, - url, - urlLabel, - ...props - } = _ref; - return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ - className: classnames_default()('block-editor-url-popover__link-viewer', className) - }, props), Object(external_wp_element_["createElement"])(LinkViewerURL, { - url: url, - urlLabel: urlLabel, - className: linkClassName - }), onEditLinkClick && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: edit["a" /* default */], - label: Object(external_wp_i18n_["__"])('Edit'), - onClick: onEditLinkClick - })); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-editor.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -function LinkEditor(_ref) { - let { - autocompleteRef, - className, - onChangeInputValue, - value, - ...props - } = _ref; - return Object(external_wp_element_["createElement"])("form", Object(esm_extends["a" /* default */])({ - className: classnames_default()('block-editor-url-popover__link-editor', className) - }, props), Object(external_wp_element_["createElement"])(url_input, { - value: value, - onChange: onChangeInputValue, - autocompleteRef: autocompleteRef - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: keyboard_return["a" /* default */], - label: Object(external_wp_i18n_["__"])('Apply'), - type: "submit" - })); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/index.js - - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -function URLPopover(_ref) { - let { - additionalControls, - children, - renderSettings, - position = 'bottom center', - focusOnMount = 'firstElement', - ...popoverProps - } = _ref; - const [isSettingsExpanded, setIsSettingsExpanded] = Object(external_wp_element_["useState"])(false); - const showSettings = !!renderSettings && isSettingsExpanded; - - const toggleSettingsVisibility = () => { - setIsSettingsExpanded(!isSettingsExpanded); - }; - - return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], Object(esm_extends["a" /* default */])({ - className: "block-editor-url-popover", - focusOnMount: focusOnMount, - position: position - }, popoverProps), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-url-popover__input-container" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-url-popover__row" - }, children, !!renderSettings && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-url-popover__settings-toggle", - icon: chevron_down["a" /* default */], - label: Object(external_wp_i18n_["__"])('Link settings'), - onClick: toggleSettingsVisibility, - "aria-expanded": isSettingsExpanded - })), showSettings && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-url-popover__row block-editor-url-popover__settings" - }, renderSettings())), additionalControls && !showSettings && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-url-popover__additional-controls" - }, additionalControls)); -} - -URLPopover.LinkEditor = LinkEditor; -URLPopover.LinkViewer = LinkViewer; -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-popover/README.md - */ - -/* harmony default export */ var url_popover = (URLPopover); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-placeholder/index.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - - -const InsertFromURLPopover = _ref => { - let { - src, - onChange, - onSubmit, - onClose - } = _ref; - return Object(external_wp_element_["createElement"])(url_popover, { - onClose: onClose - }, Object(external_wp_element_["createElement"])("form", { - className: "block-editor-media-placeholder__url-input-form", - onSubmit: onSubmit - }, Object(external_wp_element_["createElement"])("input", { - className: "block-editor-media-placeholder__url-input-field", - type: "text", - "aria-label": Object(external_wp_i18n_["__"])('URL'), - placeholder: Object(external_wp_i18n_["__"])('Paste or type URL'), - onChange: onChange, - value: src - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-media-placeholder__url-input-submit-button", - icon: keyboard_return["a" /* default */], - label: Object(external_wp_i18n_["__"])('Apply'), - type: "submit" - }))); -}; - -function MediaPlaceholder(_ref2) { - let { - value = {}, - allowedTypes, - className, - icon, - labels = {}, - mediaPreview, - notices, - isAppender, - accept, - addToGallery, - multiple = false, - handleUpload = true, - dropZoneUIOnly, - disableDropZone, - disableMediaButtons, - onError, - onSelect, - onCancel, - onSelectURL, - onDoubleClick, - onFilesPreUpload = external_lodash_["noop"], - onHTMLDrop = external_lodash_["noop"], - children, - mediaLibraryButton, - placeholder, - style - } = _ref2; - const mediaUpload = Object(external_wp_data_["useSelect"])(select => { - const { - getSettings - } = select(store["a" /* store */]); - return getSettings().mediaUpload; - }, []); - const [src, setSrc] = Object(external_wp_element_["useState"])(''); - const [isURLInputVisible, setIsURLInputVisible] = Object(external_wp_element_["useState"])(false); - Object(external_wp_element_["useEffect"])(() => { - var _value$src; - - setSrc((_value$src = value === null || value === void 0 ? void 0 : value.src) !== null && _value$src !== void 0 ? _value$src : ''); - }, [value === null || value === void 0 ? void 0 : value.src]); - - const onlyAllowsImages = () => { - if (!allowedTypes || allowedTypes.length === 0) { - return false; - } - - return allowedTypes.every(allowedType => allowedType === 'image' || allowedType.startsWith('image/')); - }; - - const onChangeSrc = event => { - setSrc(event.target.value); - }; - - const openURLInput = () => { - setIsURLInputVisible(true); - }; - - const closeURLInput = () => { - setIsURLInputVisible(false); - }; - - const onSubmitSrc = event => { - event.preventDefault(); - - if (src && onSelectURL) { - onSelectURL(src); - closeURLInput(); - } - }; - - const onFilesUpload = files => { - if (!handleUpload) { - return onSelect(files); - } - - onFilesPreUpload(files); - let setMedia; - - if (multiple) { - if (addToGallery) { - // Since the setMedia function runs multiple times per upload group - // and is passed newMedia containing every item in its group each time, we must - // filter out whatever this upload group had previously returned to the - // gallery before adding and returning the image array with replacement newMedia - // values. - // Define an array to store urls from newMedia between subsequent function calls. - let lastMediaPassed = []; - - setMedia = newMedia => { - // Remove any images this upload group is responsible for (lastMediaPassed). - // Their replacements are contained in newMedia. - const filteredMedia = (value !== null && value !== void 0 ? value : []).filter(item => { - // If Item has id, only remove it if lastMediaPassed has an item with that id. - if (item.id) { - return !lastMediaPassed.some( // Be sure to convert to number for comparison. - _ref3 => { - let { - id - } = _ref3; - return Number(id) === Number(item.id); - }); - } // Compare transient images via .includes since gallery may append extra info onto the url. - - - return !lastMediaPassed.some(_ref4 => { - let { - urlSlug - } = _ref4; - return item.url.includes(urlSlug); - }); - }); // Return the filtered media array along with newMedia. - - onSelect(filteredMedia.concat(newMedia)); // Reset lastMediaPassed and set it with ids and urls from newMedia. - - lastMediaPassed = newMedia.map(media => { - // Add everything up to '.fileType' to compare via .includes. - const cutOffIndex = media.url.lastIndexOf('.'); - const urlSlug = media.url.slice(0, cutOffIndex); - return { - id: media.id, - urlSlug - }; - }); - }; - } else { - setMedia = onSelect; - } - } else { - setMedia = _ref5 => { - let [media] = _ref5; - return onSelect(media); - }; - } - - mediaUpload({ - allowedTypes, - filesList: files, - onFileChange: setMedia, - onError - }); - }; - - const onUpload = event => { - onFilesUpload(event.target.files); - }; - - const defaultRenderPlaceholder = content => { - let { - instructions, - title - } = labels; - - if (!mediaUpload && !onSelectURL) { - instructions = Object(external_wp_i18n_["__"])('To edit this block, you need permission to upload media.'); - } - - if (instructions === undefined || title === undefined) { - const typesAllowed = allowedTypes !== null && allowedTypes !== void 0 ? allowedTypes : []; - const [firstAllowedType] = typesAllowed; - const isOneType = 1 === typesAllowed.length; - const isAudio = isOneType && 'audio' === firstAllowedType; - const isImage = isOneType && 'image' === firstAllowedType; - const isVideo = isOneType && 'video' === firstAllowedType; - - if (instructions === undefined && mediaUpload) { - instructions = Object(external_wp_i18n_["__"])('Upload a media file or pick one from your media library.'); - - if (isAudio) { - instructions = Object(external_wp_i18n_["__"])('Upload an audio file, pick one from your media library, or add one with a URL.'); - } else if (isImage) { - instructions = Object(external_wp_i18n_["__"])('Upload an image file, pick one from your media library, or add one with a URL.'); - } else if (isVideo) { - instructions = Object(external_wp_i18n_["__"])('Upload a video file, pick one from your media library, or add one with a URL.'); - } - } - - if (title === undefined) { - title = Object(external_wp_i18n_["__"])('Media'); - - if (isAudio) { - title = Object(external_wp_i18n_["__"])('Audio'); - } else if (isImage) { - title = Object(external_wp_i18n_["__"])('Image'); - } else if (isVideo) { - title = Object(external_wp_i18n_["__"])('Video'); - } - } - } - - const placeholderClassName = classnames_default()('block-editor-media-placeholder', className, { - 'is-appender': isAppender - }); - return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], { - icon: icon, - label: title, - instructions: instructions, - className: placeholderClassName, - notices: notices, - onDoubleClick: onDoubleClick, - preview: mediaPreview, - style: style - }, content, children); - }; - - const renderPlaceholder = placeholder !== null && placeholder !== void 0 ? placeholder : defaultRenderPlaceholder; - - const renderDropZone = () => { - if (disableDropZone) { - return null; - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["DropZone"], { - onFilesDrop: onFilesUpload, - onHTMLDrop: onHTMLDrop - }); - }; - - const renderCancelLink = () => { - return onCancel && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-media-placeholder__cancel-button", - title: Object(external_wp_i18n_["__"])('Cancel'), - variant: "link", - onClick: onCancel - }, Object(external_wp_i18n_["__"])('Cancel')); - }; - - const renderUrlSelectionUI = () => { - return onSelectURL && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-media-placeholder__url-input-container" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-media-placeholder__button", - onClick: openURLInput, - isPressed: isURLInputVisible, - variant: "tertiary" - }, Object(external_wp_i18n_["__"])('Insert from URL')), isURLInputVisible && Object(external_wp_element_["createElement"])(InsertFromURLPopover, { - src: src, - onChange: onChangeSrc, - onSubmit: onSubmitSrc, - onClose: closeURLInput - })); - }; - - const renderMediaUploadChecked = () => { - const defaultButton = _ref6 => { - let { - open - } = _ref6; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "tertiary", - onClick: () => { - open(); - } - }, Object(external_wp_i18n_["__"])('Media Library')); - }; - - const libraryButton = mediaLibraryButton !== null && mediaLibraryButton !== void 0 ? mediaLibraryButton : defaultButton; - const uploadMediaLibraryButton = Object(external_wp_element_["createElement"])(media_upload, { - addToGallery: addToGallery, - gallery: multiple && onlyAllowsImages(), - multiple: multiple, - onSelect: onSelect, - allowedTypes: allowedTypes, - value: Array.isArray(value) ? value.map(_ref7 => { - let { - id - } = _ref7; - return id; - }) : value.id, - render: libraryButton - }); - - if (mediaUpload && isAppender) { - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, renderDropZone(), Object(external_wp_element_["createElement"])(external_wp_components_["FormFileUpload"], { - onChange: onUpload, - accept: accept, - multiple: multiple, - render: _ref8 => { - let { - openFileDialog - } = _ref8; - const content = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "primary", - className: classnames_default()('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'), - onClick: openFileDialog - }, Object(external_wp_i18n_["__"])('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderCancelLink()); - return renderPlaceholder(content); - } - })); - } - - if (mediaUpload) { - const content = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, renderDropZone(), Object(external_wp_element_["createElement"])(external_wp_components_["FormFileUpload"], { - variant: "primary", - className: classnames_default()('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'), - onChange: onUpload, - accept: accept, - multiple: multiple - }, Object(external_wp_i18n_["__"])('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderCancelLink()); - return renderPlaceholder(content); - } - - return renderPlaceholder(uploadMediaLibraryButton); - }; - - if (dropZoneUIOnly || disableMediaButtons) { - if (dropZoneUIOnly) { - external_wp_deprecated_default()('wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop', { - since: '5.4', - alternative: 'disableMediaButtons' - }); - } - - return Object(external_wp_element_["createElement"])(media_upload_check, null, renderDropZone()); - } - - return Object(external_wp_element_["createElement"])(media_upload_check, { - fallback: renderPlaceholder(renderUrlSelectionUI()) - }, renderMediaUploadChecked()); -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-placeholder/README.md - */ - -/* harmony default export */ var media_placeholder = (Object(external_wp_components_["withFilters"])('editor.MediaPlaceholder')(MediaPlaceholder)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/panel-color-settings/index.js - - - -/** - * Internal dependencies - */ - - -const PanelColorSettings = _ref => { - let { - colorSettings, - ...props - } = _ref; - const settings = colorSettings.map(_ref2 => { - let { - value, - onChange, - ...otherSettings - } = _ref2; - return { ...otherSettings, - colorValue: value, - onColorChange: onChange - }; - }); - return Object(external_wp_element_["createElement"])(panel_color_gradient_settings["a" /* default */], Object(esm_extends["a" /* default */])({ - settings: settings, - gradients: [], - disableCustomGradients: true - }, props)); -}; - -/* harmony default export */ var panel_color_settings = (PanelColorSettings); - -// EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js -var react_autosize_textarea_lib = __webpack_require__("O6Fj"); -var react_autosize_textarea_lib_default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea_lib); - -// EXTERNAL MODULE: external ["wp","richText"] -var external_wp_richText_ = __webpack_require__("qRz9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar/index.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - -const format_toolbar_POPOVER_PROPS = { - position: 'bottom right', - isAlternate: true -}; - -const FormatToolbar = () => { - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, ['bold', 'italic', 'link'].map(format => Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], { - name: `RichText.ToolbarControls.${format}`, - key: format - })), Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], { - name: "RichText.ToolbarControls" - }, fills => { - if (!fills.length) { - return null; - } - - const allProps = fills.map(_ref => { - let [{ - props - }] = _ref; - return props; - }); - const hasActive = allProps.some(_ref2 => { - let { - isActive - } = _ref2; - return isActive; - }); - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], null, toggleProps => Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { - icon: chevron_down["a" /* default */] - /* translators: button label text should, if possible, be under 16 characters. */ - , - label: Object(external_wp_i18n_["__"])('More'), - toggleProps: { ...toggleProps, - className: classnames_default()(toggleProps.className, { - 'is-pressed': hasActive - }), - describedBy: Object(external_wp_i18n_["__"])('Displays more block tools') - }, - controls: Object(external_lodash_["orderBy"])(fills.map(_ref3 => { - let [{ - props - }] = _ref3; - return props; - }), 'title'), - popoverProps: format_toolbar_POPOVER_PROPS - })); - })); -}; - -/* harmony default export */ var format_toolbar = (FormatToolbar); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar-container.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -const FormatToolbarContainer = _ref => { - let { - inline, - anchorRef - } = _ref; - - if (inline) { - // Render in popover - return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { - noArrow: true, - position: "top center", - focusOnMount: false, - anchorRef: anchorRef, - className: "block-editor-rich-text__inline-format-toolbar", - __unstableSlotName: "block-toolbar" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-rich-text__inline-format-toolbar-group" - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(format_toolbar, null)))); - } // Render regular toolbar - - - return Object(external_wp_element_["createElement"])(block_controls["b" /* default */], { - group: "inline" - }, Object(external_wp_element_["createElement"])(format_toolbar, null)); -}; - -/* harmony default export */ var format_toolbar_container = (FormatToolbarContainer); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-undo-automatic-change.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function useUndoAutomaticChange() { - const { - didAutomaticChange, - getSettings - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - return Object(external_wp_compose_["useRefEffect"])(element => { - function onKeyDown(event) { - const { - keyCode - } = event; - - if (event.defaultPrevented) { - return; - } - - if (keyCode !== external_wp_keycodes_["DELETE"] && keyCode !== external_wp_keycodes_["BACKSPACE"] && keyCode !== external_wp_keycodes_["ESCAPE"]) { - return; - } - - if (!didAutomaticChange()) { - return; - } - - event.preventDefault(); - - getSettings().__experimentalUndo(); - } - - element.addEventListener('keydown', onKeyDown); - return () => { - element.removeEventListener('keydown', onKeyDown); - }; - }, []); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-caret-in-format.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function useCaretInFormat(_ref) { - let { - value - } = _ref; - const hasActiveFormats = value.activeFormats && !!value.activeFormats.length; - const { - isCaretWithinFormattedText - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - enterFormattedText, - exitFormattedText - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - Object(external_wp_element_["useEffect"])(() => { - if (hasActiveFormats) { - if (!isCaretWithinFormattedText()) { - enterFormattedText(); - } - } else if (isCaretWithinFormattedText()) { - exitFormattedText(); - } - }, [hasActiveFormats]); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-mark-persistent.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function useMarkPersistent(_ref) { - let { - html, - value - } = _ref; - const previousText = Object(external_wp_element_["useRef"])(); - const hasActiveFormats = value.activeFormats && !!value.activeFormats.length; - const { - __unstableMarkLastChangeAsPersistent - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); // Must be set synchronously to make sure it applies to the last change. - - Object(external_wp_element_["useLayoutEffect"])(() => { - // Ignore mount. - if (!previousText.current) { - previousText.current = value.text; - return; - } // Text input, so don't create an undo level for every character. - // Create an undo level after 1 second of no input. - - - if (previousText.current !== value.text) { - const timeout = window.setTimeout(() => { - __unstableMarkLastChangeAsPersistent(); - }, 1000); - previousText.current = value.text; - return () => { - window.clearTimeout(timeout); - }; - } - - __unstableMarkLastChangeAsPersistent(); - }, [html, hasActiveFormats]); -} - -// EXTERNAL MODULE: external ["wp","blob"] -var external_wp_blob_ = __webpack_require__("xTGt"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/file-paste-handler.js -/** - * WordPress dependencies - */ - -function filePasteHandler(files) { - return files.filter(_ref => { - let { - type - } = _ref; - return /^image\/(?:jpe?g|png|gif)$/.test(type); - }).map(file => ``).join(''); -} - -// EXTERNAL MODULE: external ["wp","shortcode"] -var external_wp_shortcode_ = __webpack_require__("SVSp"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/utils.js - - -/** - * WordPress dependencies - */ - - - - -function addActiveFormats(value, activeFormats) { - if (activeFormats !== null && activeFormats !== void 0 && activeFormats.length) { - let index = value.formats.length; - - while (index--) { - value.formats[index] = [...activeFormats, ...(value.formats[index] || [])]; - } - } -} -/** - * Get the multiline tag based on the multiline prop. - * - * @param {?(string|boolean)} multiline The multiline prop. - * - * @return {?string} The multiline tag. - */ - -function getMultilineTag(multiline) { - if (multiline !== true && multiline !== 'p' && multiline !== 'li') { - return; - } - - return multiline === true ? 'p' : multiline; -} -function getAllowedFormats(_ref) { - let { - allowedFormats, - formattingControls, - disableFormats - } = _ref; - - if (disableFormats) { - return getAllowedFormats.EMPTY_ARRAY; - } - - if (!allowedFormats && !formattingControls) { - return; - } - - if (allowedFormats) { - return allowedFormats; - } - - external_wp_deprecated_default()('wp.blockEditor.RichText formattingControls prop', { - since: '5.4', - alternative: 'allowedFormats' - }); - return formattingControls.map(name => `core/${name}`); -} -getAllowedFormats.EMPTY_ARRAY = []; -const isShortcode = text => Object(external_wp_shortcode_["regexp"])('.*').test(text); -/** - * Creates a link from pasted URL. - * Creates a paragraph block containing a link to the URL, and calls `onReplace`. - * - * @param {string} url The URL that could not be embedded. - * @param {Function} onReplace Function to call with the created fallback block. - */ - -function createLinkInParagraph(url, onReplace) { - const link = Object(external_wp_element_["createElement"])("a", { - href: url - }, url); - onReplace(Object(external_wp_blocks_["createBlock"])('core/paragraph', { - content: Object(external_wp_element_["renderToString"])(link) - })); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/split-value.js -/** - * WordPress dependencies - */ - -/* - * Signals to the RichText owner that the block can be replaced with two blocks - * as a result of splitting the block by pressing enter, or with blocks as a - * result of splitting the block by pasting block content in the instance. - */ - -function splitValue(_ref) { - let { - value, - pastedBlocks = [], - onReplace, - onSplit, - onSplitMiddle, - multilineTag - } = _ref; - - if (!onReplace || !onSplit) { - return; - } - - const blocks = []; - const [before, after] = Object(external_wp_richText_["split"])(value); - const hasPastedBlocks = pastedBlocks.length > 0; - let lastPastedBlockIndex = -1; // Consider the after value to be the original it is not empty and the - // before value *is* empty. - - const isAfterOriginal = Object(external_wp_richText_["isEmpty"])(before) && !Object(external_wp_richText_["isEmpty"])(after); // Create a block with the content before the caret if there's no pasted - // blocks, or if there are pasted blocks and the value is not empty. We do - // not want a leading empty block on paste, but we do if split with e.g. the - // enter key. - - if (!hasPastedBlocks || !Object(external_wp_richText_["isEmpty"])(before)) { - blocks.push(onSplit(Object(external_wp_richText_["toHTMLString"])({ - value: before, - multilineTag - }), !isAfterOriginal)); - lastPastedBlockIndex += 1; - } - - if (hasPastedBlocks) { - blocks.push(...pastedBlocks); - lastPastedBlockIndex += pastedBlocks.length; - } else if (onSplitMiddle) { - blocks.push(onSplitMiddle()); - } // If there's pasted blocks, append a block with non empty content / after - // the caret. Otherwise, do append an empty block if there is no - // `onSplitMiddle` prop, but if there is and the content is empty, the - // middle block is enough to set focus in. - - - if (hasPastedBlocks ? !Object(external_wp_richText_["isEmpty"])(after) : !onSplitMiddle || !Object(external_wp_richText_["isEmpty"])(after)) { - blocks.push(onSplit(Object(external_wp_richText_["toHTMLString"])({ - value: after, - multilineTag - }), isAfterOriginal)); - } // If there are pasted blocks, set the selection to the last one. Otherwise, - // set the selection to the second block. - - - const indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1; // If there are pasted blocks, move the caret to the end of the selected - // block Otherwise, retain the default value. - - const initialPosition = hasPastedBlocks ? -1 : 0; - onReplace(blocks, indexToSelect, initialPosition); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-paste-handler.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -/** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */ - -/** - * Replaces line separators with line breaks if not multiline. - * Replaces line breaks with line separators if multiline. - * - * @param {RichTextValue} value Value to adjust. - * @param {boolean} isMultiline Whether to adjust to multiline or not. - * - * @return {RichTextValue} Adjusted value. - */ - -function adjustLines(value, isMultiline) { - if (isMultiline) { - return Object(external_wp_richText_["replace"])(value, /\n+/g, external_wp_richText_["__UNSTABLE_LINE_SEPARATOR"]); - } - - return Object(external_wp_richText_["replace"])(value, new RegExp(external_wp_richText_["__UNSTABLE_LINE_SEPARATOR"], 'g'), '\n'); -} - -function usePasteHandler(props) { - const propsRef = Object(external_wp_element_["useRef"])(props); - propsRef.current = props; - return Object(external_wp_compose_["useRefEffect"])(element => { - function _onPaste(event) { - const { - isSelected, - disableFormats, - onChange, - value, - formatTypes, - tagName, - onReplace, - onSplit, - onSplitMiddle, - __unstableEmbedURLOnPaste, - multilineTag, - preserveWhiteSpace, - pastePlainText - } = propsRef.current; - - if (!isSelected) { - event.preventDefault(); - return; - } - - const { - clipboardData - } = event; - let plainText = ''; - let html = ''; // IE11 only supports `Text` as an argument for `getData` and will - // otherwise throw an invalid argument error, so we try the standard - // arguments first, then fallback to `Text` if they fail. - - try { - plainText = clipboardData.getData('text/plain'); - html = clipboardData.getData('text/html'); - } catch (error1) { - try { - html = clipboardData.getData('Text'); - } catch (error2) { - // Some browsers like UC Browser paste plain text by default and - // don't support clipboardData at all, so allow default - // behaviour. - return; - } - } // Remove Windows-specific metadata appended within copied HTML text. - - - html = removeWindowsFragments(html); // Strip meta tag. - - html = removeCharsetMetaTag(html); - event.preventDefault(); // Allows us to ask for this information when we get a report. - - window.console.log('Received HTML:\n\n', html); - window.console.log('Received plain text:\n\n', plainText); - - if (disableFormats) { - onChange(Object(external_wp_richText_["insert"])(value, plainText)); - return; - } - - const transformed = formatTypes.reduce((accumlator, _ref) => { - let { - __unstablePasteRule - } = _ref; - - // Only allow one transform. - if (__unstablePasteRule && accumlator === value) { - accumlator = __unstablePasteRule(value, { - html, - plainText - }); - } - - return accumlator; - }, value); - - if (transformed !== value) { - onChange(transformed); - return; - } - - const files = [...Object(external_wp_dom_["getFilesFromDataTransfer"])(clipboardData)]; - const isInternal = clipboardData.getData('rich-text') === 'true'; // If the data comes from a rich text instance, we can directly use it - // without filtering the data. The filters are only meant for externally - // pasted content and remove inline styles. - - if (isInternal) { - const pastedMultilineTag = clipboardData.getData('rich-text-multi-line-tag') || undefined; - let pastedValue = Object(external_wp_richText_["create"])({ - html, - multilineTag: pastedMultilineTag, - multilineWrapperTags: pastedMultilineTag === 'li' ? ['ul', 'ol'] : undefined, - preserveWhiteSpace - }); - pastedValue = adjustLines(pastedValue, !!multilineTag); - addActiveFormats(pastedValue, value.activeFormats); - onChange(Object(external_wp_richText_["insert"])(value, pastedValue)); - return; - } - - if (pastePlainText) { - onChange(Object(external_wp_richText_["insert"])(value, Object(external_wp_richText_["create"])({ - text: plainText - }))); - return; - } // Only process file if no HTML is present. - // Note: a pasted file may have the URL as plain text. - - - if (files && files.length && !html) { - const content = Object(external_wp_blocks_["pasteHandler"])({ - HTML: filePasteHandler(files), - mode: 'BLOCKS', - tagName, - preserveWhiteSpace - }); // Allows us to ask for this information when we get a report. - // eslint-disable-next-line no-console - - window.console.log('Received items:\n\n', files); - - if (onReplace && Object(external_wp_richText_["isEmpty"])(value)) { - onReplace(content); - } else { - splitValue({ - value, - pastedBlocks: content, - onReplace, - onSplit, - onSplitMiddle, - multilineTag - }); - } - - return; - } - - let mode = onReplace && onSplit ? 'AUTO' : 'INLINE'; // Force the blocks mode when the user is pasting - // on a new line & the content resembles a shortcode. - // Otherwise it's going to be detected as inline - // and the shortcode won't be replaced. - - if (mode === 'AUTO' && Object(external_wp_richText_["isEmpty"])(value) && isShortcode(plainText)) { - mode = 'BLOCKS'; - } - - if (__unstableEmbedURLOnPaste && Object(external_wp_richText_["isEmpty"])(value) && Object(external_wp_url_["isURL"])(plainText.trim())) { - mode = 'BLOCKS'; - } - - const content = Object(external_wp_blocks_["pasteHandler"])({ - HTML: html, - plainText, - mode, - tagName, - preserveWhiteSpace - }); - - if (typeof content === 'string') { - let valueToInsert = Object(external_wp_richText_["create"])({ - html: content - }); // If the content should be multiline, we should process text - // separated by a line break as separate lines. - - valueToInsert = adjustLines(valueToInsert, !!multilineTag); - addActiveFormats(valueToInsert, value.activeFormats); - onChange(Object(external_wp_richText_["insert"])(value, valueToInsert)); - } else if (content.length > 0) { - if (onReplace && Object(external_wp_richText_["isEmpty"])(value)) { - onReplace(content, content.length - 1, -1); - } else { - splitValue({ - value, - pastedBlocks: content, - onReplace, - onSplit, - onSplitMiddle, - multilineTag - }); - } - } - } - - element.addEventListener('paste', _onPaste); - return () => { - element.removeEventListener('paste', _onPaste); - }; - }, []); -} -/** - * Normalizes a given string of HTML to remove the Windows specific "Fragment" comments - * and any preceeding and trailing whitespace. - * - * @param {string} html the html to be normalized - * @return {string} the normalized html - */ - -function removeWindowsFragments(html) { - const startReg = /.*/s; - const endReg = /.*/s; - return html.replace(startReg, '').replace(endReg, ''); -} -/** - * Removes the charset meta tag inserted by Chromium. - * See: - * - https://github.com/WordPress/gutenberg/issues/33585 - * - https://bugs.chromium.org/p/chromium/issues/detail?id=1264616#c4 - * - * @param {string} html the html to be stripped of the meta tag. - * @return {string} the cleaned html - */ - - -function removeCharsetMetaTag(html) { - const metaTag = ``; - - if (html.startsWith(metaTag)) { - return html.slice(metaTag.length); - } - - return html; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-input-rules.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -function useInputRules(props) { - const { - __unstableMarkLastChangeAsPersistent, - __unstableMarkAutomaticChange - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const propsRef = Object(external_wp_element_["useRef"])(props); - propsRef.current = props; - return Object(external_wp_compose_["useRefEffect"])(element => { - function inputRule() { - const { - value, - onReplace - } = propsRef.current; - - if (!onReplace) { - return; - } - - const { - start, - text - } = value; - const characterBefore = text.slice(start - 1, start); // The character right before the caret must be a plain space. - - if (characterBefore !== ' ') { - return; - } - - const trimmedTextBefore = text.slice(0, start).trim(); - const prefixTransforms = Object(external_wp_blocks_["getBlockTransforms"])('from').filter(_ref => { - let { - type - } = _ref; - return type === 'prefix'; - }); - const transformation = Object(external_wp_blocks_["findTransform"])(prefixTransforms, _ref2 => { - let { - prefix - } = _ref2; - return trimmedTextBefore === prefix; - }); - - if (!transformation) { - return; - } - - const content = Object(external_wp_richText_["toHTMLString"])({ - value: Object(external_wp_richText_["slice"])(value, start, text.length) - }); - const block = transformation.transform(content); - onReplace([block]); - - __unstableMarkAutomaticChange(); - } - - function onInput(event) { - const { - inputType, - type - } = event; - const { - value, - onChange, - __unstableAllowPrefixTransformations, - formatTypes - } = propsRef.current; // Only run input rules when inserting text. - - if (inputType !== 'insertText' && type !== 'compositionend') { - return; - } - - if (__unstableAllowPrefixTransformations && inputRule) { - inputRule(); - } - - const transformed = formatTypes.reduce((accumlator, _ref3) => { - let { - __unstableInputRule - } = _ref3; - - if (__unstableInputRule) { - accumlator = __unstableInputRule(accumlator); - } - - return accumlator; - }, value); - - if (transformed !== value) { - __unstableMarkLastChangeAsPersistent(); - - onChange({ ...transformed, - activeFormats: value.activeFormats - }); - - __unstableMarkAutomaticChange(); - } - } - - element.addEventListener('input', onInput); - element.addEventListener('compositionend', onInput); - return () => { - element.removeEventListener('input', onInput); - element.removeEventListener('compositionend', onInput); - }; - }, []); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-enter.js -/** - * WordPress dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -function useEnter(props) { - const { - __unstableMarkAutomaticChange - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const propsRef = Object(external_wp_element_["useRef"])(props); - propsRef.current = props; - return Object(external_wp_compose_["useRefEffect"])(element => { - function onKeyDown(event) { - if (event.defaultPrevented) { - return; - } - - const { - removeEditorOnlyFormats, - value, - onReplace, - onSplit, - onSplitMiddle, - multilineTag, - onChange, - disableLineBreaks, - onSplitAtEnd - } = propsRef.current; - - if (event.keyCode !== external_wp_keycodes_["ENTER"]) { - return; - } - - event.preventDefault(); - const _value = { ...value - }; - _value.formats = removeEditorOnlyFormats(value); - const canSplit = onReplace && onSplit; - - if (onReplace) { - const transforms = Object(external_wp_blocks_["getBlockTransforms"])('from').filter(_ref => { - let { - type - } = _ref; - return type === 'enter'; - }); - const transformation = Object(external_wp_blocks_["findTransform"])(transforms, item => { - return item.regExp.test(_value.text); - }); - - if (transformation) { - onReplace([transformation.transform({ - content: _value.text - })]); - - __unstableMarkAutomaticChange(); - } - } - - if (multilineTag) { - if (event.shiftKey) { - if (!disableLineBreaks) { - onChange(Object(external_wp_richText_["insert"])(_value, '\n')); - } - } else if (canSplit && Object(external_wp_richText_["__unstableIsEmptyLine"])(_value)) { - splitValue({ - value: _value, - onReplace, - onSplit, - onSplitMiddle, - multilineTag - }); - } else { - onChange(Object(external_wp_richText_["__unstableInsertLineSeparator"])(_value)); - } - } else { - const { - text, - start, - end - } = _value; - const canSplitAtEnd = onSplitAtEnd && start === end && end === text.length; - - if (event.shiftKey || !canSplit && !canSplitAtEnd) { - if (!disableLineBreaks) { - onChange(Object(external_wp_richText_["insert"])(_value, '\n')); - } - } else if (!canSplit && canSplitAtEnd) { - onSplitAtEnd(); - } else if (canSplit) { - splitValue({ - value: _value, - onReplace, - onSplit, - onSplitMiddle, - multilineTag - }); - } - } - } - - element.addEventListener('keydown', onKeyDown); - return () => { - element.removeEventListener('keydown', onKeyDown); - }; - }, []); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-format-types.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function formatTypesSelector(select) { - return select(external_wp_richText_["store"]).getFormatTypes(); -} -/** - * Set of all interactive content tags. - * - * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content - */ - - -const interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']); -/** - * This hook provides RichText with the `formatTypes` and its derived props from - * experimental format type settings. - * - * @param {Object} $0 Options - * @param {string} $0.clientId Block client ID. - * @param {string} $0.identifier Block attribute. - * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not. - * @param {Array} $0.allowedFormats Allowed formats - */ - -function useFormatTypes(_ref) { - let { - clientId, - identifier, - withoutInteractiveFormatting, - allowedFormats - } = _ref; - const allFormatTypes = Object(external_wp_data_["useSelect"])(formatTypesSelector, []); - const formatTypes = Object(external_wp_element_["useMemo"])(() => { - return allFormatTypes.filter(_ref2 => { - let { - name, - tagName - } = _ref2; - - if (allowedFormats && !allowedFormats.includes(name)) { - return false; - } - - if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) { - return false; - } - - return true; - }); - }, [allFormatTypes, allowedFormats, interactiveContentTags]); - const keyedSelected = Object(external_wp_data_["useSelect"])(select => formatTypes.reduce((accumulator, type) => { - if (type.__experimentalGetPropsForEditableTreePreparation) { - accumulator[type.name] = type.__experimentalGetPropsForEditableTreePreparation(select, { - richTextIdentifier: identifier, - blockClientId: clientId - }); - } - - return accumulator; - }, {}), [formatTypes, clientId, identifier]); - const dispatch = Object(external_wp_data_["useDispatch"])(); - const prepareHandlers = []; - const valueHandlers = []; - const changeHandlers = []; - const dependencies = []; - formatTypes.forEach(type => { - if (type.__experimentalCreatePrepareEditableTree) { - const selected = keyedSelected[type.name]; - - const handler = type.__experimentalCreatePrepareEditableTree(selected, { - richTextIdentifier: identifier, - blockClientId: clientId - }); - - if (type.__experimentalCreateOnChangeEditableValue) { - valueHandlers.push(handler); - } else { - prepareHandlers.push(handler); - } - - for (const key in selected) { - dependencies.push(selected[key]); - } - } - - if (type.__experimentalCreateOnChangeEditableValue) { - let dispatchers = {}; - - if (type.__experimentalGetPropsForEditableTreeChangeHandler) { - dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler(dispatch, { - richTextIdentifier: identifier, - blockClientId: clientId - }); - } - - changeHandlers.push(type.__experimentalCreateOnChangeEditableValue({ ...(keyedSelected[type.name] || {}), - ...dispatchers - }, { - richTextIdentifier: identifier, - blockClientId: clientId - })); - } - }); - return { - formatTypes, - prepareHandlers, - valueHandlers, - changeHandlers, - dependencies - }; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-remove-browser-shortcuts.js -/** - * WordPress dependencies - */ - - -/** - * Hook to prevent default behaviors for key combinations otherwise handled - * internally by RichText. - * - * @return {import('react').RefObject} The component to be rendered. - */ - -function useRemoveBrowserShortcuts() { - return Object(external_wp_compose_["useRefEffect"])(node => { - function onKeydown(event) { - if (external_wp_keycodes_["isKeyboardEvent"].primary(event, 'z') || external_wp_keycodes_["isKeyboardEvent"].primary(event, 'y') || external_wp_keycodes_["isKeyboardEvent"].primaryShift(event, 'z')) { - event.preventDefault(); - } - } - - node.addEventListener('keydown', onKeydown); - return () => { - node.addEventListener('keydown', onKeydown); - }; - }, []); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-shortcuts.js -/** - * WordPress dependencies - */ - -function useShortcuts(keyboardShortcuts) { - return Object(external_wp_compose_["useRefEffect"])(element => { - function onKeyDown(event) { - for (const keyboardShortcut of keyboardShortcuts.current) { - keyboardShortcut(event); - } - } - - element.addEventListener('keydown', onKeyDown); - return () => { - element.removeEventListener('keydown', onKeyDown); - }; - }, []); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-input-events.js -/** - * WordPress dependencies - */ - -function useInputEvents(inputEvents) { - return Object(external_wp_compose_["useRefEffect"])(element => { - function onInput(event) { - for (const keyboardShortcut of inputEvents.current) { - keyboardShortcut(event); - } - } - - element.addEventListener('input', onInput); - return () => { - element.removeEventListener('input', onInput); - }; - }, []); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-edit.js - - -/** - * WordPress dependencies - */ - -/** - * External dependencies - */ - - -function FormatEdit(_ref) { - let { - formatTypes, - onChange, - onFocus, - value, - forwardedRef - } = _ref; - return formatTypes.map(settings => { - const { - name, - edit: Edit - } = settings; - - if (!Edit) { - return null; - } - - const activeFormat = Object(external_wp_richText_["getActiveFormat"])(value, name); - let isActive = activeFormat !== undefined; - const activeObject = Object(external_wp_richText_["getActiveObject"])(value); - const isObjectActive = activeObject !== undefined && activeObject.type === name; // Edge case: un-collapsed link formats. - // If there is a missing link format at either end of the selection - // then we shouldn't show the Edit UI because the selection has exceeded - // the bounds of the link format. - // Also if the format objects don't match then we're dealing with two separate - // links so we should not allow the link to be modified over the top. - - if (name === 'core/link' && !Object(external_wp_richText_["isCollapsed"])(value)) { - const formats = value.formats; - const linkFormatAtStart = Object(external_lodash_["find"])(formats[value.start], { - type: 'core/link' - }); - const linkFormatAtEnd = Object(external_lodash_["find"])(formats[value.end - 1], { - type: 'core/link' - }); - - if (!linkFormatAtStart || !linkFormatAtEnd || linkFormatAtStart !== linkFormatAtEnd) { - isActive = false; - } - } - - return Object(external_wp_element_["createElement"])(Edit, { - key: name, - isActive: isActive, - activeAttributes: isActive ? activeFormat.attributes || {} : {}, - isObjectActive: isObjectActive, - activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {}, - value: value, - onChange: onChange, - onFocus: onFocus, - contentRef: forwardedRef - }); - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/index.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - - - - - - -const keyboardShortcutContext = Object(external_wp_element_["createContext"])(); -const inputEventContext = Object(external_wp_element_["createContext"])(); -/** - * Removes props used for the native version of RichText so that they are not - * passed to the DOM element and log warnings. - * - * @param {Object} props Props to filter. - * - * @return {Object} Filtered props. - */ - -function removeNativeProps(props) { - return Object(external_lodash_["omit"])(props, ['__unstableMobileNoFocusOnMount', 'deleteEnter', 'placeholderTextColor', 'textAlign', 'selectionColor', 'tagsToEliminate', 'rootTagsToEliminate', 'disableEditingMenu', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'minWidth', 'maxWidth', 'setRef']); -} - -function RichTextWrapper(_ref, forwardedRef) { - let { - children, - tagName = 'div', - value: originalValue = '', - onChange: originalOnChange, - isSelected: originalIsSelected, - multiline, - inlineToolbar, - wrapperClassName, - autocompleters, - onReplace, - placeholder, - allowedFormats, - formattingControls, - withoutInteractiveFormatting, - onRemove, - onMerge, - onSplit, - __unstableOnSplitAtEnd: onSplitAtEnd, - __unstableOnSplitMiddle: onSplitMiddle, - identifier, - preserveWhiteSpace, - __unstablePastePlainText: pastePlainText, - __unstableEmbedURLOnPaste, - __unstableDisableFormats: disableFormats, - disableLineBreaks, - unstableOnFocus, - __unstableAllowPrefixTransformations, - ...props - } = _ref; - const instanceId = Object(external_wp_compose_["useInstanceId"])(RichTextWrapper); - identifier = identifier || instanceId; - props = removeNativeProps(props); - const anchorRef = Object(external_wp_element_["useRef"])(); - const { - clientId - } = Object(context["c" /* useBlockEditContext */])(); - - const selector = select => { - const { - getSelectionStart, - getSelectionEnd, - isMultiSelecting, - hasMultiSelection - } = select(store["a" /* store */]); - const selectionStart = getSelectionStart(); - const selectionEnd = getSelectionEnd(); - let isSelected; - - if (originalIsSelected === undefined) { - isSelected = selectionStart.clientId === clientId && selectionStart.attributeKey === identifier; - } else if (originalIsSelected) { - isSelected = selectionStart.clientId === clientId; - } - - return { - selectionStart: isSelected ? selectionStart.offset : undefined, - selectionEnd: isSelected ? selectionEnd.offset : undefined, - isSelected, - disabled: isMultiSelecting() || hasMultiSelection() - }; - }; // This selector must run on every render so the right selection state is - // retreived from the store on merge. - // To do: fix this somehow. - - - const { - selectionStart, - selectionEnd, - isSelected, - disabled - } = Object(external_wp_data_["useSelect"])(selector); - const { - selectionChange - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const multilineTag = getMultilineTag(multiline); - const adjustedAllowedFormats = getAllowedFormats({ - allowedFormats, - formattingControls, - disableFormats - }); - const hasFormats = !adjustedAllowedFormats || adjustedAllowedFormats.length > 0; - let adjustedValue = originalValue; - let adjustedOnChange = originalOnChange; // Handle deprecated format. - - if (Array.isArray(originalValue)) { - adjustedValue = external_wp_blocks_["children"].toHTML(originalValue); - - adjustedOnChange = newValue => originalOnChange(external_wp_blocks_["children"].fromDOM(Object(external_wp_richText_["__unstableCreateElement"])(document, newValue).childNodes)); - } - - const onSelectionChange = Object(external_wp_element_["useCallback"])((start, end) => { - selectionChange(clientId, identifier, start, end); - }, [clientId, identifier]); - const { - formatTypes, - prepareHandlers, - valueHandlers, - changeHandlers, - dependencies - } = useFormatTypes({ - clientId, - identifier, - withoutInteractiveFormatting, - allowedFormats: adjustedAllowedFormats - }); - - function addEditorOnlyFormats(value) { - return valueHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats); - } - - function removeEditorOnlyFormats(value) { - formatTypes.forEach(formatType => { - // Remove formats created by prepareEditableTree, because they are editor only. - if (formatType.__experimentalCreatePrepareEditableTree) { - value = Object(external_wp_richText_["removeFormat"])(value, formatType.name, 0, value.text.length); - } - }); - return value.formats; - } - - function addInvisibleFormats(value) { - return prepareHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats); - } - - const { - value, - onChange, - ref: richTextRef - } = Object(external_wp_richText_["__unstableUseRichText"])({ - value: adjustedValue, - - onChange(html, _ref2) { - let { - __unstableFormats, - __unstableText - } = _ref2; - adjustedOnChange(html); - Object.values(changeHandlers).forEach(changeHandler => { - changeHandler(__unstableFormats, __unstableText); - }); - }, - - selectionStart, - selectionEnd, - onSelectionChange, - placeholder, - __unstableIsSelected: isSelected, - __unstableMultilineTag: multilineTag, - __unstableDisableFormats: disableFormats, - preserveWhiteSpace, - __unstableDependencies: [...dependencies, tagName], - __unstableAfterParse: addEditorOnlyFormats, - __unstableBeforeSerialize: removeEditorOnlyFormats, - __unstableAddInvisibleFormats: addInvisibleFormats - }); - const autocompleteProps = useBlockEditorAutocompleteProps({ - onReplace, - completers: autocompleters, - record: value, - onChange - }); - useCaretInFormat({ - value - }); - useMarkPersistent({ - html: adjustedValue, - value - }); - const keyboardShortcuts = Object(external_wp_element_["useRef"])(new Set()); - const inputEvents = Object(external_wp_element_["useRef"])(new Set()); - - function onKeyDown(event) { - const { - keyCode - } = event; - - if (event.defaultPrevented) { - return; - } - - if (keyCode === external_wp_keycodes_["DELETE"] || keyCode === external_wp_keycodes_["BACKSPACE"]) { - const { - start, - end, - text - } = value; - const isReverse = keyCode === external_wp_keycodes_["BACKSPACE"]; - const hasActiveFormats = value.activeFormats && !!value.activeFormats.length; // Only process delete if the key press occurs at an uncollapsed edge. - - if (!Object(external_wp_richText_["isCollapsed"])(value) || hasActiveFormats || isReverse && start !== 0 || !isReverse && end !== text.length) { - return; - } - - if (onMerge) { - onMerge(!isReverse); - } // Only handle remove on Backspace. This serves dual-purpose of being - // an intentional user interaction distinguishing between Backspace and - // Delete to remove the empty field, but also to avoid merge & remove - // causing destruction of two fields (merge, then removed merged). - - - if (onRemove && Object(external_wp_richText_["isEmpty"])(value) && isReverse) { - onRemove(!isReverse); - } - - event.preventDefault(); - } - } - - function onFocus() { - anchorRef.current.focus(); - } - - const TagName = tagName; - const content = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isSelected && Object(external_wp_element_["createElement"])(keyboardShortcutContext.Provider, { - value: keyboardShortcuts - }, Object(external_wp_element_["createElement"])(inputEventContext.Provider, { - value: inputEvents - }, Object(external_wp_element_["createElement"])(external_wp_components_["Popover"].__unstableSlotNameProvider, { - value: "__unstable-block-tools-after" - }, children && children({ - value, - onChange, - onFocus - }), Object(external_wp_element_["createElement"])(FormatEdit, { - value: value, - onChange: onChange, - onFocus: onFocus, - formatTypes: formatTypes, - forwardedRef: anchorRef - })))), isSelected && hasFormats && Object(external_wp_element_["createElement"])(format_toolbar_container, { - inline: inlineToolbar, - anchorRef: anchorRef.current - }), Object(external_wp_element_["createElement"])(TagName // Overridable props. - , Object(esm_extends["a" /* default */])({ - role: "textbox", - "aria-multiline": true, - "aria-label": placeholder - }, props, autocompleteProps, { - ref: Object(external_wp_compose_["useMergeRefs"])([autocompleteProps.ref, props.ref, richTextRef, useInputRules({ - value, - onChange, - __unstableAllowPrefixTransformations, - formatTypes, - onReplace - }), useRemoveBrowserShortcuts(), useShortcuts(keyboardShortcuts), useInputEvents(inputEvents), useUndoAutomaticChange(), usePasteHandler({ - isSelected, - disableFormats, - onChange, - value, - formatTypes, - tagName, - onReplace, - onSplit, - onSplitMiddle, - __unstableEmbedURLOnPaste, - multilineTag, - preserveWhiteSpace, - pastePlainText - }), useEnter({ - removeEditorOnlyFormats, - value, - onReplace, - onSplit, - onSplitMiddle, - multilineTag, - onChange, - disableLineBreaks, - onSplitAtEnd - }), anchorRef, forwardedRef]) // Do not set the attribute if disabled. - , - contentEditable: disabled ? undefined : true, - suppressContentEditableWarning: !disabled, - className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text'), - onFocus: unstableOnFocus, - onKeyDown: onKeyDown - }))); - - if (!wrapperClassName) { - return content; - } - - external_wp_deprecated_default()('wp.blockEditor.RichText wrapperClassName prop', { - since: '5.4', - alternative: 'className prop or create your own wrapper div' - }); - const className = classnames_default()('block-editor-rich-text', wrapperClassName); - return Object(external_wp_element_["createElement"])("div", { - className: className - }, content); -} - -const ForwardedRichTextContainer = Object(external_wp_element_["forwardRef"])(RichTextWrapper); - -ForwardedRichTextContainer.Content = _ref3 => { - let { - value, - tagName: Tag, - multiline, - ...props - } = _ref3; - - // Handle deprecated `children` and `node` sources. - if (Array.isArray(value)) { - value = external_wp_blocks_["children"].toHTML(value); - } - - const MultilineTag = getMultilineTag(multiline); - - if (!value && MultilineTag) { - value = `<${MultilineTag}>`; - } - - const content = Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, value); - - if (Tag) { - return Object(external_wp_element_["createElement"])(Tag, Object(external_lodash_["omit"])(props, ['format']), content); - } - - return content; -}; - -ForwardedRichTextContainer.isEmpty = value => { - return !value || value.length === 0; -}; -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md - */ - - -/* harmony default export */ var rich_text = (ForwardedRichTextContainer); - - - - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editable-text/index.js - - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -const EditableText = Object(external_wp_element_["forwardRef"])((props, ref) => { - return Object(external_wp_element_["createElement"])(rich_text, Object(esm_extends["a" /* default */])({ - ref: ref - }, props, { - __unstableDisableFormats: true, - preserveWhiteSpace: true - })); -}); - -EditableText.Content = _ref => { - let { - value = '', - tagName: Tag = 'div', - ...props - } = _ref; - return Object(external_wp_element_["createElement"])(Tag, props, value); -}; -/** - * Renders an editable text input in which text formatting is not allowed. - */ - - -/* harmony default export */ var editable_text = (EditableText); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/plain-text/index.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md - */ - -const PlainText = Object(external_wp_element_["forwardRef"])((_ref, ref) => { - let { - __experimentalVersion, - ...props - } = _ref; - - if (__experimentalVersion === 2) { - return Object(external_wp_element_["createElement"])(editable_text, Object(esm_extends["a" /* default */])({ - ref: ref - }, props)); - } - - const { - className, - onChange, - ...remainingProps - } = props; - return Object(external_wp_element_["createElement"])(react_autosize_textarea_lib_default.a, Object(esm_extends["a" /* default */])({ - ref: ref, - className: classnames_default()('block-editor-plain-text', className), - onChange: event => onChange(event.target.value) - }, remainingProps)); -}); -/* harmony default export */ var plain_text = (PlainText); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/label.js - - -/** - * WordPress dependencies - */ - - - - -function ResponsiveBlockControlLabel(_ref) { - let { - property, - viewport, - desc - } = _ref; - const instanceId = Object(external_wp_compose_["useInstanceId"])(ResponsiveBlockControlLabel); - const accessibleLabel = desc || Object(external_wp_i18n_["sprintf"])( - /* translators: 1: property name. 2: viewport name. */ - Object(external_wp_i18n_["_x"])('Controls the %1$s property for %2$s viewports.', 'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'), property, viewport.label); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("span", { - "aria-describedby": `rbc-desc-${instanceId}` - }, viewport.label), Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { - as: "span", - id: `rbc-desc-${instanceId}` - }, accessibleLabel)); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - -function ResponsiveBlockControl(props) { - const { - title, - property, - toggleLabel, - onIsResponsiveChange, - renderDefaultControl, - renderResponsiveControls, - isResponsive = false, - defaultLabel = { - id: 'all', - - /* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */ - label: Object(external_wp_i18n_["__"])('All') - }, - viewports = [{ - id: 'small', - label: Object(external_wp_i18n_["__"])('Small screens') - }, { - id: 'medium', - label: Object(external_wp_i18n_["__"])('Medium screens') - }, { - id: 'large', - label: Object(external_wp_i18n_["__"])('Large screens') - }] - } = props; - - if (!title || !property || !renderDefaultControl) { - return null; - } - - const toggleControlLabel = toggleLabel || Object(external_wp_i18n_["sprintf"])( - /* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */ - Object(external_wp_i18n_["__"])('Use the same %s on all screensizes.'), property); - /* translators: 'Help text for the responsive mode toggle control.' */ - - const toggleHelpText = Object(external_wp_i18n_["__"])('Toggle between using the same value for all screen sizes or using a unique value per screen size.'); - - const defaultControl = renderDefaultControl(Object(external_wp_element_["createElement"])(ResponsiveBlockControlLabel, { - property: property, - viewport: defaultLabel - }), defaultLabel); - - const defaultResponsiveControls = () => { - return viewports.map(viewport => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], { - key: viewport.id - }, renderDefaultControl(Object(external_wp_element_["createElement"])(ResponsiveBlockControlLabel, { - property: property, - viewport: viewport - }), viewport))); - }; - - return Object(external_wp_element_["createElement"])("fieldset", { - className: "block-editor-responsive-block-control" - }, Object(external_wp_element_["createElement"])("legend", { - className: "block-editor-responsive-block-control__title" - }, title), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-responsive-block-control__inner" - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - className: "block-editor-responsive-block-control__toggle", - label: toggleControlLabel, - checked: !isResponsive, - onChange: onIsResponsiveChange, - help: toggleHelpText - }), Object(external_wp_element_["createElement"])("div", { - className: classnames_default()('block-editor-responsive-block-control__group', { - 'is-responsive': isResponsive - }) - }, !isResponsive && defaultControl, isResponsive && (renderResponsiveControls ? renderResponsiveControls(viewports) : defaultResponsiveControls())))); -} - -/* harmony default export */ var responsive_block_control = (ResponsiveBlockControl); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/shortcut.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function RichTextShortcut(_ref) { - let { - character, - type, - onUse - } = _ref; - const keyboardShortcuts = Object(external_wp_element_["useContext"])(keyboardShortcutContext); - const onUseRef = Object(external_wp_element_["useRef"])(); - onUseRef.current = onUse; - Object(external_wp_element_["useEffect"])(() => { - function callback(event) { - if (external_wp_keycodes_["isKeyboardEvent"][type](event, character)) { - onUseRef.current(); - event.preventDefault(); - } - } - - keyboardShortcuts.current.add(callback); - return () => { - keyboardShortcuts.current.delete(callback); - }; - }, [character, type]); - return null; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/toolbar-button.js - - - -/** - * WordPress dependencies - */ - - -function RichTextToolbarButton(_ref) { - let { - name, - shortcutType, - shortcutCharacter, - ...props - } = _ref; - let shortcut; - let fillName = 'RichText.ToolbarControls'; - - if (name) { - fillName += `.${name}`; - } - - if (shortcutType && shortcutCharacter) { - shortcut = external_wp_keycodes_["displayShortcut"][shortcutType](shortcutCharacter); - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], { - name: fillName - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], Object(esm_extends["a" /* default */])({}, props, { - shortcut: shortcut - }))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/input-event.js -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -function __unstableRichTextInputEvent(_ref) { - let { - inputType, - onInput - } = _ref; - const callbacks = Object(external_wp_element_["useContext"])(inputEventContext); - const onInputRef = Object(external_wp_element_["useRef"])(); - onInputRef.current = onInput; - Object(external_wp_element_["useEffect"])(() => { - function callback(event) { - if (event.inputType === inputType) { - onInputRef.current(); - event.preventDefault(); - } - } - - callbacks.current.add(callback); - return () => { - callbacks.current.delete(callback); - }; - }, [inputType]); - return null; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/tool-selector/index.js - - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const selectIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z" -})); - -function ToolSelector(props, ref) { - const isNavigationTool = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).isNavigationMode(), []); - const { - setNavigationMode - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - - const onSwitchMode = mode => { - setNavigationMode(mode === 'edit' ? false : true); - }; - - return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { - renderToggle: _ref => { - let { - isOpen, - onToggle - } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, props, { - ref: ref, - icon: isNavigationTool ? selectIcon : edit["a" /* default */], - "aria-expanded": isOpen, - "aria-haspopup": "true", - onClick: onToggle - /* translators: button label text should, if possible, be under 16 characters. */ - , - label: Object(external_wp_i18n_["__"])('Tools') - })); - }, - position: "bottom right", - renderContent: () => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["NavigableMenu"], { - role: "menu", - "aria-label": Object(external_wp_i18n_["__"])('Tools') - }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItemsChoice"], { - value: isNavigationTool ? 'select' : 'edit', - onSelect: onSwitchMode, - choices: [{ - value: 'edit', - label: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: edit["a" /* default */] - }), Object(external_wp_i18n_["__"])('Edit')) - }, { - value: 'select', - label: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, selectIcon, Object(external_wp_i18n_["__"])('Select')) - }] - })), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-tool-selector__help" - }, Object(external_wp_i18n_["__"])('Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.'))) - }); -} - -/* harmony default export */ var tool_selector = (Object(external_wp_element_["forwardRef"])(ToolSelector)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/unit-control/index.js - - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -function UnitControl(_ref) { - let { - units: unitsProp, - ...props - } = _ref; - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(use_setting["a" /* default */])('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'], - units: unitsProp - }); - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], Object(esm_extends["a" /* default */])({ - units: units - }, props)); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js -var library_link = __webpack_require__("Bpkj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js -var arrow_left = __webpack_require__("cjQ8"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-input/button.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - -class button_URLInputButton extends external_wp_element_["Component"] { - constructor() { - super(...arguments); - this.toggle = this.toggle.bind(this); - this.submitLink = this.submitLink.bind(this); - this.state = { - expanded: false - }; - } - - toggle() { - this.setState({ - expanded: !this.state.expanded - }); - } - - submitLink(event) { - event.preventDefault(); - this.toggle(); - } - - render() { - const { - url, - onChange - } = this.props; - const { - expanded - } = this.state; - const buttonLabel = url ? Object(external_wp_i18n_["__"])('Edit link') : Object(external_wp_i18n_["__"])('Insert link'); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-url-input__button" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: library_link["a" /* default */], - label: buttonLabel, - onClick: this.toggle, - className: "components-toolbar__control", - isPressed: !!url - }), expanded && Object(external_wp_element_["createElement"])("form", { - className: "block-editor-url-input__button-modal", - onSubmit: this.submitLink - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-url-input__button-modal-line" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-url-input__back", - icon: arrow_left["a" /* default */], - label: Object(external_wp_i18n_["__"])('Close'), - onClick: this.toggle - }), Object(external_wp_element_["createElement"])(url_input, { - value: url || '', - onChange: onChange - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: keyboard_return["a" /* default */], - label: Object(external_wp_i18n_["__"])('Submit'), - type: "submit" - })))); - } - -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md - */ - - -/* harmony default export */ var url_input_button = (button_URLInputButton); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js -var library_close = __webpack_require__("w95h"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/image-url-input-ui.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const LINK_DESTINATION_NONE = 'none'; -const LINK_DESTINATION_CUSTOM = 'custom'; -const LINK_DESTINATION_MEDIA = 'media'; -const LINK_DESTINATION_ATTACHMENT = 'attachment'; -const NEW_TAB_REL = ['noreferrer', 'noopener']; -const image_url_input_ui_icon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M0,0h24v24H0V0z", - fill: "none" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z" -})); - -const ImageURLInputUI = _ref => { - let { - linkDestination, - onChangeUrl, - url, - mediaType = 'image', - mediaUrl, - mediaLink, - linkTarget, - linkClass, - rel - } = _ref; - const [isOpen, setIsOpen] = Object(external_wp_element_["useState"])(false); - const openLinkUI = Object(external_wp_element_["useCallback"])(() => { - setIsOpen(true); - }); - const [isEditingLink, setIsEditingLink] = Object(external_wp_element_["useState"])(false); - const [urlInput, setUrlInput] = Object(external_wp_element_["useState"])(null); - const autocompleteRef = Object(external_wp_element_["useRef"])(null); - const startEditLink = Object(external_wp_element_["useCallback"])(() => { - if (linkDestination === LINK_DESTINATION_MEDIA || linkDestination === LINK_DESTINATION_ATTACHMENT) { - setUrlInput(''); - } - - setIsEditingLink(true); - }); - const stopEditLink = Object(external_wp_element_["useCallback"])(() => { - setIsEditingLink(false); - }); - const closeLinkUI = Object(external_wp_element_["useCallback"])(() => { - setUrlInput(null); - stopEditLink(); - setIsOpen(false); - }); - - const removeNewTabRel = currentRel => { - let newRel = currentRel; - - if (currentRel !== undefined && !Object(external_lodash_["isEmpty"])(newRel)) { - if (!Object(external_lodash_["isEmpty"])(newRel)) { - Object(external_lodash_["each"])(NEW_TAB_REL, relVal => { - const regExp = new RegExp('\\b' + relVal + '\\b', 'gi'); - newRel = newRel.replace(regExp, ''); - }); // Only trim if NEW_TAB_REL values was replaced. - - if (newRel !== currentRel) { - newRel = newRel.trim(); - } - - if (Object(external_lodash_["isEmpty"])(newRel)) { - newRel = undefined; - } - } - } - - return newRel; - }; - - const getUpdatedLinkTargetSettings = value => { - const newLinkTarget = value ? '_blank' : undefined; - let updatedRel; - - if (!newLinkTarget && !rel) { - updatedRel = undefined; - } else { - updatedRel = removeNewTabRel(rel); - } - - return { - linkTarget: newLinkTarget, - rel: updatedRel - }; - }; - - const onFocusOutside = Object(external_wp_element_["useCallback"])(() => { - return event => { - // The autocomplete suggestions list renders in a separate popover (in a portal), - // so onFocusOutside fails to detect that a click on a suggestion occurred in the - // LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and - // return to avoid the popover being closed. - const autocompleteElement = autocompleteRef.current; - - if (autocompleteElement && autocompleteElement.contains(event.target)) { - return; - } - - setIsOpen(false); - setUrlInput(null); - stopEditLink(); - }; - }); - const onSubmitLinkChange = Object(external_wp_element_["useCallback"])(() => { - return event => { - if (urlInput) { - var _getLinkDestinations$; - - // It is possible the entered URL actually matches a named link destination. - // This check will ensure our link destination is correct. - const selectedDestination = ((_getLinkDestinations$ = getLinkDestinations().find(destination => destination.url === urlInput)) === null || _getLinkDestinations$ === void 0 ? void 0 : _getLinkDestinations$.linkDestination) || LINK_DESTINATION_CUSTOM; - onChangeUrl({ - href: urlInput, - linkDestination: selectedDestination - }); - } - - stopEditLink(); - setUrlInput(null); - event.preventDefault(); - }; - }); - const onLinkRemove = Object(external_wp_element_["useCallback"])(() => { - onChangeUrl({ - linkDestination: LINK_DESTINATION_NONE, - href: '' - }); - }); - - const getLinkDestinations = () => { - const linkDestinations = [{ - linkDestination: LINK_DESTINATION_MEDIA, - title: Object(external_wp_i18n_["__"])('Media File'), - url: mediaType === 'image' ? mediaUrl : undefined, - icon: image_url_input_ui_icon - }]; - - if (mediaType === 'image' && mediaLink) { - linkDestinations.push({ - linkDestination: LINK_DESTINATION_ATTACHMENT, - title: Object(external_wp_i18n_["__"])('Attachment Page'), - url: mediaType === 'image' ? mediaLink : undefined, - icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M0 0h24v24H0V0z", - fill: "none" - }), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { - d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z" - })) - }); - } - - return linkDestinations; - }; - - const onSetHref = value => { - const linkDestinations = getLinkDestinations(); - let linkDestinationInput; - - if (!value) { - linkDestinationInput = LINK_DESTINATION_NONE; - } else { - linkDestinationInput = (Object(external_lodash_["find"])(linkDestinations, destination => { - return destination.url === value; - }) || { - linkDestination: LINK_DESTINATION_CUSTOM - }).linkDestination; - } - - onChangeUrl({ - linkDestination: linkDestinationInput, - href: value - }); - }; - - const onSetNewTab = value => { - const updatedLinkTarget = getUpdatedLinkTargetSettings(value); - onChangeUrl(updatedLinkTarget); - }; - - const onSetLinkRel = value => { - onChangeUrl({ - rel: value - }); - }; - - const onSetLinkClass = value => { - onChangeUrl({ - linkClass: value - }); - }; - - const advancedOptions = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Open in new tab'), - onChange: onSetNewTab, - checked: linkTarget === '_blank' - }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - label: Object(external_wp_i18n_["__"])('Link Rel'), - value: removeNewTabRel(rel) || '', - onChange: onSetLinkRel - }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - label: Object(external_wp_i18n_["__"])('Link CSS Class'), - value: linkClass || '', - onChange: onSetLinkClass - })); - const linkEditorValue = urlInput !== null ? urlInput : url; - const urlLabel = (Object(external_lodash_["find"])(getLinkDestinations(), ['linkDestination', linkDestination]) || {}).title; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - icon: library_link["a" /* default */], - className: "components-toolbar__control", - label: url ? Object(external_wp_i18n_["__"])('Edit link') : Object(external_wp_i18n_["__"])('Insert link'), - "aria-expanded": isOpen, - onClick: openLinkUI - }), isOpen && Object(external_wp_element_["createElement"])(url_popover, { - onFocusOutside: onFocusOutside(), - onClose: closeLinkUI, - renderSettings: () => advancedOptions, - additionalControls: !linkEditorValue && Object(external_wp_element_["createElement"])(external_wp_components_["NavigableMenu"], null, Object(external_lodash_["map"])(getLinkDestinations(), link => Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - key: link.linkDestination, - icon: link.icon, - onClick: () => { - setUrlInput(null); - onSetHref(link.url); - stopEditLink(); - } - }, link.title))) - }, (!url || isEditingLink) && Object(external_wp_element_["createElement"])(url_popover.LinkEditor, { - className: "block-editor-format-toolbar__link-container-content", - value: linkEditorValue, - onChangeInputValue: setUrlInput, - onSubmit: onSubmitLinkChange(), - autocompleteRef: autocompleteRef - }), url && !isEditingLink && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(url_popover.LinkViewer, { - className: "block-editor-format-toolbar__link-container-content", - url: url, - onEditLinkClick: startEditLink, - urlLabel: urlLabel - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: library_close["a" /* default */], - label: Object(external_wp_i18n_["__"])('Remove link'), - onClick: onLinkRemove - })))); -}; - - - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js -var block_settings_menu_first_item = __webpack_require__("Jyyd"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-menu-extension/index.js -var inserter_menu_extension = __webpack_require__("mlss"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/preview-options/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -function PreviewOptions(_ref) { - let { - children, - className, - isEnabled = true, - deviceType, - setDeviceType - } = _ref; - const isMobile = Object(external_wp_compose_["useViewportMatch"])('small', '<'); - if (isMobile) return null; - const popoverProps = { - className: classnames_default()(className, 'block-editor-post-preview__dropdown-content'), - position: 'bottom left' - }; - const toggleProps = { - variant: 'tertiary', - className: 'block-editor-post-preview__button-toggle', - disabled: !isEnabled, - - /* translators: button label text should, if possible, be under 16 characters. */ - children: Object(external_wp_i18n_["__"])('Preview') - }; - return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { - className: "block-editor-post-preview__dropdown", - popoverProps: popoverProps, - toggleProps: toggleProps, - icon: null - }, () => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - className: "block-editor-post-preview__button-resize", - onClick: () => setDeviceType('Desktop'), - icon: deviceType === 'Desktop' && check["a" /* default */] - }, Object(external_wp_i18n_["__"])('Desktop')), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - className: "block-editor-post-preview__button-resize", - onClick: () => setDeviceType('Tablet'), - icon: deviceType === 'Tablet' && check["a" /* default */] - }, Object(external_wp_i18n_["__"])('Tablet')), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - className: "block-editor-post-preview__button-resize", - onClick: () => setDeviceType('Mobile'), - icon: deviceType === 'Mobile' && check["a" /* default */] - }, Object(external_wp_i18n_["__"])('Mobile'))), children)); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-resize-canvas/index.js -/** - * WordPress dependencies - */ - -/** - * Function to resize the editor window. - * - * @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile) - * - * @return {Object} Inline styles to be added to resizable container. - */ - -function useResizeCanvas(deviceType) { - const [actualWidth, updateActualWidth] = Object(external_wp_element_["useState"])(window.innerWidth); - Object(external_wp_element_["useEffect"])(() => { - if (deviceType === 'Desktop') { - return; - } - - const resizeListener = () => updateActualWidth(window.innerWidth); - - window.addEventListener('resize', resizeListener); - return () => { - window.removeEventListener('resize', resizeListener); - }; - }, [deviceType]); - - const getCanvasWidth = device => { - let deviceWidth; - - switch (device) { - case 'Tablet': - deviceWidth = 780; - break; - - case 'Mobile': - deviceWidth = 360; - break; - - default: - return null; - } - - return deviceWidth < actualWidth ? deviceWidth : actualWidth; - }; - - const marginValue = () => window.innerHeight < 800 ? 36 : 72; - - const contentInlineStyles = device => { - const height = device === 'Mobile' ? '768px' : '1024px'; - - switch (device) { - case 'Tablet': - case 'Mobile': - return { - width: getCanvasWidth(device), - margin: marginValue() + 'px auto', - height, - borderRadius: '2px 2px 2px 2px', - border: '1px solid #ddd', - overflowY: 'auto' - }; - - default: - return null; - } - }; - - return contentInlineStyles(deviceType); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js -var use_block_refs = __webpack_require__("PKbb"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/skip-to-selected-block/index.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -const SkipToSelectedBlock = _ref => { - let { - selectedBlockClientId - } = _ref; - const ref = Object(use_block_refs["b" /* __unstableUseBlockRef */])(selectedBlockClientId); - - const onClick = () => { - ref.current.focus(); - }; - - return selectedBlockClientId ? Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "secondary", - className: "block-editor-skip-to-selected-block", - onClick: onClick - }, Object(external_wp_i18n_["__"])('Skip to the selected block')) : null; -}; - -/* harmony default export */ var skip_to_selected_block = (Object(external_wp_data_["withSelect"])(select => { - return { - selectedBlockClientId: select(store["a" /* store */]).getBlockSelectionStart() - }; -})(SkipToSelectedBlock)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-card/index.js -var block_card = __webpack_require__("GvwK"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js + 1 modules -var block_styles = __webpack_require__("7NR9"); - -// EXTERNAL MODULE: external ["wp","wordcount"] -var external_wp_wordcount_ = __webpack_require__("7fqt"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js -var stack = __webpack_require__("wzfx"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/multi-selection-inspector/index.js - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -function MultiSelectionInspector(_ref) { - let { - blocks - } = _ref; - const words = Object(external_wp_wordcount_["count"])(Object(external_wp_blocks_["serialize"])(blocks), 'words'); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-multi-selection-inspector__card" - }, Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - icon: stack["a" /* default */], - showColors: true - }), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-multi-selection-inspector__card-content" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-multi-selection-inspector__card-title" - }, Object(external_wp_i18n_["sprintf"])( - /* translators: %d: number of blocks */ - Object(external_wp_i18n_["_n"])('%d block', '%d blocks', blocks.length), blocks.length)), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-multi-selection-inspector__card-description" - }, Object(external_wp_i18n_["sprintf"])( - /* translators: %d: number of words */ - Object(external_wp_i18n_["_n"])('%d word', '%d words', words), words)))); -} - -/* harmony default export */ var multi_selection_inspector = (Object(external_wp_data_["withSelect"])(select => { - const { - getMultiSelectedBlocks - } = select(store["a" /* store */]); - return { - blocks: getMultiSelectedBlocks() - }; -})(MultiSelectionInspector)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-style-picker/index.js - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -function DefaultStylePicker(_ref) { - let { - blockName - } = _ref; - const { - preferredStyle, - onUpdatePreferredStyleVariations, - styles - } = Object(external_wp_data_["useSelect"])(select => { - var _preferredStyleVariat, _preferredStyleVariat2; - - const settings = select(store["a" /* store */]).getSettings(); - const preferredStyleVariations = settings.__experimentalPreferredStyleVariations; - return { - preferredStyle: preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[blockName], - onUpdatePreferredStyleVariations: (_preferredStyleVariat2 = preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : preferredStyleVariations.onChange) !== null && _preferredStyleVariat2 !== void 0 ? _preferredStyleVariat2 : null, - styles: select(external_wp_blocks_["store"]).getBlockStyles(blockName) - }; - }, [blockName]); - const selectOptions = Object(external_wp_element_["useMemo"])(() => [{ - label: Object(external_wp_i18n_["__"])('Not set'), - value: '' - }, ...styles.map(_ref2 => { - let { - label, - name - } = _ref2; - return { - label, - value: name - }; - })], [styles]); - const selectOnChange = Object(external_wp_element_["useCallback"])(blockStyle => { - onUpdatePreferredStyleVariations(blockName, blockStyle); - }, [blockName, onUpdatePreferredStyleVariations]); - return onUpdatePreferredStyleVariations && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - options: selectOptions, - value: preferredStyle || '', - label: Object(external_wp_i18n_["__"])('Default Style'), - onChange: selectOnChange - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/index.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - -const BlockInspector = _ref => { - let { - showNoBlockSelectedMessage = true, - bubblesVirtually = true - } = _ref; - const { - count, - hasBlockStyles, - selectedBlockName, - selectedBlockClientId, - blockType - } = Object(external_wp_data_["useSelect"])(select => { - const { - getSelectedBlockClientId, - getSelectedBlockCount, - getBlockName - } = select(store["a" /* store */]); - const { - getBlockStyles - } = select(external_wp_blocks_["store"]); - - const _selectedBlockClientId = getSelectedBlockClientId(); - - const _selectedBlockName = _selectedBlockClientId && getBlockName(_selectedBlockClientId); - - const _blockType = _selectedBlockName && Object(external_wp_blocks_["getBlockType"])(_selectedBlockName); - - const blockStyles = _selectedBlockName && getBlockStyles(_selectedBlockName); - - return { - count: getSelectedBlockCount(), - selectedBlockClientId: _selectedBlockClientId, - selectedBlockName: _selectedBlockName, - blockType: _blockType, - hasBlockStyles: blockStyles && blockStyles.length > 0 - }; - }, []); - - if (count > 1) { - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-inspector" - }, Object(external_wp_element_["createElement"])(multi_selection_inspector, null), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, null), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - __experimentalGroup: "typography", - label: Object(external_wp_i18n_["__"])('Typography') - }), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - __experimentalGroup: "dimensions", - label: Object(external_wp_i18n_["__"])('Dimensions') - }), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - __experimentalGroup: "border", - label: Object(external_wp_i18n_["__"])('Border') - })); - } - - const isSelectedBlockUnregistered = selectedBlockName === Object(external_wp_blocks_["getUnregisteredTypeHandlerName"])(); - /* - * If the selected block is of an unregistered type, avoid showing it as an actual selection - * because we want the user to focus on the unregistered block warning, not block settings. - */ - - if (!blockType || !selectedBlockClientId || isSelectedBlockUnregistered) { - if (showNoBlockSelectedMessage) { - return Object(external_wp_element_["createElement"])("span", { - className: "block-editor-block-inspector__no-blocks" - }, Object(external_wp_i18n_["__"])('No block selected.')); - } - - return null; - } - - return Object(external_wp_element_["createElement"])(BlockInspectorSingleBlock, { - clientId: selectedBlockClientId, - blockName: blockType.name, - hasBlockStyles: hasBlockStyles, - bubblesVirtually: bubblesVirtually - }); -}; - -const BlockInspectorSingleBlock = _ref2 => { - let { - clientId, - blockName, - hasBlockStyles, - bubblesVirtually - } = _ref2; - const blockInformation = Object(use_block_display_information["a" /* default */])(clientId); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-inspector" - }, Object(external_wp_element_["createElement"])(block_card["a" /* default */], blockInformation), Object(external_wp_element_["createElement"])(components_block_variation_transforms, { - blockClientId: clientId - }), hasBlockStyles && Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Styles') - }, Object(external_wp_element_["createElement"])(block_styles["a" /* default */], { - clientId: clientId - }), Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'defaultStylePicker', true) && Object(external_wp_element_["createElement"])(DefaultStylePicker, { - blockName: blockName - }))), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - bubblesVirtually: bubblesVirtually - }), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - __experimentalGroup: "typography", - bubblesVirtually: bubblesVirtually, - label: Object(external_wp_i18n_["__"])('Typography') - }), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - __experimentalGroup: "dimensions", - bubblesVirtually: bubblesVirtually, - label: Object(external_wp_i18n_["__"])('Dimensions') - }), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - __experimentalGroup: "border", - label: Object(external_wp_i18n_["__"])('Border') - }), Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(AdvancedControls, { - bubblesVirtually: bubblesVirtually - })), Object(external_wp_element_["createElement"])(skip_to_selected_block, { - key: "back" - })); -}; - -const AdvancedControls = _ref3 => { - let { - bubblesVirtually - } = _ref3; - const slot = Object(external_wp_components_["__experimentalUseSlot"])(inspector_controls["a" /* InspectorAdvancedControls */].slotName); - const hasFills = Boolean(slot.fills && slot.fills.length); - - if (!hasFills) { - return null; - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - className: "block-editor-block-inspector__advanced", - title: Object(external_wp_i18n_["__"])('Advanced'), - initialOpen: false - }, Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */].Slot, { - __experimentalGroup: "advanced", - bubblesVirtually: bubblesVirtually - })); -}; - -/* harmony default export */ var block_inspector = (BlockInspector); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js + 4 modules -var block_list = __webpack_require__("VyCT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/index.js -var use_block_props = __webpack_require__("nlh6"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js -var block_list_layout = __webpack_require__("w8sn"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/index.js -var block_mover = __webpack_require__("JygI"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-selection-clearer/index.js -var block_selection_clearer = __webpack_require__("zQI6"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/index.js -var block_settings_menu = __webpack_require__("U1WI"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js + 2 modules -var block_settings_menu_controls = __webpack_require__("pXCJ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js + 9 modules -var block_toolbar = __webpack_require__("+gtr"); - -// EXTERNAL MODULE: external ["wp","keyboardShortcuts"] -var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/insertion-point.js -var insertion_point = __webpack_require__("PS/H"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-popover.js + 1 modules -var block_popover = __webpack_require__("xCFn"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-contextual-toolbar.js -var block_contextual_toolbar = __webpack_require__("JUfZ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-popover-scroll.js -var use_popover_scroll = __webpack_require__("2z9l"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/index.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - -/** - * Renders block tools (the block toolbar, select/navigation mode toolbar, the - * insertion point and a slot for the inline rich text toolbar). Must be wrapped - * around the block content and editor styles wrapper or iframe. - * - * @param {Object} $0 Props. - * @param {Object} $0.children The block content and style container. - * @param {Object} $0.__unstableContentRef Ref holding the content scroll container. - */ - -function BlockTools(_ref) { - let { - children, - __unstableContentRef, - ...props - } = _ref; - const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium'); - const hasFixedToolbar = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).getSettings().hasFixedToolbar, []); - const isMatch = Object(external_wp_keyboardShortcuts_["__unstableUseShortcutEventMatch"])(); - const { - getSelectedBlockClientIds, - getBlockRootClientId - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - duplicateBlocks, - removeBlocks, - insertAfterBlock, - insertBeforeBlock, - clearSelectedBlock, - moveBlocksUp, - moveBlocksDown - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - - function onKeyDown(event) { - if (isMatch('core/block-editor/move-up', event)) { - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length) { - event.preventDefault(); - const rootClientId = getBlockRootClientId(Object(external_lodash_["first"])(clientIds)); - moveBlocksUp(clientIds, rootClientId); - } - } else if (isMatch('core/block-editor/move-down', event)) { - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length) { - event.preventDefault(); - const rootClientId = getBlockRootClientId(Object(external_lodash_["first"])(clientIds)); - moveBlocksDown(clientIds, rootClientId); - } - } else if (isMatch('core/block-editor/duplicate', event)) { - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length) { - event.preventDefault(); - duplicateBlocks(clientIds); - } - } else if (isMatch('core/block-editor/remove', event)) { - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length) { - event.preventDefault(); - removeBlocks(clientIds); - } - } else if (isMatch('core/block-editor/insert-after', event)) { - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length) { - event.preventDefault(); - insertAfterBlock(Object(external_lodash_["last"])(clientIds)); - } - } else if (isMatch('core/block-editor/insert-before', event)) { - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length) { - event.preventDefault(); - insertBeforeBlock(Object(external_lodash_["first"])(clientIds)); - } - } else if (isMatch('core/block-editor/delete-multi-selection', event)) { - /** - * Check if the target element is a text area, input or - * event.defaultPrevented and return early. In all these - * cases backspace could be handled elsewhere. - */ - if (['INPUT', 'TEXTAREA'].includes(event.target.nodeName) || event.defaultPrevented) { - return; - } - - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length > 1) { - event.preventDefault(); - removeBlocks(clientIds); - } - } else if (isMatch('core/block-editor/unselect', event)) { - const clientIds = getSelectedBlockClientIds(); - - if (clientIds.length > 1) { - event.preventDefault(); - clearSelectedBlock(); - event.target.ownerDocument.defaultView.getSelection().removeAllRanges(); - } - } - } - - return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions - Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, props, { - onKeyDown: onKeyDown - }), Object(external_wp_element_["createElement"])(insertion_point["b" /* default */], { - __unstableContentRef: __unstableContentRef - }, (hasFixedToolbar || !isLargeViewport) && Object(external_wp_element_["createElement"])(block_contextual_toolbar["a" /* default */], { - isFixed: true - }), Object(external_wp_element_["createElement"])(block_popover["a" /* default */], { - __unstableContentRef: __unstableContentRef - }), Object(external_wp_element_["createElement"])(external_wp_components_["Popover"].Slot, { - name: "block-toolbar", - ref: Object(use_popover_scroll["a" /* usePopoverScroll */])(__unstableContentRef) - }), children, Object(external_wp_element_["createElement"])(external_wp_components_["Popover"].Slot, { - name: "__unstable-block-tools-after", - ref: Object(use_popover_scroll["a" /* usePopoverScroll */])(__unstableContentRef) - }))) - ); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js + 1 modules -var copy_handler = __webpack_require__("+0ps"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js -var default_block_appender = __webpack_require__("5L8O"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editor-styles/index.js -var editor_styles = __webpack_require__("KyyN"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js + 1 modules -var inserter = __webpack_require__("qrxh"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/menu.js + 10 modules -var menu = __webpack_require__("xZzQ"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/library.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - -function InserterLibrary(_ref) { - let { - rootClientId, - clientId, - isAppender, - showInserterHelpPanel, - showMostUsedBlocks = false, - __experimentalInsertionIndex, - __experimentalFilterValue, - onSelect = external_lodash_["noop"], - shouldFocusBlock = false - } = _ref; - const destinationRootClientId = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockRootClientId - } = select(store["a" /* store */]); - return rootClientId || getBlockRootClientId(clientId) || undefined; - }, [clientId, rootClientId]); - return Object(external_wp_element_["createElement"])(menu["a" /* default */], { - onSelect: onSelect, - rootClientId: destinationRootClientId, - clientId: clientId, - isAppender: isAppender, - showInserterHelpPanel: showInserterHelpPanel, - showMostUsedBlocks: showMostUsedBlocks, - __experimentalInsertionIndex: __experimentalInsertionIndex, - __experimentalFilterValue: __experimentalFilterValue, - shouldFocusBlock: shouldFocusBlock - }); -} - -/* harmony default export */ var library = (InserterLibrary); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/keyboard-shortcuts/index.js -/** - * WordPress dependencies - */ - - - - - -function KeyboardShortcuts() { - return null; -} - -function KeyboardShortcutsRegister() { - // Registering the shortcuts - const { - registerShortcut - } = Object(external_wp_data_["useDispatch"])(external_wp_keyboardShortcuts_["store"]); - Object(external_wp_element_["useEffect"])(() => { - registerShortcut({ - name: 'core/block-editor/duplicate', - category: 'block', - description: Object(external_wp_i18n_["__"])('Duplicate the selected block(s).'), - keyCombination: { - modifier: 'primaryShift', - character: 'd' - } - }); - registerShortcut({ - name: 'core/block-editor/remove', - category: 'block', - description: Object(external_wp_i18n_["__"])('Remove the selected block(s).'), - keyCombination: { - modifier: 'access', - character: 'z' - } - }); - registerShortcut({ - name: 'core/block-editor/insert-before', - category: 'block', - description: Object(external_wp_i18n_["__"])('Insert a new block before the selected block(s).'), - keyCombination: { - modifier: 'primaryAlt', - character: 't' - } - }); - registerShortcut({ - name: 'core/block-editor/insert-after', - category: 'block', - description: Object(external_wp_i18n_["__"])('Insert a new block after the selected block(s).'), - keyCombination: { - modifier: 'primaryAlt', - character: 'y' - } - }); - registerShortcut({ - name: 'core/block-editor/delete-multi-selection', - category: 'block', - description: Object(external_wp_i18n_["__"])('Remove multiple selected blocks.'), - keyCombination: { - character: 'del' - }, - aliases: [{ - character: 'backspace' - }] - }); - registerShortcut({ - name: 'core/block-editor/select-all', - category: 'selection', - description: Object(external_wp_i18n_["__"])('Select all text when typing. Press again to select all blocks.'), - keyCombination: { - modifier: 'primary', - character: 'a' - } - }); - registerShortcut({ - name: 'core/block-editor/unselect', - category: 'selection', - description: Object(external_wp_i18n_["__"])('Clear selection.'), - keyCombination: { - character: 'escape' - } - }); - registerShortcut({ - name: 'core/block-editor/focus-toolbar', - category: 'global', - description: Object(external_wp_i18n_["__"])('Navigate to the nearest toolbar.'), - keyCombination: { - modifier: 'alt', - character: 'F10' - } - }); - registerShortcut({ - name: 'core/block-editor/move-up', - category: 'block', - description: Object(external_wp_i18n_["__"])('Move the selected block(s) up.'), - keyCombination: { - modifier: 'secondary', - character: 't' - } - }); - registerShortcut({ - name: 'core/block-editor/move-down', - category: 'block', - description: Object(external_wp_i18n_["__"])('Move the selected block(s) down.'), - keyCombination: { - modifier: 'secondary', - character: 'y' - } - }); - }, [registerShortcut]); - return null; -} - -KeyboardShortcuts.Register = KeyboardShortcutsRegister; -/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/selection-scroll-into-view/index.js -/** - * WordPress dependencies - */ - -/** - * Scrolls the multi block selection end into view if not in view already. This - * is important to do after selection by keyboard. - * - * @deprecated - */ - -function MultiSelectScrollIntoView() { - external_wp_deprecated_default()('wp.blockEditor.MultiSelectScrollIntoView', { - hint: 'This behaviour is now built-in.' - }); - return null; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/navigable-toolbar/index.js -var navigable_toolbar = __webpack_require__("GkEL"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/observe-typing/index.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -/** - * Set of key codes upon which typing is to be initiated on a keydown event. - * - * @type {Set} - */ - -const KEY_DOWN_ELIGIBLE_KEY_CODES = new Set([external_wp_keycodes_["UP"], external_wp_keycodes_["RIGHT"], external_wp_keycodes_["DOWN"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["ENTER"], external_wp_keycodes_["BACKSPACE"]]); -/** - * Returns true if a given keydown event can be inferred as intent to start - * typing, or false otherwise. A keydown is considered eligible if it is a - * text navigation without shift active. - * - * @param {KeyboardEvent} event Keydown event to test. - * - * @return {boolean} Whether event is eligible to start typing. - */ - -function isKeyDownEligibleForStartTyping(event) { - const { - keyCode, - shiftKey - } = event; - return !shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has(keyCode); -} -/** - * Removes the `isTyping` flag when the mouse moves in the document of the given - * element. - */ - - -function useMouseMoveTypingReset() { - const isTyping = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).isTyping(), []); - const { - stopTyping - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - return Object(external_wp_compose_["useRefEffect"])(node => { - if (!isTyping) { - return; - } - - const { - ownerDocument - } = node; - let lastClientX; - let lastClientY; - /** - * On mouse move, unset typing flag if user has moved cursor. - * - * @param {MouseEvent} event Mousemove event. - */ - - function stopTypingOnMouseMove(event) { - const { - clientX, - clientY - } = event; // We need to check that the mouse really moved because Safari - // triggers mousemove events when shift or ctrl are pressed. - - if (lastClientX && lastClientY && (lastClientX !== clientX || lastClientY !== clientY)) { - stopTyping(); - } - - lastClientX = clientX; - lastClientY = clientY; - } - - ownerDocument.addEventListener('mousemove', stopTypingOnMouseMove); - return () => { - ownerDocument.removeEventListener('mousemove', stopTypingOnMouseMove); - }; - }, [isTyping, stopTyping]); -} -/** - * Sets and removes the `isTyping` flag based on user actions: - * - * - Sets the flag if the user types within the given element. - * - Removes the flag when the user selects some text, focusses a non-text - * field, presses ESC or TAB, or moves the mouse in the document. - */ - -function useTypingObserver() { - const isTyping = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).isTyping()); - const { - startTyping, - stopTyping - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const ref1 = useMouseMoveTypingReset(); - const ref2 = Object(external_wp_compose_["useRefEffect"])(node => { - const { - ownerDocument - } = node; - const { - defaultView - } = ownerDocument; // Listeners to stop typing should only be added when typing. - // Listeners to start typing should only be added when not typing. - - if (isTyping) { - let timerId; - /** - * Stops typing when focus transitions to a non-text field element. - * - * @param {FocusEvent} event Focus event. - */ - - function stopTypingOnNonTextField(event) { - const { - target - } = event; // Since focus to a non-text field via arrow key will trigger - // before the keydown event, wait until after current stack - // before evaluating whether typing is to be stopped. Otherwise, - // typing will re-start. - - timerId = defaultView.setTimeout(() => { - if (!Object(external_wp_dom_["isTextField"])(target)) { - stopTyping(); - } - }); - } - /** - * Unsets typing flag if user presses Escape while typing flag is - * active. - * - * @param {KeyboardEvent} event Keypress or keydown event to - * interpret. - */ - - - function stopTypingOnEscapeKey(event) { - const { - keyCode - } = event; - - if (keyCode === external_wp_keycodes_["ESCAPE"] || keyCode === external_wp_keycodes_["TAB"]) { - stopTyping(); - } - } - /** - * On selection change, unset typing flag if user has made an - * uncollapsed (shift) selection. - */ - - - function stopTypingOnSelectionUncollapse() { - const selection = defaultView.getSelection(); - const isCollapsed = selection.rangeCount > 0 && selection.getRangeAt(0).collapsed; - - if (!isCollapsed) { - stopTyping(); - } - } - - node.addEventListener('focus', stopTypingOnNonTextField); - node.addEventListener('keydown', stopTypingOnEscapeKey); - ownerDocument.addEventListener('selectionchange', stopTypingOnSelectionUncollapse); - return () => { - defaultView.clearTimeout(timerId); - node.removeEventListener('focus', stopTypingOnNonTextField); - node.removeEventListener('keydown', stopTypingOnEscapeKey); - ownerDocument.removeEventListener('selectionchange', stopTypingOnSelectionUncollapse); - }; - } - /** - * Handles a keypress or keydown event to infer intention to start - * typing. - * - * @param {KeyboardEvent} event Keypress or keydown event to interpret. - */ - - - function startTypingInTextField(event) { - const { - type, - target - } = event; // Abort early if already typing, or key press is incurred outside a - // text field (e.g. arrow-ing through toolbar buttons). - // Ignore typing if outside the current DOM container - - if (!Object(external_wp_dom_["isTextField"])(target) || !node.contains(target)) { - return; - } // Special-case keydown because certain keys do not emit a keypress - // event. Conversely avoid keydown as the canonical event since - // there are many keydown which are explicitly not targeted for - // typing. - - - if (type === 'keydown' && !isKeyDownEligibleForStartTyping(event)) { - return; - } - - startTyping(); - } - - node.addEventListener('keypress', startTypingInTextField); - node.addEventListener('keydown', startTypingInTextField); - return () => { - node.removeEventListener('keypress', startTypingInTextField); - node.removeEventListener('keydown', startTypingInTextField); - }; - }, [isTyping, startTyping, stopTyping]); - return Object(external_wp_compose_["useMergeRefs"])([ref1, ref2]); -} - -function ObserveTyping(_ref) { - let { - children - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - ref: useTypingObserver() - }, children); -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md - */ - - -/* harmony default export */ var observe_typing = (ObserveTyping); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/preserve-scroll-in-reorder/index.js -/** - * WordPress dependencies - */ - -function PreserveScrollInReorder() { - external_wp_deprecated_default()('PreserveScrollInReorder component', { - since: '5.4', - hint: 'This behavior is now built-in the block list' - }); - return null; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/typewriter/index.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -const isIE = window.navigator.userAgent.indexOf('Trident') !== -1; -const arrowKeyCodes = new Set([external_wp_keycodes_["UP"], external_wp_keycodes_["DOWN"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]]); -const initialTriggerPercentage = 0.75; -function useTypewriter() { - const hasSelectedBlock = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).hasSelectedBlock(), []); - return Object(external_wp_compose_["useRefEffect"])(node => { - if (!hasSelectedBlock) { - return; - } - - const { - ownerDocument - } = node; - const { - defaultView - } = ownerDocument; - let scrollResizeRafId; - let onKeyDownRafId; - let caretRect; - - function onScrollResize() { - if (scrollResizeRafId) { - return; - } - - scrollResizeRafId = defaultView.requestAnimationFrame(() => { - computeCaretRectangle(); - scrollResizeRafId = null; - }); - } - - function onKeyDown(event) { - // Ensure the any remaining request is cancelled. - if (onKeyDownRafId) { - defaultView.cancelAnimationFrame(onKeyDownRafId); - } // Use an animation frame for a smooth result. - - - onKeyDownRafId = defaultView.requestAnimationFrame(() => { - maintainCaretPosition(event); - onKeyDownRafId = null; - }); - } - /** - * Maintains the scroll position after a selection change caused by a - * keyboard event. - * - * @param {KeyboardEvent} event Keyboard event. - */ - - - function maintainCaretPosition(_ref) { - let { - keyCode - } = _ref; - - if (!isSelectionEligibleForScroll()) { - return; - } - - const currentCaretRect = Object(external_wp_dom_["computeCaretRect"])(defaultView); - - if (!currentCaretRect) { - return; - } // If for some reason there is no position set to be scrolled to, let - // this be the position to be scrolled to in the future. - - - if (!caretRect) { - caretRect = currentCaretRect; - return; - } // Even though enabling the typewriter effect for arrow keys results in - // a pleasant experience, it may not be the case for everyone, so, for - // now, let's disable it. - - - if (arrowKeyCodes.has(keyCode)) { - // Reset the caret position to maintain. - caretRect = currentCaretRect; - return; - } - - const diff = currentCaretRect.top - caretRect.top; - - if (diff === 0) { - return; - } - - const scrollContainer = Object(external_wp_dom_["getScrollContainer"])(node); // The page must be scrollable. - - if (!scrollContainer) { - return; - } - - const windowScroll = scrollContainer === ownerDocument.body; - const scrollY = windowScroll ? defaultView.scrollY : scrollContainer.scrollTop; - const scrollContainerY = windowScroll ? 0 : scrollContainer.getBoundingClientRect().top; - const relativeScrollPosition = windowScroll ? caretRect.top / defaultView.innerHeight : (caretRect.top - scrollContainerY) / (defaultView.innerHeight - scrollContainerY); // If the scroll position is at the start, the active editable element - // is the last one, and the caret is positioned within the initial - // trigger percentage of the page, do not scroll the page. - // The typewriter effect should not kick in until an empty page has been - // filled with the initial trigger percentage or the user scrolls - // intentionally down. - - if (scrollY === 0 && relativeScrollPosition < initialTriggerPercentage && isLastEditableNode()) { - // Reset the caret position to maintain. - caretRect = currentCaretRect; - return; - } - - const scrollContainerHeight = windowScroll ? defaultView.innerHeight : scrollContainer.clientHeight; // Abort if the target scroll position would scroll the caret out of - // view. - - if ( // The caret is under the lower fold. - caretRect.top + caretRect.height > scrollContainerY + scrollContainerHeight || // The caret is above the upper fold. - caretRect.top < scrollContainerY) { - // Reset the caret position to maintain. - caretRect = currentCaretRect; - return; - } - - if (windowScroll) { - defaultView.scrollBy(0, diff); - } else { - scrollContainer.scrollTop += diff; - } - } - /** - * Adds a `selectionchange` listener to reset the scroll position to be - * maintained. - */ - - - function addSelectionChangeListener() { - ownerDocument.addEventListener('selectionchange', computeCaretRectOnSelectionChange); - } - /** - * Resets the scroll position to be maintained during a `selectionchange` - * event. Also removes the listener, so it acts as a one-time listener. - */ - - - function computeCaretRectOnSelectionChange() { - ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange); - computeCaretRectangle(); - } - /** - * Resets the scroll position to be maintained. - */ - - - function computeCaretRectangle() { - if (isSelectionEligibleForScroll()) { - caretRect = Object(external_wp_dom_["computeCaretRect"])(defaultView); - } - } - /** - * Checks if the current situation is elegible for scroll: - * - There should be one and only one block selected. - * - The component must contain the selection. - * - The active element must be contenteditable. - */ - - - function isSelectionEligibleForScroll() { - return node.contains(ownerDocument.activeElement) && ownerDocument.activeElement.isContentEditable; - } - - function isLastEditableNode() { - const editableNodes = node.querySelectorAll('[contenteditable="true"]'); - const lastEditableNode = editableNodes[editableNodes.length - 1]; - return lastEditableNode === ownerDocument.activeElement; - } // When the user scrolls or resizes, the scroll position should be - // reset. - - - defaultView.addEventListener('scroll', onScrollResize, true); - defaultView.addEventListener('resize', onScrollResize, true); - node.addEventListener('keydown', onKeyDown); - node.addEventListener('keyup', maintainCaretPosition); - node.addEventListener('mousedown', addSelectionChangeListener); - node.addEventListener('touchstart', addSelectionChangeListener); - return () => { - defaultView.removeEventListener('scroll', onScrollResize, true); - defaultView.removeEventListener('resize', onScrollResize, true); - node.removeEventListener('keydown', onKeyDown); - node.removeEventListener('keyup', maintainCaretPosition); - node.removeEventListener('mousedown', addSelectionChangeListener); - node.removeEventListener('touchstart', addSelectionChangeListener); - ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange); - defaultView.cancelAnimationFrame(scrollResizeRafId); - defaultView.cancelAnimationFrame(onKeyDownRafId); - }; - }, [hasSelectedBlock]); -} - -function Typewriter(_ref2) { - let { - children - } = _ref2; - return Object(external_wp_element_["createElement"])("div", { - ref: useTypewriter(), - className: "block-editor__typewriter" - }, children); -} -/** - * The exported component. The implementation of Typewriter faced technical - * challenges in Internet Explorer, and is simply skipped, rendering the given - * props children instead. - * - * @type {WPComponent} - */ - - -const TypewriterOrIEBypass = isIE ? props => props.children : Typewriter; -/** - * Ensures that the text selection keeps the same vertical distance from the - * viewport during keyboard events within this component. The vertical distance - * can vary. It is the last clicked or scrolled to position. - */ - -/* harmony default export */ var typewriter = (TypewriterOrIEBypass); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/warning/index.js + 1 modules -var warning = __webpack_require__("Zzu2"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js + 4 modules -var writing_flow = __webpack_require__("TVFh"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-canvas-click-redirect/index.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Given an element, returns true if the element is a tabbable text field, or - * false otherwise. - * - * @param {Element} element Element to test. - * - * @return {boolean} Whether element is a tabbable text field. - */ - -const isTabbableTextField = Object(external_lodash_["overEvery"])([external_wp_dom_["isTextField"], external_wp_dom_["focus"].tabbable.isTabbableIndex]); -function useCanvasClickRedirect() { - return Object(external_wp_compose_["useRefEffect"])(node => { - function onMouseDown(event) { - // Only handle clicks on the canvas, not the content. - if (event.target !== node) { - return; - } - - const focusableNodes = external_wp_dom_["focus"].focusable.find(node); - const target = Object(external_lodash_["findLast"])(focusableNodes, isTabbableTextField); - - if (!target) { - return; - } - - const { - bottom - } = target.getBoundingClientRect(); // Ensure the click is below the last block. - - if (event.clientY < bottom) { - return; - } - - Object(external_wp_dom_["placeCaretAtHorizontalEdge"])(target, true); - event.preventDefault(); - } - - node.addEventListener('mousedown', onMouseDown); - return () => { - node.addEventListener('mousedown', onMouseDown); - }; - }, []); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/iframe/index.js -var iframe = __webpack_require__("hHnB"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-no-recursive-renders/index.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -const RenderedRefsContext = Object(external_wp_element_["createContext"])({}); -/** - * Immutably adds an unique identifier to a set scoped for a given block type. - * - * @param {Object} renderedBlocks Rendered blocks grouped by block name - * @param {string} blockName Name of the block. - * @param {*} uniqueId Any value that acts as a unique identifier for a block instance. - * - * @return {Object} The list of rendered blocks grouped by block name. - */ - -function addToBlockType(renderedBlocks, blockName, uniqueId) { - const result = { ...renderedBlocks, - [blockName]: renderedBlocks[blockName] ? new Set(renderedBlocks[blockName]) : new Set() - }; - result[blockName].add(uniqueId); - return result; -} -/** - * A React hook for keeping track of blocks previously rendered up in the block - * tree. Blocks susceptible to recursion can use this hook in their `Edit` - * function to prevent said recursion. - * - * @param {*} uniqueId Any value that acts as a unique identifier for a block instance. - * @param {string} blockName Optional block name. - * - * @return {[boolean, Function]} A tuple of: - * - a boolean describing whether the provided id - * has already been rendered; - * - a React context provider to be used to wrap - * other elements. - */ - - -function useNoRecursiveRenders(uniqueId) { - var _previouslyRenderedBl; - - let blockName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - const previouslyRenderedBlocks = Object(external_wp_element_["useContext"])(RenderedRefsContext); - const { - name - } = Object(context["c" /* useBlockEditContext */])(); - blockName = blockName || name; - const hasAlreadyRendered = Boolean((_previouslyRenderedBl = previouslyRenderedBlocks[blockName]) === null || _previouslyRenderedBl === void 0 ? void 0 : _previouslyRenderedBl.has(uniqueId)); - const newRenderedBlocks = Object(external_wp_element_["useMemo"])(() => addToBlockType(previouslyRenderedBlocks, blockName, uniqueId), [previouslyRenderedBlocks, blockName, uniqueId]); - const Provider = Object(external_wp_element_["useCallback"])(_ref => { - let { - children - } = _ref; - return Object(external_wp_element_["createElement"])(RenderedRefsContext.Provider, { - value: newRenderedBlocks - }, children); - }, [newRenderedBlocks]); - return [hasAlreadyRendered, Provider]; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js + 1 modules -var provider = __webpack_require__("/QNa"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/index.js -/* - * Block Creation Components - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/* - * Content Related Components - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/* - * State Related Components - */ - - - - - -/***/ }), - -/***/ "16Al": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = __webpack_require__("WbBG"); - -function emptyFunction() {} -function emptyFunctionWithReset() {} -emptyFunctionWithReset.resetWarningCache = emptyFunction; - -module.exports = function() { - function shim(props, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret) { - // It is still safe when called from React. - return; - } - var err = 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' - ); - err.name = 'Invariant Violation'; - throw err; - }; - shim.isRequired = shim; - function getShim() { - return shim; - }; - // Important! - // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. - var ReactPropTypes = { - array: shim, - bigint: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - - any: shim, - arrayOf: getShim, - element: shim, - elementType: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim, - exact: getShim, - - checkPropTypes: emptyFunctionWithReset, - resetWarningCache: emptyFunction - }; - - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - - -/***/ }), - -/***/ "17x9": -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -if (false) { var throwOnDirectAccess, ReactIs; } else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__("16Al")(); -} - - -/***/ }), - -/***/ "1CF3": +/***/ 6411: /***/ (function(module, exports) { -(function() { module.exports = window["wp"]["dom"]; }()); - -/***/ }), - -/***/ "1K8p": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule normalizeWheel - * @typechecks - */ - - - -var UserAgent_DEPRECATED = __webpack_require__("jrfk"); - -var isEventSupported = __webpack_require__("ez49"); - - -// Reasonable defaults -var PIXEL_STEP = 10; -var LINE_HEIGHT = 40; -var PAGE_HEIGHT = 800; - -/** - * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is - * complicated, thus this doc is long and (hopefully) detailed enough to answer - * your questions. - * - * If you need to react to the mouse wheel in a predictable way, this code is - * like your bestest friend. * hugs * - * - * As of today, there are 4 DOM event types you can listen to: - * - * 'wheel' -- Chrome(31+), FF(17+), IE(9+) - * 'mousewheel' -- Chrome, IE(6+), Opera, Safari - * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! - * 'DOMMouseScroll' -- FF(0.9.7+) since 2003 - * - * So what to do? The is the best: - * - * normalizeWheel.getEventType(); - * - * In your event callback, use this code to get sane interpretation of the - * deltas. This code will return an object with properties: - * - * spinX -- normalized spin speed (use for zoom) - x plane - * spinY -- " - y plane - * pixelX -- normalized distance (to pixels) - x plane - * pixelY -- " - y plane - * - * Wheel values are provided by the browser assuming you are using the wheel to - * scroll a web page by a number of lines or pixels (or pages). Values can vary - * significantly on different platforms and browsers, forgetting that you can - * scroll at different speeds. Some devices (like trackpads) emit more events - * at smaller increments with fine granularity, and some emit massive jumps with - * linear speed or acceleration. - * - * This code does its best to normalize the deltas for you: - * - * - spin is trying to normalize how far the wheel was spun (or trackpad - * dragged). This is super useful for zoom support where you want to - * throw away the chunky scroll steps on the PC and make those equal to - * the slow and smooth tiny steps on the Mac. Key data: This code tries to - * resolve a single slow step on a wheel to 1. - * - * - pixel is normalizing the desired scroll delta in pixel units. You'll - * get the crazy differences between browsers, but at least it'll be in - * pixels! - * - * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This - * should translate to positive value zooming IN, negative zooming OUT. - * This matches the newer 'wheel' event. - * - * Why are there spinX, spinY (or pixels)? - * - * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn - * with a mouse. It results in side-scrolling in the browser by default. - * - * - spinY is what you expect -- it's the classic axis of a mouse wheel. - * - * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and - * probably is by browsers in conjunction with fancy 3D controllers .. but - * you know. - * - * Implementation info: - * - * Examples of 'wheel' event if you scroll slowly (down) by one step with an - * average mouse: - * - * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) - * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) - * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) - * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) - * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) - * - * On the trackpad: - * - * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) - * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) - * - * On other/older browsers.. it's more complicated as there can be multiple and - * also missing delta values. - * - * The 'wheel' event is more standard: - * - * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents - * - * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and - * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain - * backward compatibility with older events. Those other values help us - * better normalize spin speed. Example of what the browsers provide: - * - * | event.wheelDelta | event.detail - * ------------------+------------------+-------------- - * Safari v5/OS X | -120 | 0 - * Safari v5/Win7 | -120 | 0 - * Chrome v17/OS X | -120 | 0 - * Chrome v17/Win7 | -120 | 0 - * IE9/Win7 | -120 | undefined - * Firefox v4/OS X | undefined | 1 - * Firefox v4/Win7 | undefined | 3 - * - */ -function normalizeWheel(/*object*/ event) /*object*/ { - var sX = 0, sY = 0, // spinX, spinY - pX = 0, pY = 0; // pixelX, pixelY - - // Legacy - if ('detail' in event) { sY = event.detail; } - if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; } - if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; } - if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; } - - // side scrolling on FF with DOMMouseScroll - if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) { - sX = sY; - sY = 0; - } - - pX = sX * PIXEL_STEP; - pY = sY * PIXEL_STEP; - - if ('deltaY' in event) { pY = event.deltaY; } - if ('deltaX' in event) { pX = event.deltaX; } - - if ((pX || pY) && event.deltaMode) { - if (event.deltaMode == 1) { // delta in LINE units - pX *= LINE_HEIGHT; - pY *= LINE_HEIGHT; - } else { // delta in PAGE units - pX *= PAGE_HEIGHT; - pY *= PAGE_HEIGHT; - } - } - - // Fall-back if spin cannot be determined - if (pX && !sX) { sX = (pX < 1) ? -1 : 1; } - if (pY && !sY) { sY = (pY < 1) ? -1 : 1; } - - return { spinX : sX, - spinY : sY, - pixelX : pX, - pixelY : pY }; -} - - -/** - * The best combination if you prefer spinX + spinY normalization. It favors - * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with - * 'wheel' event, making spin speed determination impossible. - */ -normalizeWheel.getEventType = function() /*string*/ { - return (UserAgent_DEPRECATED.firefox()) - ? 'DOMMouseScroll' - : (isEventSupported('wheel')) - ? 'wheel' - : 'mousewheel'; -}; - -module.exports = normalizeWheel; - - -/***/ }), - -/***/ "1ZqX": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["data"]; }()); - -/***/ }), - -/***/ "1eGn": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// UNUSED EXPORTS: BlockSettingsDropdown - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js -var more_vertical = __webpack_require__("VKE3"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","keyboardShortcuts"] -var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js + 1 modules -var copy_handler = __webpack_require__("+0ps"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-actions/index.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function BlockActions(_ref) { - let { - clientIds, - children, - __experimentalUpdateSelection: updateSelection - } = _ref; - const { - canInsertBlockType, - getBlockRootClientId, - getBlocksByClientId, - canMoveBlocks, - canRemoveBlocks - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - getDefaultBlockName, - getGroupingBlockName - } = Object(external_wp_data_["useSelect"])(external_wp_blocks_["store"]); - const blocks = getBlocksByClientId(clientIds); - const rootClientId = getBlockRootClientId(clientIds[0]); - const canDuplicate = Object(external_lodash_["every"])(blocks, block => { - return !!block && Object(external_wp_blocks_["hasBlockSupport"])(block.name, 'multiple', true) && canInsertBlockType(block.name, rootClientId); - }); - const canInsertDefaultBlock = canInsertBlockType(getDefaultBlockName(), rootClientId); - const canMove = canMoveBlocks(clientIds, rootClientId); - const canRemove = canRemoveBlocks(clientIds, rootClientId); - const { - removeBlocks, - replaceBlocks, - duplicateBlocks, - insertAfterBlock, - insertBeforeBlock, - flashBlock, - setBlockMovingClientId, - setNavigationMode, - selectBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const notifyCopy = Object(copy_handler["c" /* useNotifyCopy */])(); - return children({ - canDuplicate, - canInsertDefaultBlock, - canMove, - canRemove, - rootClientId, - blocks, - - onDuplicate() { - return duplicateBlocks(clientIds, updateSelection); - }, - - onRemove() { - return removeBlocks(clientIds, updateSelection); - }, - - onInsertBefore() { - insertBeforeBlock(Object(external_lodash_["first"])(Object(external_lodash_["castArray"])(clientIds))); - }, - - onInsertAfter() { - insertAfterBlock(Object(external_lodash_["last"])(Object(external_lodash_["castArray"])(clientIds))); - }, - - onMoveTo() { - setNavigationMode(true); - selectBlock(clientIds[0]); - setBlockMovingClientId(clientIds[0]); - }, - - onGroup() { - if (!blocks.length) { - return; - } - - const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion - - const newBlocks = Object(external_wp_blocks_["switchToBlockType"])(blocks, groupingBlockName); - - if (!newBlocks) { - return; - } - - replaceBlocks(clientIds, newBlocks); - }, - - onUngroup() { - if (!blocks.length) { - return; - } - - const innerBlocks = blocks[0].innerBlocks; - - if (!innerBlocks.length) { - return; - } - - replaceBlocks(clientIds, innerBlocks); - }, - - onCopy() { - const selectedBlockClientIds = blocks.map(_ref2 => { - let { - clientId - } = _ref2; - return clientId; - }); - - if (blocks.length === 1) { - flashBlock(selectedBlockClientIds[0]); - } - - notifyCopy('copy', selectedBlockClientIds); - } - - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-mode-toggle.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - -function BlockModeToggle(_ref) { - let { - blockType, - mode, - onToggleMode, - small = false, - isCodeEditingEnabled = true - } = _ref; - - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'html', true) || !isCodeEditingEnabled) { - return null; - } - - const label = mode === 'visual' ? Object(external_wp_i18n_["__"])('Edit as HTML') : Object(external_wp_i18n_["__"])('Edit visually'); - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: onToggleMode - }, !small && label); -} -/* harmony default export */ var block_mode_toggle = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, _ref2) => { - let { - clientId - } = _ref2; - const { - getBlock, - getBlockMode, - getSettings - } = select(store["a" /* store */]); - const block = getBlock(clientId); - const isCodeEditingEnabled = getSettings().codeEditingEnabled; - return { - mode: getBlockMode(clientId), - blockType: block ? Object(external_wp_blocks_["getBlockType"])(block.name) : null, - isCodeEditingEnabled - }; -}), Object(external_wp_data_["withDispatch"])((dispatch, _ref3) => { - let { - onToggle = external_lodash_["noop"], - clientId - } = _ref3; - return { - onToggleMode() { - dispatch(store["a" /* store */]).toggleBlockMode(clientId); - onToggle(); - } - - }; -})])(BlockModeToggle)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-convert-button.js - - -/** - * WordPress dependencies - */ - - -function BlockConvertButton(_ref) { - let { - shouldRender, - onClick, - small - } = _ref; - - if (!shouldRender) { - return null; - } - - const label = Object(external_wp_i18n_["__"])('Convert to Blocks'); - - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: onClick - }, !small && label); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-html-convert-button.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -/* harmony default export */ var block_html_convert_button = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, _ref) => { - let { - clientId - } = _ref; - const block = select(store["a" /* store */]).getBlock(clientId); - return { - block, - shouldRender: block && block.name === 'core/html' - }; -}), Object(external_wp_data_["withDispatch"])((dispatch, _ref2) => { - let { - block - } = _ref2; - return { - onClick: () => dispatch(store["a" /* store */]).replaceBlocks(block.clientId, Object(external_wp_blocks_["rawHandler"])({ - HTML: Object(external_wp_blocks_["getBlockContent"])(block) - })) - }; -}))(BlockConvertButton)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js -var block_settings_menu_first_item = __webpack_require__("Jyyd"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js + 2 modules -var block_settings_menu_controls = __webpack_require__("pXCJ"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-dropdown.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - -const POPOVER_PROPS = { - className: 'block-editor-block-settings-menu__popover', - position: 'bottom right', - isAlternate: true -}; - -function CopyMenuItem(_ref) { - let { - blocks, - onCopy - } = _ref; - const ref = Object(external_wp_compose_["useCopyToClipboard"])(() => Object(external_wp_blocks_["serialize"])(blocks), onCopy); - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - ref: ref - }, Object(external_wp_i18n_["__"])('Copy')); -} - -function BlockSettingsDropdown(_ref2) { - let { - clientIds, - __experimentalSelectBlock, - children, - ...props - } = _ref2; - const blockClientIds = Object(external_lodash_["castArray"])(clientIds); - const count = blockClientIds.length; - const firstBlockClientId = blockClientIds[0]; - const { - onlyBlock, - title - } = Object(external_wp_data_["useSelect"])(select => { - var _getBlockType; - - const { - getBlockCount, - getBlockName - } = select(store["a" /* store */]); - const { - getBlockType - } = select(external_wp_blocks_["store"]); - return { - onlyBlock: 1 === getBlockCount(), - title: (_getBlockType = getBlockType(getBlockName(firstBlockClientId))) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title - }; - }, [firstBlockClientId]); - const shortcuts = Object(external_wp_data_["useSelect"])(select => { - const { - getShortcutRepresentation - } = select(external_wp_keyboardShortcuts_["store"]); - return { - duplicate: getShortcutRepresentation('core/block-editor/duplicate'), - remove: getShortcutRepresentation('core/block-editor/remove'), - insertAfter: getShortcutRepresentation('core/block-editor/insert-after'), - insertBefore: getShortcutRepresentation('core/block-editor/insert-before') - }; - }, []); - const updateSelection = Object(external_wp_element_["useCallback"])(__experimentalSelectBlock ? async clientIdsPromise => { - const ids = await clientIdsPromise; - - if (ids && ids[0]) { - __experimentalSelectBlock(ids[0]); - } - } : external_lodash_["noop"], [__experimentalSelectBlock]); - const label = Object(external_wp_i18n_["sprintf"])( - /* translators: %s: block name */ - Object(external_wp_i18n_["__"])('Remove %s'), title); - const removeBlockLabel = count === 1 ? label : Object(external_wp_i18n_["__"])('Remove blocks'); - return Object(external_wp_element_["createElement"])(BlockActions, { - clientIds: clientIds, - __experimentalUpdateSelection: !__experimentalSelectBlock - }, _ref3 => { - let { - canDuplicate, - canInsertDefaultBlock, - canMove, - canRemove, - onDuplicate, - onInsertAfter, - onInsertBefore, - onRemove, - onCopy, - onMoveTo, - blocks - } = _ref3; - return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], Object(esm_extends["a" /* default */])({ - icon: more_vertical["a" /* default */], - label: Object(external_wp_i18n_["__"])('Options'), - className: "block-editor-block-settings-menu", - popoverProps: POPOVER_PROPS, - noIcons: true - }, props), _ref4 => { - let { - onClose - } = _ref4; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])(block_settings_menu_first_item["a" /* default */].Slot, { - fillProps: { - onClose - } - }), count === 1 && Object(external_wp_element_["createElement"])(block_html_convert_button, { - clientId: firstBlockClientId - }), Object(external_wp_element_["createElement"])(CopyMenuItem, { - blocks: blocks, - onCopy: onCopy - }), canDuplicate && Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: Object(external_lodash_["flow"])(onClose, onDuplicate, updateSelection), - shortcut: shortcuts.duplicate - }, Object(external_wp_i18n_["__"])('Duplicate')), canInsertDefaultBlock && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: Object(external_lodash_["flow"])(onClose, onInsertBefore), - shortcut: shortcuts.insertBefore - }, Object(external_wp_i18n_["__"])('Insert before')), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: Object(external_lodash_["flow"])(onClose, onInsertAfter), - shortcut: shortcuts.insertAfter - }, Object(external_wp_i18n_["__"])('Insert after'))), canMove && !onlyBlock && Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: Object(external_lodash_["flow"])(onClose, onMoveTo) - }, Object(external_wp_i18n_["__"])('Move to')), count === 1 && Object(external_wp_element_["createElement"])(block_mode_toggle, { - clientId: firstBlockClientId, - onToggle: onClose - })), Object(external_wp_element_["createElement"])(block_settings_menu_controls["a" /* default */].Slot, { - fillProps: { - onClose - }, - clientIds: clientIds - }), typeof children === 'function' ? children({ - onClose - }) : external_wp_element_["Children"].map(child => Object(external_wp_element_["cloneElement"])(child, { - onClose - })), canRemove && Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: Object(external_lodash_["flow"])(onClose, onRemove, updateSelection), - shortcut: shortcuts.remove - }, removeBlockLabel))); - }); - }); -} -/* harmony default export */ var block_settings_dropdown = __webpack_exports__["a"] = (BlockSettingsDropdown); - - -/***/ }), - -/***/ "1iEr": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const chevronRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" -})); -/* harmony default export */ __webpack_exports__["a"] = (chevronRight); - - -/***/ }), - -/***/ "1oY3": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InspectorAdvancedControls; }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _fill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("NtoT"); -/* harmony import */ var _slot__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("jwne"); - - - -/** - * Internal dependencies - */ - - -const InspectorControls = _fill__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"]; -InspectorControls.Slot = _slot__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]; // This is just here for backward compatibility. - -const InspectorAdvancedControls = props => { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_fill__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { - __experimentalGroup: "advanced" - })); -}; - -InspectorAdvancedControls.Slot = props => { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_slot__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { - __experimentalGroup: "advanced" - })); -}; - -InspectorAdvancedControls.slotName = 'InspectorAdvancedControls'; -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md - */ - -/* harmony default export */ __webpack_exports__["b"] = (InspectorControls); - - -/***/ }), - -/***/ "1uGa": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("RxS6"); -/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__); - - -/** - * WordPress dependencies - */ - - - - -function DuotoneControl(_ref) { - let { - colorPalette, - duotonePalette, - disableCustomColors, - disableCustomDuotone, - value, - onChange - } = _ref; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Dropdown"], { - popoverProps: { - className: 'block-editor-duotone-control__popover', - headerTitle: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Duotone'), - isAlternate: true - }, - renderToggle: _ref2 => { - let { - isOpen, - onToggle - } = _ref2; - - const openOnArrowDown = event => { - if (!isOpen && event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__["DOWN"]) { - event.preventDefault(); - onToggle(); - } - }; - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["ToolbarButton"], { - showTooltip: true, - onClick: onToggle, - "aria-haspopup": "true", - "aria-expanded": isOpen, - onKeyDown: openOnArrowDown, - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Apply duotone filter'), - icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["DuotoneSwatch"], { - values: value - }) - }); - }, - renderContent: () => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["MenuGroup"], { - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Duotone') - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-duotone-control__description" - }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Create a two-tone color effect without losing your original image.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["DuotonePicker"], { - colorPalette: colorPalette, - duotonePalette: duotonePalette, - disableCustomColors: disableCustomColors, - disableCustomDuotone: disableCustomDuotone, - value: value, - onChange: onChange - })) - }); -} - -/* harmony default export */ __webpack_exports__["a"] = (DuotoneControl); - - -/***/ }), - -/***/ "2YCo": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BorderStyleControl; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/line-solid.js -var line_solid = __webpack_require__("bVTw"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dashed.js - - -/** - * WordPress dependencies - */ - -const lineDashed = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - fillRule: "evenodd", - d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z", - clipRule: "evenodd" -})); -/* harmony default export */ var line_dashed = (lineDashed); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dotted.js - - -/** - * WordPress dependencies - */ - -const lineDotted = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["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" -})); -/* harmony default export */ var line_dotted = (lineDotted); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-style-control/index.js - - -/** - * WordPress dependencies - */ - - - -const BORDER_STYLES = [{ - label: Object(external_wp_i18n_["__"])('Solid'), - icon: line_solid["a" /* default */], - value: 'solid' -}, { - label: Object(external_wp_i18n_["__"])('Dashed'), - icon: line_dashed, - value: 'dashed' -}, { - label: Object(external_wp_i18n_["__"])('Dotted'), - icon: line_dotted, - value: 'dotted' -}]; -/** - * Control to display border style options. - * - * @param {Object} props Component props. - * @param {Function} props.onChange Handler for changing border style selection. - * @param {string} props.value Currently selected border style value. - * - * @return {WPElement} Custom border style segmented control. - */ - -function BorderStyleControl(_ref) { - let { - onChange, - value - } = _ref; - return Object(external_wp_element_["createElement"])("fieldset", { - className: "components-border-style-control" - }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_i18n_["__"])('Style')), Object(external_wp_element_["createElement"])("div", { - className: "components-border-style-control__buttons" - }, BORDER_STYLES.map(borderStyle => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: borderStyle.value, - icon: borderStyle.icon, - isSmall: true, - isPressed: borderStyle.value === value, - onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value), - "aria-label": borderStyle.label - })))); -} - - -/***/ }), - -/***/ "2gm7": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const chevronLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (chevronLeft); - - -/***/ }), - -/***/ "2z9l": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return usePopoverScroll; }); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - -/** - * Allow scrolling "through" popovers over the canvas. This is only called for - * as long as the pointer is over a popover. Do not use React events because it - * will bubble through portals. - * - * @param {Object} scrollableRef - */ - -function usePopoverScroll(scrollableRef) { - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__["useRefEffect"])(node => { - if (!scrollableRef) { - return; - } - - function onWheel(event) { - const { - deltaX, - deltaY - } = event; - scrollableRef.current.scrollBy(deltaX, deltaY); - } // Tell the browser that we do not call event.preventDefault - // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners - - - const options = { - passive: true - }; - node.addEventListener('wheel', onWheel, options); - return () => { - node.removeEventListener('wheel', onWheel, options); - }; - }, [scrollableRef]); -} - - -/***/ }), - -/***/ "5L8O": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export ZWNBSP */ -/* unused harmony export DefaultBlockAppender */ -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("rmEH"); -/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("qrxh"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("BhPs"); - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -/** - * Zero width non-breaking space, used as padding for the paragraph when it is - * empty. - */ - -const ZWNBSP = '\ufeff'; -function DefaultBlockAppender(_ref) { - let { - isLocked, - isVisible, - onAppend, - showPrompt, - placeholder, - rootClientId - } = _ref; - - if (isLocked || !isVisible) { - return null; - } - - const value = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__["decodeEntities"])(placeholder) || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Type / to choose a block'); - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - "data-root-client-id": rootClientId || '', - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('block-editor-default-block-appender', { - 'has-visible-prompt': showPrompt - }) - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", { - tabIndex: "0" // Only necessary for `useCanvasClickRedirect` to consider it - // as a target. Ideally it should consider any tabbable target, - // but the inserter is rendered in place while it should be - // rendered in a popover, just like it does for an empty - // paragraph block. - , - contentEditable: true, - suppressContentEditableWarning: true // We want this element to be styled as a paragraph by themes. - // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role - , - role: "button", - "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Add block') // A wrapping container for this one already has the wp-block className. - , - className: "block-editor-default-block-appender__content", - onFocus: onAppend - }, showPrompt ? value : ZWNBSP), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], { - rootClientId: rootClientId, - position: "bottom right", - isAppender: true, - __experimentalIsQuick: true - })); -} -/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])((select, ownProps) => { - const { - getBlockCount, - getBlockName, - isBlockValid, - getSettings, - getTemplateLock - } = select(_store__WEBPACK_IMPORTED_MODULE_8__[/* store */ "a"]); - const isEmpty = !getBlockCount(ownProps.rootClientId); - const isLastBlockDefault = getBlockName(ownProps.lastBlockClientId) === Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getDefaultBlockName"])(); - const isLastBlockValid = isBlockValid(ownProps.lastBlockClientId); - const { - bodyPlaceholder - } = getSettings(); - return { - isVisible: isEmpty || !isLastBlockDefault || !isLastBlockValid, - showPrompt: isEmpty, - isLocked: !!getTemplateLock(ownProps.rootClientId), - placeholder: bodyPlaceholder - }; -}), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])((dispatch, ownProps) => { - const { - insertDefaultBlock, - startTyping - } = dispatch(_store__WEBPACK_IMPORTED_MODULE_8__[/* store */ "a"]); - return { - onAppend() { - const { - rootClientId - } = ownProps; - insertDefaultBlock(undefined, rootClientId); - startTyping(); - } - - }; -}))(DefaultBlockAppender)); - - -/***/ }), - -/***/ "5gPN": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ utils["a" /* getColorClassName */]; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ utils["b" /* getColorObjectByAttributeValues */]; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ utils["c" /* getColorObjectByColorValue */]; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ createCustomColorsHOC; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ withColors; }); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/utils.js -var utils = __webpack_require__("bVpQ"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js -var use_setting = __webpack_require__("v5LD"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/with-colors.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -/** - * Higher order component factory for injecting the `colorsArray` argument as - * the colors prop in the `withCustomColors` HOC. - * - * @param {Array} colorsArray An array of color objects. - * - * @return {Function} The higher order component. - */ - -const withCustomColorPalette = colorsArray => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => props => Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, props, { - colors: colorsArray -})), 'withCustomColorPalette'); -/** - * Higher order component factory for injecting the editor colors as the - * `colors` prop in the `withColors` HOC. - * - * @return {Function} The higher order component. - */ - - -const withEditorColorPalette = () => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => props => { - // Some color settings have a special handling for deprecated flags in `useSetting`, - // so we can't unwrap them by doing const { ... } = useSetting('color') - // until https://github.com/WordPress/gutenberg/issues/37094 is fixed. - const userPalette = Object(use_setting["a" /* default */])('color.palette.custom'); - const themePalette = Object(use_setting["a" /* default */])('color.palette.theme'); - const defaultPalette = Object(use_setting["a" /* default */])('color.palette.default'); - const allColors = Object(external_wp_element_["useMemo"])(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); - return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, props, { - colors: allColors - })); -}, 'withEditorColorPalette'); -/** - * Helper function used with `createHigherOrderComponent` to create - * higher order components for managing color logic. - * - * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor). - * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent. - * - * @return {WPComponent} The component that can be used as a HOC. - */ - - -function createColorHOC(colorTypes, withColorPalette) { - const colorMap = Object(external_lodash_["reduce"])(colorTypes, (colorObject, colorType) => { - return { ...colorObject, - ...(Object(external_lodash_["isString"])(colorType) ? { - [colorType]: Object(external_lodash_["kebabCase"])(colorType) - } : colorType) - }; - }, {}); - return Object(external_wp_compose_["compose"])([withColorPalette, WrappedComponent => { - return class extends external_wp_element_["Component"] { - constructor(props) { - super(props); - this.setters = this.createSetters(); - this.colorUtils = { - getMostReadableColor: this.getMostReadableColor.bind(this) - }; - this.state = {}; - } - - getMostReadableColor(colorValue) { - const { - colors - } = this.props; - return Object(utils["d" /* getMostReadableColor */])(colors, colorValue); - } - - createSetters() { - return Object(external_lodash_["reduce"])(colorMap, (settersAccumulator, colorContext, colorAttributeName) => { - const upperFirstColorAttributeName = Object(external_lodash_["upperFirst"])(colorAttributeName); - const customColorAttributeName = `custom${upperFirstColorAttributeName}`; - settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName); - return settersAccumulator; - }, {}); - } - - createSetColor(colorAttributeName, customColorAttributeName) { - return colorValue => { - const colorObject = Object(utils["c" /* getColorObjectByColorValue */])(this.props.colors, colorValue); - this.props.setAttributes({ - [colorAttributeName]: colorObject && colorObject.slug ? colorObject.slug : undefined, - [customColorAttributeName]: colorObject && colorObject.slug ? undefined : colorValue - }); - }; - } - - static getDerivedStateFromProps(_ref, previousState) { - let { - attributes, - colors - } = _ref; - return Object(external_lodash_["reduce"])(colorMap, (newState, colorContext, colorAttributeName) => { - const colorObject = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, attributes[colorAttributeName], attributes[`custom${Object(external_lodash_["upperFirst"])(colorAttributeName)}`]); - const previousColorObject = previousState[colorAttributeName]; - const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color; - /** - * The "and previousColorObject" condition checks that a previous color object was already computed. - * At the start previousColorObject and colorValue are both equal to undefined - * bus as previousColorObject does not exist we should compute the object. - */ - - if (previousColor === colorObject.color && previousColorObject) { - newState[colorAttributeName] = previousColorObject; - } else { - newState[colorAttributeName] = { ...colorObject, - class: Object(utils["a" /* getColorClassName */])(colorContext, colorObject.slug) - }; - } - - return newState; - }, {}); - } - - render() { - return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props, { - colors: undefined - }, this.state, this.setters, { - colorUtils: this.colorUtils - })); - } - - }; - }]); -} -/** - * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic - * for class generation color value, retrieval and color attribute setting. - * - * Use this higher-order component to work with a custom set of colors. - * - * @example - * - * ```jsx - * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ]; - * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS ); - * // ... - * export default compose( - * withCustomColors( 'backgroundColor', 'borderColor' ), - * MyColorfulComponent, - * ); - * ``` - * - * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ). - * - * @return {Function} Higher-order component. - */ - - -function createCustomColorsHOC(colorsArray) { - return function () { - const withColorPalette = withCustomColorPalette(colorsArray); - - for (var _len = arguments.length, colorTypes = new Array(_len), _key = 0; _key < _len; _key++) { - colorTypes[_key] = arguments[_key]; - } - - return Object(external_wp_compose_["createHigherOrderComponent"])(createColorHOC(colorTypes, withColorPalette), 'withCustomColors'); - }; -} -/** - * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting. - * - * For use with the default editor/theme color palette. - * - * @example - * - * ```jsx - * export default compose( - * withColors( 'backgroundColor', { textColor: 'color' } ), - * MyColorfulComponent, - * ); - * ``` - * - * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object, - * it should contain the color attribute name as key and the color context as value. - * If the argument is a string the value should be the color attribute name, - * the color context is computed by applying a kebab case transform to the value. - * Color context represents the context/place where the color is going to be used. - * The class name of the color is generated using 'has' followed by the color name - * and ending with the color context all in kebab case e.g: has-green-background-color. - * - * @return {Function} Higher-order component. - */ - -function withColors() { - const withColorPalette = withEditorColorPalette(); - - for (var _len2 = arguments.length, colorTypes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - colorTypes[_key2] = arguments[_key2]; - } - - return Object(external_wp_compose_["createHigherOrderComponent"])(createColorHOC(colorTypes, withColorPalette), 'withColors'); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/index.js - - - - -/***/ }), - -/***/ "6ZVF": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js -var block_icon = __webpack_require__("7SSY"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/item.js -var inserter_listbox_item = __webpack_require__("M+co"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-draggable-blocks/index.js -var inserter_draggable_blocks = __webpack_require__("j6zP"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-list-item/index.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -/** - * Return true if platform is MacOS. - * - * @param {Object} _window window object by default; used for DI testing. - * - * @return {boolean} True if MacOS; false otherwise. - */ - -function isAppleOS() { - let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window; - - const { - platform - } = _window.navigator; - return platform.indexOf('Mac') !== -1 || ['iPad', 'iPhone'].includes(platform); -} - -function InserterListItem(_ref) { - let { - className, - isFirst, - item, - onSelect, - onHover, - isDraggable, - ...props - } = _ref; - const isDragging = Object(external_wp_element_["useRef"])(false); - const itemIconStyle = item.icon ? { - backgroundColor: item.icon.background, - color: item.icon.foreground - } : {}; - const blocks = Object(external_wp_element_["useMemo"])(() => { - return [Object(external_wp_blocks_["createBlock"])(item.name, item.initialAttributes, Object(external_wp_blocks_["createBlocksFromInnerBlocksTemplate"])(item.innerBlocks))]; - }, [item.name, item.initialAttributes, item.initialAttributes]); - return Object(external_wp_element_["createElement"])(inserter_draggable_blocks["a" /* default */], { - isEnabled: isDraggable && !item.disabled, - blocks: blocks, - icon: item.icon - }, _ref2 => { - let { - draggable, - onDragStart, - onDragEnd - } = _ref2; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-types-list__list-item", - draggable: draggable, - onDragStart: event => { - isDragging.current = true; - - if (onDragStart) { - onHover(null); - onDragStart(event); - } - }, - onDragEnd: event => { - isDragging.current = false; - - if (onDragEnd) { - onDragEnd(event); - } - } - }, Object(external_wp_element_["createElement"])(inserter_listbox_item["a" /* default */], Object(esm_extends["a" /* default */])({ - isFirst: isFirst, - className: classnames_default()('block-editor-block-types-list__item', className), - disabled: item.isDisabled, - onClick: event => { - event.preventDefault(); - onSelect(item, isAppleOS() ? event.metaKey : event.ctrlKey); - onHover(null); - }, - onKeyDown: event => { - const { - keyCode - } = event; - - if (keyCode === external_wp_keycodes_["ENTER"]) { - event.preventDefault(); - onSelect(item, isAppleOS() ? event.metaKey : event.ctrlKey); - onHover(null); - } - }, - onFocus: () => { - if (isDragging.current) { - return; - } - - onHover(item); - }, - onMouseEnter: () => { - if (isDragging.current) { - return; - } - - onHover(item); - }, - onMouseLeave: () => onHover(null), - onBlur: () => onHover(null) - }, props), Object(external_wp_element_["createElement"])("span", { - className: "block-editor-block-types-list__item-icon", - style: itemIconStyle - }, Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { - icon: item.icon, - showColors: true - })), Object(external_wp_element_["createElement"])("span", { - className: "block-editor-block-types-list__item-title" - }, item.title))); - }); -} - -/* harmony default export */ var inserter_list_item = (Object(external_wp_element_["memo"])(InserterListItem)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/group.js -var group = __webpack_require__("xkPd"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/row.js -var inserter_listbox_row = __webpack_require__("HC45"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-types-list/index.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -function chunk(array, size) { - const chunks = []; - - for (let i = 0, j = array.length; i < j; i += size) { - chunks.push(array.slice(i, i + size)); - } - - return chunks; -} - -function BlockTypesList(_ref) { - let { - items = [], - onSelect, - onHover = () => {}, - children, - label, - isDraggable = true - } = _ref; - return Object(external_wp_element_["createElement"])(group["a" /* default */], { - className: "block-editor-block-types-list", - "aria-label": label - }, chunk(items, 3).map((row, i) => Object(external_wp_element_["createElement"])(inserter_listbox_row["a" /* default */], { - key: i - }, row.map((item, j) => Object(external_wp_element_["createElement"])(inserter_list_item, { - key: item.id, - item: item, - className: Object(external_wp_blocks_["getBlockMenuDefaultClassName"])(item.id), - onSelect: onSelect, - onHover: onHover, - isDraggable: isDraggable, - isFirst: i === 0 && j === 0 - })))), children); -} - -/* harmony default export */ var block_types_list = __webpack_exports__["a"] = (BlockTypesList); - - -/***/ }), - -/***/ "6c9H": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var colord__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fHnH"); -/* harmony import */ var colord_plugins_names__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("abaT"); -/* harmony import */ var colord_plugins_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("7bKH"); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("gdqT"); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__); - - -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - - - - -Object(colord__WEBPACK_IMPORTED_MODULE_1__[/* extend */ "b"])([colord_plugins_names__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], colord_plugins_a11y__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]]); - -function ContrastCheckerMessage(_ref) { - let { - colordBackgroundColor, - colordTextColor, - backgroundColor, - textColor - } = _ref; - const msg = colordBackgroundColor.brightness() < colordTextColor.brightness() ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'); // Note: The `Notice` component can speak messages via its `spokenMessage` - // prop, but the contrast checker requires granular control over when the - // announcements are made. Notably, the message will be re-announced if a - // new color combination is selected and the contrast is still insufficient. - - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => { - Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_4__["speak"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('This color combination may be hard for people to read.')); - }, [backgroundColor, textColor]); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-contrast-checker" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["Notice"], { - spokenMessage: null, - status: "warning", - isDismissible: false - }, msg)); -} - -function ContrastChecker(_ref2) { - let { - backgroundColor, - fallbackBackgroundColor, - fallbackTextColor, - fontSize, - // font size value in pixels - isLargeText, - textColor - } = _ref2; - - if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) { - return null; - } - - const colordBackgroundColor = Object(colord__WEBPACK_IMPORTED_MODULE_1__[/* colord */ "a"])(backgroundColor || fallbackBackgroundColor); - const colordTextColor = Object(colord__WEBPACK_IMPORTED_MODULE_1__[/* colord */ "a"])(textColor || fallbackTextColor); - const hasTransparency = colordBackgroundColor.alpha() !== 1 || colordTextColor.alpha() !== 1; - - if (hasTransparency || colordTextColor.isReadable(colordBackgroundColor, { - level: 'AA', - size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small' - })) { - return null; - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(ContrastCheckerMessage, { - backgroundColor: backgroundColor, - textColor: textColor, - colordBackgroundColor: colordBackgroundColor, - colordTextColor: colordTextColor - }); -} - -/* harmony default export */ __webpack_exports__["a"] = (ContrastChecker); - - -/***/ }), - -/***/ "6jxZ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useFocusHandler; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("OL6h"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -/** - * Selects the block if it receives focus. - * - * @param {string} clientId Block client ID. - */ - -function useFocusHandler(clientId) { - const { - isBlockSelected - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); - const { - selectBlock, - selectionChange - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["useRefEffect"])(node => { - /** - * Marks the block as selected when focused and not already - * selected. This specifically handles the case where block does not - * set focus on its own (via `setFocus`), typically if there is no - * focusable input in the block. - * - * @param {FocusEvent} event Focus event. - */ - function onFocus(event) { - // Check synchronously because a non-selected block might be - // getting data through `useSelect` asynchronously. - if (isBlockSelected(clientId)) { - // Potentially change selection away from rich text. - if (!event.target.isContentEditable) { - selectionChange(clientId); - } - - return; - } // If an inner block is focussed, that block is resposible for - // setting the selected block. - - - if (!Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__[/* isInsideRootBlock */ "c"])(node, event.target)) { - return; - } - - selectBlock(clientId); - } - - node.addEventListener('focusin', onFocus); - return () => { - node.removeEventListener('focusin', onFocus); - }; - }, [isBlockSelected, selectBlock]); -} - - -/***/ }), - -/***/ "715p": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cleanEmptyObject; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/** - * External dependencies - */ - -/** - * Removed falsy values from nested object. - * - * @param {*} object - * @return {*} Object cleaned from falsy values - */ - -const cleanEmptyObject = object => { - if (!Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isObject"])(object) || Array.isArray(object)) { - return object; - } - - const cleanedNestedObjects = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["pickBy"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["mapValues"])(object, cleanEmptyObject), lodash__WEBPACK_IMPORTED_MODULE_0__["identity"]); - return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEmpty"])(cleanedNestedObjects) ? undefined : cleanedNestedObjects; -}; - - -/***/ }), - -/***/ "7NR9": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","tokenList"] -var external_wp_tokenList_ = __webpack_require__("BLeD"); -var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/utils.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Returns the active style from the given className. - * - * @param {Array} styles Block style variations. - * @param {string} className Class name - * - * @return {Object?} The active style. - */ - -function getActiveStyle(styles, className) { - for (const style of new external_wp_tokenList_default.a(className).values()) { - if (style.indexOf('is-style-') === -1) { - continue; - } - - const potentialStyleName = style.substring(9); - const activeStyle = Object(external_lodash_["find"])(styles, { - name: potentialStyleName - }); - - if (activeStyle) { - return activeStyle; - } - } - - return Object(external_lodash_["find"])(styles, 'isDefault'); -} -/** - * Replaces the active style in the block's className. - * - * @param {string} className Class name. - * @param {Object?} activeStyle The replaced style. - * @param {Object} newStyle The replacing style. - * - * @return {string} The updated className. - */ - -function replaceActiveStyle(className, activeStyle, newStyle) { - const list = new external_wp_tokenList_default.a(className); - - if (activeStyle) { - list.remove('is-style-' + activeStyle.name); - } - - list.add('is-style-' + newStyle.name); - return list.value; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js + 2 modules -var block_preview = __webpack_require__("REKd"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -const EMPTY_OBJECT = {}; - -function useGenericPreviewBlock(block, type) { - return Object(external_wp_element_["useMemo"])(() => { - const example = type === null || type === void 0 ? void 0 : type.example; - const blockName = type === null || type === void 0 ? void 0 : type.name; - - if (example && blockName) { - return Object(external_wp_blocks_["getBlockFromExample"])(blockName, { - attributes: example.attributes, - innerBlocks: example.innerBlocks - }); - } - - if (block) { - return Object(external_wp_blocks_["cloneBlock"])(block); - } - }, [type !== null && type !== void 0 && type.example ? block === null || block === void 0 ? void 0 : block.name : block, type]); -} - -function BlockStyles(_ref) { - let { - clientId, - onSwitch = external_lodash_["noop"], - onHoverClassName = external_lodash_["noop"], - itemRole - } = _ref; - - const selector = select => { - const { - getBlock - } = select(store["a" /* store */]); - const block = getBlock(clientId); - - if (!block) { - return EMPTY_OBJECT; - } - - const blockType = Object(external_wp_blocks_["getBlockType"])(block.name); - const { - getBlockStyles - } = select(external_wp_blocks_["store"]); - return { - block, - type: blockType, - styles: getBlockStyles(block.name), - className: block.attributes.className || '' - }; - }; - - const { - styles, - block, - type, - className - } = Object(external_wp_data_["useSelect"])(selector, [clientId]); - const { - updateBlockAttributes - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const genericPreviewBlock = useGenericPreviewBlock(block, type); - - if (!styles || styles.length === 0) { - return null; - } - - const renderedStyles = Object(external_lodash_["find"])(styles, 'isDefault') ? styles : [{ - name: 'default', - label: Object(external_wp_i18n_["_x"])('Default', 'block style'), - isDefault: true - }, ...styles]; - const activeStyle = getActiveStyle(renderedStyles, className); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-styles" - }, renderedStyles.map(style => { - var _type$example$viewpor, _type$example; - - const styleClassName = replaceActiveStyle(className, activeStyle, style); - return Object(external_wp_element_["createElement"])(BlockStyleItem, { - genericPreviewBlock: genericPreviewBlock, - viewportWidth: (_type$example$viewpor = (_type$example = type.example) === null || _type$example === void 0 ? void 0 : _type$example.viewportWidth) !== null && _type$example$viewpor !== void 0 ? _type$example$viewpor : 500, - className: className, - isActive: activeStyle === style, - key: style.name, - onSelect: () => { - updateBlockAttributes(clientId, { - className: styleClassName - }); - onHoverClassName(null); - onSwitch(); - }, - onBlur: () => onHoverClassName(null), - onHover: () => onHoverClassName(styleClassName), - style: style, - styleClassName: styleClassName, - itemRole: itemRole - }); - })); -} - -function BlockStyleItem(_ref2) { - let { - genericPreviewBlock, - viewportWidth, - style, - isActive, - onBlur, - onHover, - onSelect, - styleClassName, - itemRole - } = _ref2; - const previewBlocks = Object(external_wp_element_["useMemo"])(() => { - return { ...genericPreviewBlock, - attributes: { ...genericPreviewBlock.attributes, - className: styleClassName - } - }; - }, [genericPreviewBlock, styleClassName]); - return Object(external_wp_element_["createElement"])("div", { - key: style.name, - className: classnames_default()('block-editor-block-styles__item', { - 'is-active': isActive - }), - onClick: () => onSelect(), - onKeyDown: event => { - if (external_wp_keycodes_["ENTER"] === event.keyCode || external_wp_keycodes_["SPACE"] === event.keyCode) { - event.preventDefault(); - onSelect(); - } - }, - onMouseEnter: onHover, - onMouseLeave: onBlur, - role: itemRole || 'button', - tabIndex: "0", - "aria-label": style.label || style.name - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-styles__item-preview" - }, Object(external_wp_element_["createElement"])(block_preview["a" /* default */], { - viewportWidth: viewportWidth, - blocks: previewBlocks - })), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-styles__item-label" - }, style.label || style.name)); -} - -/* harmony default export */ var block_styles = __webpack_exports__["a"] = (BlockStyles); - - -/***/ }), - -/***/ "7SSY": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("//Lo"); - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -function BlockIcon(_ref) { - var _icon; - - let { - icon, - showColors = false, - className - } = _ref; - - if (((_icon = icon) === null || _icon === void 0 ? void 0 : _icon.src) === 'block-default') { - icon = { - src: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"] - }; - } - - const renderedIcon = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Icon"], { - icon: icon && icon.src ? icon.src : icon - }); - const style = showColors ? { - backgroundColor: icon && icon.background, - color: icon && icon.foreground - } : {}; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { - style: style, - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('block-editor-block-icon', className, { - 'has-colors': showColors - }) - }, renderedIcon); -} - -/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["memo"])(BlockIcon)); - - -/***/ }), - -/***/ "7bKH": -/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { - -"use strict"; -var o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},t=function(t){return.2126*o(t.r)+.7152*o(t.g)+.0722*o(t.b)};/* harmony default export */ __webpack_exports__["a"] = (function(o){o.prototype.luminance=function(){return o=t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=t(e),d=t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}}); - - -/***/ }), - -/***/ "7fqt": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["wordcount"]; }()); - -/***/ }), - -/***/ "8oxB": -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "9Do8": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__("zt9T"); - -/***/ }), - -/***/ "9Ma0": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ BlockMoverUpButton; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockMoverDownButton; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js -var chevron_right = __webpack_require__("1iEr"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js -var chevron_left = __webpack_require__("2gm7"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js -var chevron_up = __webpack_require__("XgzB"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js -var chevron_down = __webpack_require__("NWDH"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/mover-description.js -/** - * WordPress dependencies - */ - -/** - * Return a label for the block movement controls depending on block position. - * - * @param {number} selectedCount Number of blocks selected. - * @param {string} type Block type - in the case of a single block, should - * define its 'type'. I.e. 'Text', 'Heading', 'Image' etc. - * @param {number} firstIndex The index (position - 1) of the first block selected. - * @param {boolean} isFirst This is the first block. - * @param {boolean} isLast This is the last block. - * @param {number} dir Direction of movement (> 0 is considered to be going - * down, < 0 is up). - * @param {string} orientation The orientation of the block movers, vertical or - * horizontal. - * - * @return {string} Label for the block movement controls. - */ - -function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLast, dir, orientation) { - const position = firstIndex + 1; - - const getMovementDirection = moveDirection => { - if (moveDirection === 'up') { - if (orientation === 'horizontal') { - return Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left'; - } - - return 'up'; - } else if (moveDirection === 'down') { - if (orientation === 'horizontal') { - return Object(external_wp_i18n_["isRTL"])() ? 'left' : 'right'; - } - - return 'down'; - } - - return null; - }; - - if (selectedCount > 1) { - return getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir); - } - - if (isFirst && isLast) { - return Object(external_wp_i18n_["sprintf"])( // translators: %s: Type of block (i.e. Text, Image etc) - Object(external_wp_i18n_["__"])('Block %s is the only block, and cannot be moved'), type); - } - - if (dir > 0 && !isLast) { - // moving down - const movementDirection = getMovementDirection('down'); - - if (movementDirection === 'down') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position - Object(external_wp_i18n_["__"])('Move %1$s block from position %2$d down to position %3$d'), type, position, position + 1); - } - - if (movementDirection === 'left') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position - Object(external_wp_i18n_["__"])('Move %1$s block from position %2$d left to position %3$d'), type, position, position + 1); - } - - if (movementDirection === 'right') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position - Object(external_wp_i18n_["__"])('Move %1$s block from position %2$d right to position %3$d'), type, position, position + 1); - } - } - - if (dir > 0 && isLast) { - // moving down, and is the last item - const movementDirection = getMovementDirection('down'); - - if (movementDirection === 'down') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc) - Object(external_wp_i18n_["__"])('Block %1$s is at the end of the content and can’t be moved down'), type); - } - - if (movementDirection === 'left') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc) - Object(external_wp_i18n_["__"])('Block %1$s is at the end of the content and can’t be moved left'), type); - } - - if (movementDirection === 'right') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc) - Object(external_wp_i18n_["__"])('Block %1$s is at the end of the content and can’t be moved right'), type); - } - } - - if (dir < 0 && !isFirst) { - // moving up - const movementDirection = getMovementDirection('up'); - - if (movementDirection === 'up') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position - Object(external_wp_i18n_["__"])('Move %1$s block from position %2$d up to position %3$d'), type, position, position - 1); - } - - if (movementDirection === 'left') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position - Object(external_wp_i18n_["__"])('Move %1$s block from position %2$d left to position %3$d'), type, position, position - 1); - } - - if (movementDirection === 'right') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position - Object(external_wp_i18n_["__"])('Move %1$s block from position %2$d right to position %3$d'), type, position, position - 1); - } - } - - if (dir < 0 && isFirst) { - // moving up, and is the first item - const movementDirection = getMovementDirection('up'); - - if (movementDirection === 'up') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc) - Object(external_wp_i18n_["__"])('Block %1$s is at the beginning of the content and can’t be moved up'), type); - } - - if (movementDirection === 'left') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc) - Object(external_wp_i18n_["__"])('Block %1$s is at the beginning of the content and can’t be moved left'), type); - } - - if (movementDirection === 'right') { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc) - Object(external_wp_i18n_["__"])('Block %1$s is at the beginning of the content and can’t be moved right'), type); - } - } -} -/** - * Return a label for the block movement controls depending on block position. - * - * @param {number} selectedCount Number of blocks selected. - * @param {number} firstIndex The index (position - 1) of the first block selected. - * @param {boolean} isFirst This is the first block. - * @param {boolean} isLast This is the last block. - * @param {number} dir Direction of movement (> 0 is considered to be going - * down, < 0 is up). - * - * @return {string} Label for the block movement controls. - */ - -function getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir) { - const position = firstIndex + 1; - - if (dir < 0 && isFirst) { - return Object(external_wp_i18n_["__"])('Blocks cannot be moved up as they are already at the top'); - } - - if (dir > 0 && isLast) { - return Object(external_wp_i18n_["__"])('Blocks cannot be moved down as they are already at the bottom'); - } - - if (dir < 0 && !isFirst) { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Number of selected blocks, 2: Position of selected blocks - Object(external_wp_i18n_["_n"])('Move %1$d block from position %2$d up by one place', 'Move %1$d blocks from position %2$d up by one place', selectedCount), selectedCount, position); - } - - if (dir > 0 && !isLast) { - return Object(external_wp_i18n_["sprintf"])( // translators: 1: Number of selected blocks, 2: Position of selected blocks - Object(external_wp_i18n_["_n"])('Move %1$d block from position %2$d down by one place', 'Move %1$d blocks from position %2$d down by one place', selectedCount), selectedCount, position); - } -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/button.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - -const getArrowIcon = (direction, orientation) => { - if (direction === 'up') { - if (orientation === 'horizontal') { - return Object(external_wp_i18n_["isRTL"])() ? chevron_right["a" /* default */] : chevron_left["a" /* default */]; - } - - return chevron_up["a" /* default */]; - } else if (direction === 'down') { - if (orientation === 'horizontal') { - return Object(external_wp_i18n_["isRTL"])() ? chevron_left["a" /* default */] : chevron_right["a" /* default */]; - } - - return chevron_down["a" /* default */]; - } - - return null; -}; - -const getMovementDirectionLabel = (moveDirection, orientation) => { - if (moveDirection === 'up') { - if (orientation === 'horizontal') { - return Object(external_wp_i18n_["isRTL"])() ? Object(external_wp_i18n_["__"])('Move right') : Object(external_wp_i18n_["__"])('Move left'); - } - - return Object(external_wp_i18n_["__"])('Move up'); - } else if (moveDirection === 'down') { - if (orientation === 'horizontal') { - return Object(external_wp_i18n_["isRTL"])() ? Object(external_wp_i18n_["__"])('Move left') : Object(external_wp_i18n_["__"])('Move right'); - } - - return Object(external_wp_i18n_["__"])('Move down'); - } - - return null; -}; - -const BlockMoverButton = Object(external_wp_element_["forwardRef"])((_ref, ref) => { - let { - clientIds, - direction, - orientation: moverOrientation, - ...props - } = _ref; - const instanceId = Object(external_wp_compose_["useInstanceId"])(BlockMoverButton); - const blocksCount = Object(external_lodash_["castArray"])(clientIds).length; - const { - blockType, - isDisabled, - rootClientId, - isFirst, - isLast, - firstIndex, - orientation = 'vertical' - } = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockIndex, - getBlockRootClientId, - getBlockOrder, - getBlock, - getBlockListSettings - } = select(store["a" /* store */]); - const normalizedClientIds = Object(external_lodash_["castArray"])(clientIds); - const firstClientId = Object(external_lodash_["first"])(normalizedClientIds); - const blockRootClientId = getBlockRootClientId(firstClientId); - const firstBlockIndex = getBlockIndex(firstClientId); - const lastBlockIndex = getBlockIndex(Object(external_lodash_["last"])(normalizedClientIds)); - const blockOrder = getBlockOrder(blockRootClientId); - const block = getBlock(firstClientId); - const isFirstBlock = firstBlockIndex === 0; - const isLastBlock = lastBlockIndex === blockOrder.length - 1; - const { - orientation: blockListOrientation - } = getBlockListSettings(blockRootClientId) || {}; - return { - blockType: block ? Object(external_wp_blocks_["getBlockType"])(block.name) : null, - isDisabled: direction === 'up' ? isFirstBlock : isLastBlock, - rootClientId: blockRootClientId, - firstIndex: firstBlockIndex, - isFirst: isFirstBlock, - isLast: isLastBlock, - orientation: moverOrientation || blockListOrientation - }; - }, [clientIds, direction]); - const { - moveBlocksDown, - moveBlocksUp - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const moverFunction = direction === 'up' ? moveBlocksUp : moveBlocksDown; - - const onClick = event => { - moverFunction(clientIds, rootClientId); - - if (props.onClick) { - props.onClick(event); - } - }; - - const descriptionId = `block-editor-block-mover-button__description-${instanceId}`; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({ - ref: ref, - className: classnames_default()('block-editor-block-mover-button', `is-${direction}-button`), - icon: getArrowIcon(direction, orientation), - label: getMovementDirectionLabel(direction, orientation), - "aria-describedby": descriptionId - }, props, { - onClick: isDisabled ? null : onClick, - "aria-disabled": isDisabled - })), Object(external_wp_element_["createElement"])("span", { - id: descriptionId, - className: "block-editor-block-mover-button__description" - }, getBlockMoverDescription(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, direction === 'up' ? -1 : 1, orientation))); -}); -const BlockMoverUpButton = Object(external_wp_element_["forwardRef"])((props, ref) => { - return Object(external_wp_element_["createElement"])(BlockMoverButton, Object(esm_extends["a" /* default */])({ - direction: "up", - ref: ref - }, props)); -}); -const BlockMoverDownButton = Object(external_wp_element_["forwardRef"])((props, ref) => { - return Object(external_wp_element_["createElement"])(BlockMoverButton, Object(esm_extends["a" /* default */])({ - direction: "down", - ref: ref - }, props)); -}); - - -/***/ }), - -/***/ "9XVa": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ utils["a" /* getFontSize */]; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ utils["b" /* getFontSizeClass */]; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ utils["c" /* getFontSizeObjectByValue */]; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ font_size_picker["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ with_font_sizes; }); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/utils.js -var utils = __webpack_require__("NMUH"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js -var font_size_picker = __webpack_require__("QP/w"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js -var use_setting = __webpack_require__("v5LD"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/with-font-sizes.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -const DEFAULT_FONT_SIZES = []; -/** - * Higher-order component, which handles font size logic for class generation, - * font size value retrieval, and font size change handling. - * - * @param {...(Object|string)} fontSizeNames The arguments should all be strings. - * Each string contains the font size - * attribute name e.g: 'fontSize'. - * - * @return {Function} Higher-order component. - */ - -/* harmony default export */ var with_font_sizes = (function () { - for (var _len = arguments.length, fontSizeNames = new Array(_len), _key = 0; _key < _len; _key++) { - fontSizeNames[_key] = arguments[_key]; - } - - /* - * Computes an object whose key is the font size attribute name as passed in the array, - * and the value is the custom font size attribute name. - * Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized. - */ - const fontSizeAttributeNames = Object(external_lodash_["reduce"])(fontSizeNames, (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => { - fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${Object(external_lodash_["upperFirst"])(fontSizeAttributeName)}`; - return fontSizeAttributeNamesAccumulator; - }, {}); - return Object(external_wp_compose_["createHigherOrderComponent"])(Object(external_wp_compose_["compose"])([Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => props => { - const fontSizes = Object(use_setting["a" /* default */])('typography.fontSizes') || DEFAULT_FONT_SIZES; - return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, props, { - fontSizes: fontSizes - })); - }, 'withFontSizes'), WrappedComponent => { - return class extends external_wp_element_["Component"] { - constructor(props) { - super(props); - this.setters = this.createSetters(); - this.state = {}; - } - - createSetters() { - return Object(external_lodash_["reduce"])(fontSizeAttributeNames, (settersAccumulator, customFontSizeAttributeName, fontSizeAttributeName) => { - const upperFirstFontSizeAttributeName = Object(external_lodash_["upperFirst"])(fontSizeAttributeName); - settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName); - return settersAccumulator; - }, {}); - } - - createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) { - return fontSizeValue => { - const fontSizeObject = Object(external_lodash_["find"])(this.props.fontSizes, { - size: Number(fontSizeValue) - }); - this.props.setAttributes({ - [fontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : undefined, - [customFontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? undefined : fontSizeValue - }); - }; - } - - static getDerivedStateFromProps(_ref, previousState) { - let { - attributes, - fontSizes - } = _ref; - - const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => { - if (previousState[fontSizeAttributeName]) { - // if new font size is name compare with the previous slug - if (attributes[fontSizeAttributeName]) { - return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug; - } // if font size is not named, update when the font size value changes. - - - return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName]; - } // in this case we need to build the font size object - - - return true; - }; - - if (!Object(external_lodash_["some"])(fontSizeAttributeNames, didAttributesChange)) { - return null; - } - - const newState = Object(external_lodash_["reduce"])(Object(external_lodash_["pickBy"])(fontSizeAttributeNames, didAttributesChange), (newStateAccumulator, customFontSizeAttributeName, fontSizeAttributeName) => { - const fontSizeAttributeValue = attributes[fontSizeAttributeName]; - const fontSizeObject = Object(utils["a" /* getFontSize */])(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]); - newStateAccumulator[fontSizeAttributeName] = { ...fontSizeObject, - class: Object(utils["b" /* getFontSizeClass */])(fontSizeAttributeValue) - }; - return newStateAccumulator; - }, {}); - return { ...previousState, - ...newState - }; - } - - render() { - return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props, { - fontSizes: undefined - }, this.state, this.setters)); - } - - }; - }]), 'withFontSizes'); -}); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js - - - - - -/***/ }), - -/***/ "AHN3": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return STORE_NAME; }); -const STORE_NAME = 'core/block-editor'; - - -/***/ }), - -/***/ "AORF": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("gdqT"); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("BhPs"); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - -/** - * @typedef WPInserterConfig - * - * @property {string=} rootClientId If set, insertion will be into the - * block with this ID. - * @property {number=} insertionIndex If set, insertion will be into this - * explicit position. - * @property {string=} clientId If set, insertion will be after the - * block with this ID. - * @property {boolean=} isAppender Whether the inserter is an appender - * or not. - * @property {Function=} onSelect Called after insertion. - */ - -/** - * Returns the insertion point state given the inserter config. - * - * @param {WPInserterConfig} config Inserter Config. - * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle). - */ - -function useInsertionPoint(_ref) { - let { - rootClientId = '', - insertionIndex, - clientId, - isAppender, - onSelect, - shouldFocusBlock = true - } = _ref; - const { - getSelectedBlock - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_6__[/* store */ "a"]); - const { - destinationRootClientId, - destinationIndex - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => { - const { - getSelectedBlockClientId, - getBlockRootClientId, - getBlockIndex, - getBlockOrder - } = select(_store__WEBPACK_IMPORTED_MODULE_6__[/* store */ "a"]); - const selectedBlockClientId = getSelectedBlockClientId(); - let _destinationRootClientId = rootClientId; - - let _destinationIndex; - - if (insertionIndex !== undefined) { - // Insert into a specific index. - _destinationIndex = insertionIndex; - } else if (clientId) { - // Insert after a specific client ID. - _destinationIndex = getBlockIndex(clientId); - } else if (!isAppender && selectedBlockClientId) { - _destinationRootClientId = getBlockRootClientId(selectedBlockClientId); - _destinationIndex = getBlockIndex(selectedBlockClientId) + 1; - } else { - // Insert at the end of the list. - _destinationIndex = getBlockOrder(_destinationRootClientId).length; - } - - return { - destinationRootClientId: _destinationRootClientId, - destinationIndex: _destinationIndex - }; - }, [rootClientId, insertionIndex, clientId, isAppender]); - const { - replaceBlocks, - insertBlocks, - showInsertionPoint, - hideInsertionPoint - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_6__[/* store */ "a"]); - const onInsertBlocks = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["useCallback"])(function (blocks, meta) { - let shouldForceFocusBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - const selectedBlock = getSelectedBlock(); - - if (!isAppender && selectedBlock && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["isUnmodifiedDefaultBlock"])(selectedBlock)) { - replaceBlocks(selectedBlock.clientId, blocks, null, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta); - } else { - insertBlocks(blocks, destinationIndex, destinationRootClientId, true, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta); - } - - const message = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["sprintf"])( // translators: %d: the name of the block that has been added - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["_n"])('%d block added.', '%d blocks added.', Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(blocks).length), Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(blocks).length); - Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_4__["speak"])(message); - - if (onSelect) { - onSelect(); - } - }, [isAppender, getSelectedBlock, replaceBlocks, insertBlocks, destinationRootClientId, destinationIndex, onSelect, shouldFocusBlock]); - const onToggleInsertionPoint = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["useCallback"])(show => { - if (show) { - showInsertionPoint(destinationRootClientId, destinationIndex); - } else { - hideInsertionPoint(); - } - }, [showInsertionPoint, hideInsertionPoint, destinationRootClientId, destinationIndex]); - return [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint]; -} - -/* harmony default export */ __webpack_exports__["a"] = (useInsertionPoint); - - -/***/ }), - -/***/ "B9Az": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js - - -/** - * WordPress dependencies - */ - -const pencil = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z" -})); -/* harmony default export */ var library_pencil = (pencil); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js -/** - * Internal dependencies - */ - -/* harmony default export */ var edit = __webpack_exports__["a"] = (library_pencil); - - -/***/ }), - -/***/ "BCrt": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ transform_styles["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ validateThemeColors; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ validateThemeGradients; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ block_variation_transforms["a" /* __experimentalGetMatchingVariation */]; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ parse_css_unit_to_px; }); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js + 8 modules -var transform_styles = __webpack_require__("vSu0"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/defaults.js -var defaults = __webpack_require__("lJLt"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/theme.js -/** - * Internal dependencies - */ - -/** - * Given an array of theme colors checks colors for validity - * - * @param {Array} colors The array of theme colors - * - * @return {Array} The array of valid theme colors or the default colors - */ - -function validateThemeColors(colors) { - if (colors === undefined) { - colors = defaults["b" /* SETTINGS_DEFAULTS */].colors; - } else { - const validColors = colors.filter(c => c.color); - - if (validColors.length === 0) { - colors = defaults["b" /* SETTINGS_DEFAULTS */].colors; - } else if (validColors.length < colors.length) { - // Filter out invalid colors - colors = validColors; - } - } - - return colors; -} -/** - * Given an array of theme gradients checks gradients for validity - * - * @param {Array} gradients The array of theme gradients - * - * @return {Array} The array of valid theme gradients or the default gradients - */ - -function validateThemeGradients(gradients) { - if (gradients === undefined) { - gradients = defaults["b" /* SETTINGS_DEFAULTS */].gradients; - } else { - const validGradients = gradients.filter(c => c.gradient); - - if (validGradients.length === 0) { - gradients = defaults["b" /* SETTINGS_DEFAULTS */].gradients; - } else if (validGradients.length < gradients.length) { - // Filter out invalid gradients - gradients = validGradients; - } - } - - return gradients; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/block-variation-transforms.js -var block_variation_transforms = __webpack_require__("Btt3"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/parse-css-unit-to-px.js -/** - * Converts string to object { value, unit }. - * - * @param {string} cssUnit - * @return {Object} parsedUnit - */ -function parseUnit(cssUnit) { - const match = cssUnit === null || cssUnit === void 0 ? void 0 : cssUnit.trim().match(/^(0?[-.]?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/); - - if (!isNaN(cssUnit) && !isNaN(parseFloat(cssUnit))) { - return { - value: parseFloat(cssUnit), - unit: 'px' - }; - } - - return match ? { - value: parseFloat(match[1]) || match[1], - unit: match[2] - } : { - value: cssUnit, - unit: undefined - }; -} -/** - * Evaluate a math expression. - * - * @param {string} expression - * @return {number} evaluated expression. - */ - - -function calculate(expression) { - return Function(`'use strict'; return (${expression})`)(); -} -/** - * Calculates the css function value for the supported css functions such as max, min, clamp and calc. - * - * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops. - * @param {Object} options - * @return {string} unit containing the unit in PX. - */ - - -function getFunctionUnitValue(functionUnitValue, options) { - const functionUnit = functionUnitValue.split(/[(),]/g).filter(Boolean); - const units = functionUnit.slice(1).map(unit => parseUnit(getPxFromCssUnit(unit, options)).value).filter(Boolean); - - switch (functionUnit[0]) { - case 'min': - return Math.min(...units) + 'px'; - - case 'max': - return Math.max(...units) + 'px'; - - case 'clamp': - if (units.length !== 3) { - return null; - } - - if (units[1] < units[0]) { - return units[0] + 'px'; - } - - if (units[1] > units[2]) { - return units[2] + 'px'; - } - - return units[1] + 'px'; - - case 'calc': - return units[0] + 'px'; - } -} -/** - * Take a css function such as min, max, calc, clamp and returns parsedUnit - * - * How this works for the nested function is that it first replaces the inner function call. - * Then it tackles the outer onces. - * So for example: min( max(25px, 35px), 40px ) - * in the first pass we would replace max(25px, 35px) with 35px. - * then we would try to evaluate min( 35px, 40px ) - * and then finally return 35px. - * - * @param {string} cssUnit - * @return {Object} parsedUnit object. - */ - - -function parseUnitFunction(cssUnit) { - while (true) { - const currentCssUnit = cssUnit; - const regExp = /(max|min|calc|clamp)\(([^()]*)\)/g; - const matches = regExp.exec(cssUnit) || []; - - if (matches[0]) { - const functionUnitValue = getFunctionUnitValue(matches[0]); - cssUnit = cssUnit.replace(matches[0], functionUnitValue); - } // if the unit hasn't been modified or we have a single value break free. - - - if (cssUnit === currentCssUnit || parseFloat(cssUnit)) { - break; - } - } - - return parseUnit(cssUnit); -} -/** - * Return true if we think this is a math expression. - * - * @param {string} cssUnit the cssUnit value being evaluted. - * @return {boolean} Whether the cssUnit is a math expression. - */ - - -function isMathExpression(cssUnit) { - for (let i = 0; i < cssUnit.length; i++) { - if (['+', '-', '/', '*'].includes(cssUnit[i])) { - return true; - } - } - - return false; -} -/** - * Evaluates the math expression and return a px value. - * - * @param {string} cssUnit the cssUnit value being evaluted. - * @return {string} return a converfted value to px. - */ - - -function evalMathExpression(cssUnit) { - let errorFound = false; // Convert every part of the expression to px values. - - const cssUnitsBits = cssUnit.split(/[+-/*/]/g).filter(Boolean); - - for (const unit of cssUnitsBits) { - // Standardize the unit to px and extract the value. - const parsedUnit = parseUnit(getPxFromCssUnit(unit)); - - if (!parseFloat(parsedUnit.value)) { - errorFound = true; // end early since we are dealing with a null value. - - break; - } - - cssUnit = cssUnit.replace(unit, parsedUnit.value); - } - - return errorFound ? null : calculate(cssUnit).toFixed(0) + 'px'; -} -/** - * Convert a parsedUnit object to px value. - * - * @param {Object} parsedUnit - * @param {Object} options - * @return {string} or {null} returns the converted with in a px value format. - */ - - -function convertParsedUnitToPx(parsedUnit, options) { - const PIXELS_PER_INCH = 96; - const ONE_PERCENT = 0.01; - const defaultProperties = { - fontSize: 16, - lineHeight: 16, - width: 375, - height: 812, - type: 'font' - }; - const setOptions = Object.assign({}, defaultProperties, options); - const relativeUnits = { - em: setOptions.fontSize, - rem: setOptions.fontSize, - vh: setOptions.height * ONE_PERCENT, - vw: setOptions.width * ONE_PERCENT, - vmin: (setOptions.width < setOptions.height ? setOptions.width : setOptions.height) * ONE_PERCENT, - vmax: (setOptions.width > setOptions.height ? setOptions.width : setOptions.height) * ONE_PERCENT, - '%': (setOptions.type === 'font' ? setOptions.fontSize : setOptions.width) * ONE_PERCENT, - ch: 8, - // The advance measure (width) of the glyph "0" of the element's font. Approximate - ex: 7.15625, - // x-height of the element's font. Approximate - lh: setOptions.lineHeight - }; - const absoluteUnits = { - in: PIXELS_PER_INCH, - cm: PIXELS_PER_INCH / 2.54, - mm: PIXELS_PER_INCH / 25.4, - pt: PIXELS_PER_INCH / 72, - pc: PIXELS_PER_INCH / 6, - px: 1, - Q: PIXELS_PER_INCH / 2.54 / 40 - }; - - if (relativeUnits[parsedUnit.unit]) { - return (relativeUnits[parsedUnit.unit] * parsedUnit.value).toFixed(0) + 'px'; - } - - if (absoluteUnits[parsedUnit.unit]) { - return (absoluteUnits[parsedUnit.unit] * parsedUnit.value).toFixed(0) + 'px'; - } - - return null; -} -/** - * Returns the px value of a cssUnit. - * - * @param {string} cssUnit - * @param {Object} options - * @return {string} returns the cssUnit value in a simple px format. - */ - - -function getPxFromCssUnit(cssUnit) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (Number.isFinite(cssUnit)) { - return cssUnit.toFixed(0) + 'px'; - } - - if (cssUnit === undefined) { - return null; - } - - let parsedUnit = parseUnit(cssUnit); - - if (!parsedUnit.unit) { - parsedUnit = parseUnitFunction(cssUnit, options); - } - - if (isMathExpression(cssUnit) && !parsedUnit.unit) { - return evalMathExpression(cssUnit); - } - - return convertParsedUnitToPx(parsedUnit, options); -} // Use simple cache. - -const cache = {}; -/** - * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit; - * - * @param {string} cssUnit - * @param {Object} options - * @return {string} returns the cssUnit value in a simple px format. - */ - -function memoizedGetPxFromCssUnit(cssUnit) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const hash = cssUnit + hashOptions(options); - - if (!cache[hash]) { - cache[hash] = getPxFromCssUnit(cssUnit, options); - } - - return cache[hash]; -} - -function hashOptions(options) { - let hash = ''; - - if (options.hasOwnProperty('fontSize')) { - hash = ':' + options.width; - } - - if (options.hasOwnProperty('lineHeight')) { - hash = ':' + options.lineHeight; - } - - if (options.hasOwnProperty('width')) { - hash = ':' + options.width; - } - - if (options.hasOwnProperty('height')) { - hash = ':' + options.height; - } - - if (options.hasOwnProperty('type')) { - hash = ':' + options.type; - } - - return hash; -} - -/* harmony default export */ var parse_css_unit_to_px = (memoizedGetPxFromCssUnit); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/index.js - - - - - - -/***/ }), - -/***/ "BLeD": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["tokenList"]; }()); - -/***/ }), - -/***/ "BhPs": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ storeConfig; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ store; }); - -// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js -var selectors_namespaceObject = {}; -__webpack_require__.r(selectors_namespaceObject); -__webpack_require__.d(selectors_namespaceObject, "getBlockName", function() { return getBlockName; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockValid", function() { return isBlockValid; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockAttributes", function() { return getBlockAttributes; }); -__webpack_require__.d(selectors_namespaceObject, "getBlock", function() { return getBlock; }); -__webpack_require__.d(selectors_namespaceObject, "__unstableGetBlockWithoutInnerBlocks", function() { return __unstableGetBlockWithoutInnerBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getBlocks", function() { return getBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "__unstableGetClientIdWithClientIdsTree", function() { return __unstableGetClientIdWithClientIdsTree; }); -__webpack_require__.d(selectors_namespaceObject, "__unstableGetClientIdsTree", function() { return __unstableGetClientIdsTree; }); -__webpack_require__.d(selectors_namespaceObject, "getClientIdsOfDescendants", function() { return getClientIdsOfDescendants; }); -__webpack_require__.d(selectors_namespaceObject, "getClientIdsWithDescendants", function() { return getClientIdsWithDescendants; }); -__webpack_require__.d(selectors_namespaceObject, "getGlobalBlockCount", function() { return getGlobalBlockCount; }); -__webpack_require__.d(selectors_namespaceObject, "getBlocksByClientId", function() { return getBlocksByClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockCount", function() { return getBlockCount; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectionStart", function() { return getSelectionStart; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectionEnd", function() { return getSelectionEnd; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockSelectionStart", function() { return getBlockSelectionStart; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockSelectionEnd", function() { return getBlockSelectionEnd; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlockCount", function() { return getSelectedBlockCount; }); -__webpack_require__.d(selectors_namespaceObject, "hasSelectedBlock", function() { return hasSelectedBlock; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientId", function() { return getSelectedBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function() { return getSelectedBlock; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return getBlockRootClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockParents", function() { return getBlockParents; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockParentsByBlockName", function() { return getBlockParentsByBlockName; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockHierarchyRootClientId", function() { return getBlockHierarchyRootClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getLowestCommonAncestorWithSelectedBlock", function() { return getLowestCommonAncestorWithSelectedBlock; }); -__webpack_require__.d(selectors_namespaceObject, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getPreviousBlockClientId", function() { return getPreviousBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getNextBlockClientId", function() { return getNextBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlocksInitialCaretPosition", function() { return getSelectedBlocksInitialCaretPosition; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientIds", function() { return getSelectedBlockClientIds; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlockClientIds", function() { return getMultiSelectedBlockClientIds; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getFirstMultiSelectedBlockClientId", function() { return getFirstMultiSelectedBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getLastMultiSelectedBlockClientId", function() { return getLastMultiSelectedBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "isFirstMultiSelectedBlock", function() { return isFirstMultiSelectedBlock; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockMultiSelected", function() { return isBlockMultiSelected; }); -__webpack_require__.d(selectors_namespaceObject, "isAncestorMultiSelected", function() { return isAncestorMultiSelected; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksStartClientId", function() { return getMultiSelectedBlocksStartClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksEndClientId", function() { return getMultiSelectedBlocksEndClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockOrder", function() { return getBlockOrder; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockIndex", function() { return getBlockIndex; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockSelected", function() { return isBlockSelected; }); -__webpack_require__.d(selectors_namespaceObject, "hasSelectedInnerBlock", function() { return hasSelectedInnerBlock; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockWithinSelection", function() { return isBlockWithinSelection; }); -__webpack_require__.d(selectors_namespaceObject, "hasMultiSelection", function() { return hasMultiSelection; }); -__webpack_require__.d(selectors_namespaceObject, "isMultiSelecting", function() { return selectors_isMultiSelecting; }); -__webpack_require__.d(selectors_namespaceObject, "isSelectionEnabled", function() { return selectors_isSelectionEnabled; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockMode", function() { return getBlockMode; }); -__webpack_require__.d(selectors_namespaceObject, "isTyping", function() { return selectors_isTyping; }); -__webpack_require__.d(selectors_namespaceObject, "isDraggingBlocks", function() { return isDraggingBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getDraggedBlockClientIds", function() { return getDraggedBlockClientIds; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockBeingDragged", function() { return isBlockBeingDragged; }); -__webpack_require__.d(selectors_namespaceObject, "isAncestorBeingDragged", function() { return isAncestorBeingDragged; }); -__webpack_require__.d(selectors_namespaceObject, "isCaretWithinFormattedText", function() { return selectors_isCaretWithinFormattedText; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockInsertionPoint", function() { return getBlockInsertionPoint; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockInsertionPointVisible", function() { return isBlockInsertionPointVisible; }); -__webpack_require__.d(selectors_namespaceObject, "isValidTemplate", function() { return selectors_isValidTemplate; }); -__webpack_require__.d(selectors_namespaceObject, "getTemplate", function() { return getTemplate; }); -__webpack_require__.d(selectors_namespaceObject, "getTemplateLock", function() { return getTemplateLock; }); -__webpack_require__.d(selectors_namespaceObject, "canInsertBlockType", function() { return canInsertBlockType; }); -__webpack_require__.d(selectors_namespaceObject, "canInsertBlocks", function() { return canInsertBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "canRemoveBlock", function() { return canRemoveBlock; }); -__webpack_require__.d(selectors_namespaceObject, "canRemoveBlocks", function() { return selectors_canRemoveBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "canMoveBlock", function() { return canMoveBlock; }); -__webpack_require__.d(selectors_namespaceObject, "canMoveBlocks", function() { return selectors_canMoveBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getInserterItems", function() { return getInserterItems; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockTransformItems", function() { return getBlockTransformItems; }); -__webpack_require__.d(selectors_namespaceObject, "hasInserterItems", function() { return hasInserterItems; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllowedBlocks", function() { return __experimentalGetAllowedBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetDirectInsertBlock", function() { return __experimentalGetDirectInsertBlock; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetParsedPattern", function() { return __experimentalGetParsedPattern; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllowedPatterns", function() { return __experimentalGetAllowedPatterns; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetPatternsByBlockTypes", function() { return __experimentalGetPatternsByBlockTypes; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetPatternTransformItems", function() { return __experimentalGetPatternTransformItems; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockListSettings", function() { return getBlockListSettings; }); -__webpack_require__.d(selectors_namespaceObject, "getSettings", function() { return getSettings; }); -__webpack_require__.d(selectors_namespaceObject, "isLastBlockChangePersistent", function() { return isLastBlockChangePersistent; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetBlockListSettingsForBlocks", function() { return __experimentalGetBlockListSettingsForBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetReusableBlockTitle", function() { return __experimentalGetReusableBlockTitle; }); -__webpack_require__.d(selectors_namespaceObject, "__unstableIsLastBlockChangeIgnored", function() { return __unstableIsLastBlockChangeIgnored; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetLastBlockAttributeChanges", function() { return __experimentalGetLastBlockAttributeChanges; }); -__webpack_require__.d(selectors_namespaceObject, "isNavigationMode", function() { return selectors_isNavigationMode; }); -__webpack_require__.d(selectors_namespaceObject, "hasBlockMovingClientId", function() { return selectors_hasBlockMovingClientId; }); -__webpack_require__.d(selectors_namespaceObject, "didAutomaticChange", function() { return didAutomaticChange; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockHighlighted", function() { return isBlockHighlighted; }); -__webpack_require__.d(selectors_namespaceObject, "areInnerBlocksControlled", function() { return areInnerBlocksControlled; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetActiveBlockIdByBlockNames", function() { return __experimentalGetActiveBlockIdByBlockNames; }); -__webpack_require__.d(selectors_namespaceObject, "wasBlockJustInserted", function() { return wasBlockJustInserted; }); - -// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/actions.js -var actions_namespaceObject = {}; -__webpack_require__.r(actions_namespaceObject); -__webpack_require__.d(actions_namespaceObject, "resetBlocks", function() { return resetBlocks; }); -__webpack_require__.d(actions_namespaceObject, "validateBlocksToTemplate", function() { return validateBlocksToTemplate; }); -__webpack_require__.d(actions_namespaceObject, "resetSelection", function() { return resetSelection; }); -__webpack_require__.d(actions_namespaceObject, "receiveBlocks", function() { return receiveBlocks; }); -__webpack_require__.d(actions_namespaceObject, "updateBlockAttributes", function() { return updateBlockAttributes; }); -__webpack_require__.d(actions_namespaceObject, "updateBlock", function() { return updateBlock; }); -__webpack_require__.d(actions_namespaceObject, "selectBlock", function() { return selectBlock; }); -__webpack_require__.d(actions_namespaceObject, "selectPreviousBlock", function() { return selectPreviousBlock; }); -__webpack_require__.d(actions_namespaceObject, "selectNextBlock", function() { return selectNextBlock; }); -__webpack_require__.d(actions_namespaceObject, "startMultiSelect", function() { return startMultiSelect; }); -__webpack_require__.d(actions_namespaceObject, "stopMultiSelect", function() { return stopMultiSelect; }); -__webpack_require__.d(actions_namespaceObject, "multiSelect", function() { return multiSelect; }); -__webpack_require__.d(actions_namespaceObject, "clearSelectedBlock", function() { return clearSelectedBlock; }); -__webpack_require__.d(actions_namespaceObject, "toggleSelection", function() { return toggleSelection; }); -__webpack_require__.d(actions_namespaceObject, "replaceBlocks", function() { return replaceBlocks; }); -__webpack_require__.d(actions_namespaceObject, "replaceBlock", function() { return replaceBlock; }); -__webpack_require__.d(actions_namespaceObject, "moveBlocksDown", function() { return moveBlocksDown; }); -__webpack_require__.d(actions_namespaceObject, "moveBlocksUp", function() { return moveBlocksUp; }); -__webpack_require__.d(actions_namespaceObject, "moveBlocksToPosition", function() { return moveBlocksToPosition; }); -__webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return moveBlockToPosition; }); -__webpack_require__.d(actions_namespaceObject, "insertBlock", function() { return insertBlock; }); -__webpack_require__.d(actions_namespaceObject, "insertBlocks", function() { return insertBlocks; }); -__webpack_require__.d(actions_namespaceObject, "showInsertionPoint", function() { return showInsertionPoint; }); -__webpack_require__.d(actions_namespaceObject, "hideInsertionPoint", function() { return hideInsertionPoint; }); -__webpack_require__.d(actions_namespaceObject, "setTemplateValidity", function() { return setTemplateValidity; }); -__webpack_require__.d(actions_namespaceObject, "synchronizeTemplate", function() { return synchronizeTemplate; }); -__webpack_require__.d(actions_namespaceObject, "mergeBlocks", function() { return mergeBlocks; }); -__webpack_require__.d(actions_namespaceObject, "removeBlocks", function() { return removeBlocks; }); -__webpack_require__.d(actions_namespaceObject, "removeBlock", function() { return removeBlock; }); -__webpack_require__.d(actions_namespaceObject, "replaceInnerBlocks", function() { return replaceInnerBlocks; }); -__webpack_require__.d(actions_namespaceObject, "toggleBlockMode", function() { return toggleBlockMode; }); -__webpack_require__.d(actions_namespaceObject, "startTyping", function() { return startTyping; }); -__webpack_require__.d(actions_namespaceObject, "stopTyping", function() { return stopTyping; }); -__webpack_require__.d(actions_namespaceObject, "startDraggingBlocks", function() { return startDraggingBlocks; }); -__webpack_require__.d(actions_namespaceObject, "stopDraggingBlocks", function() { return stopDraggingBlocks; }); -__webpack_require__.d(actions_namespaceObject, "enterFormattedText", function() { return enterFormattedText; }); -__webpack_require__.d(actions_namespaceObject, "exitFormattedText", function() { return exitFormattedText; }); -__webpack_require__.d(actions_namespaceObject, "selectionChange", function() { return selectionChange; }); -__webpack_require__.d(actions_namespaceObject, "insertDefaultBlock", function() { return insertDefaultBlock; }); -__webpack_require__.d(actions_namespaceObject, "updateBlockListSettings", function() { return updateBlockListSettings; }); -__webpack_require__.d(actions_namespaceObject, "updateSettings", function() { return updateSettings; }); -__webpack_require__.d(actions_namespaceObject, "__unstableSaveReusableBlock", function() { return __unstableSaveReusableBlock; }); -__webpack_require__.d(actions_namespaceObject, "__unstableMarkLastChangeAsPersistent", function() { return __unstableMarkLastChangeAsPersistent; }); -__webpack_require__.d(actions_namespaceObject, "__unstableMarkNextChangeAsNotPersistent", function() { return __unstableMarkNextChangeAsNotPersistent; }); -__webpack_require__.d(actions_namespaceObject, "__unstableMarkAutomaticChange", function() { return __unstableMarkAutomaticChange; }); -__webpack_require__.d(actions_namespaceObject, "setNavigationMode", function() { return setNavigationMode; }); -__webpack_require__.d(actions_namespaceObject, "setBlockMovingClientId", function() { return setBlockMovingClientId; }); -__webpack_require__.d(actions_namespaceObject, "duplicateBlocks", function() { return duplicateBlocks; }); -__webpack_require__.d(actions_namespaceObject, "insertBeforeBlock", function() { return insertBeforeBlock; }); -__webpack_require__.d(actions_namespaceObject, "insertAfterBlock", function() { return insertAfterBlock; }); -__webpack_require__.d(actions_namespaceObject, "toggleBlockHighlight", function() { return toggleBlockHighlight; }); -__webpack_require__.d(actions_namespaceObject, "flashBlock", function() { return flashBlock; }); -__webpack_require__.d(actions_namespaceObject, "setHasControlledInnerBlocks", function() { return setHasControlledInnerBlocks; }); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/defaults.js -var defaults = __webpack_require__("lJLt"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/array.js -/** - * External dependencies - */ - -/** - * Insert one or multiple elements into a given position of an array. - * - * @param {Array} array Source array. - * @param {*} elements Elements to insert. - * @param {number} index Insert Position. - * - * @return {Array} Result. - */ - -function insertAt(array, elements, index) { - return [...array.slice(0, index), ...Object(external_lodash_["castArray"])(elements), ...array.slice(index)]; -} -/** - * Moves an element in an array. - * - * @param {Array} array Source array. - * @param {number} from Source index. - * @param {number} to Destination index. - * @param {number} count Number of elements to move. - * - * @return {Array} Result. - */ - -function moveTo(array, from, to) { - let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - const withoutMovedElements = [...array]; - withoutMovedElements.splice(from, count); - return insertAt(withoutMovedElements, array.slice(from, from + count), to); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/reducer.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -/** - * Given an array of blocks, returns an object where each key is a nesting - * context, the value of which is an array of block client IDs existing within - * that nesting context. - * - * @param {Array} blocks Blocks to map. - * @param {?string} rootClientId Assumed root client ID. - * - * @return {Object} Block order map object. - */ - -function mapBlockOrder(blocks) { - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - const result = { - [rootClientId]: [] - }; - blocks.forEach(block => { - const { - clientId, - innerBlocks - } = block; - result[rootClientId].push(clientId); - Object.assign(result, mapBlockOrder(innerBlocks, clientId)); - }); - return result; -} -/** - * Given an array of blocks, returns an object where each key contains - * the clientId of the block and the value is the parent of the block. - * - * @param {Array} blocks Blocks to map. - * @param {?string} rootClientId Assumed root client ID. - * - * @return {Object} Block order map object. - */ - - -function mapBlockParents(blocks) { - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - return blocks.reduce((result, block) => Object.assign(result, { - [block.clientId]: rootClientId - }, mapBlockParents(block.innerBlocks, block.clientId)), {}); -} -/** - * Helper method to iterate through all blocks, recursing into inner blocks, - * applying a transformation function to each one. - * Returns a flattened object with the transformed blocks. - * - * @param {Array} blocks Blocks to flatten. - * @param {Function} transform Transforming function to be applied to each block. - * - * @return {Object} Flattened object. - */ - - -function flattenBlocks(blocks) { - let transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : external_lodash_["identity"]; - const result = {}; - const stack = [...blocks]; - - while (stack.length) { - const { - innerBlocks, - ...block - } = stack.shift(); - stack.push(...innerBlocks); - result[block.clientId] = transform(block); - } - - return result; -} -/** - * Given an array of blocks, returns an object containing all blocks, without - * attributes, recursing into inner blocks. Keys correspond to the block client - * ID, the value of which is the attributes object. - * - * @param {Array} blocks Blocks to flatten. - * - * @return {Object} Flattened block attributes object. - */ - - -function getFlattenedBlocksWithoutAttributes(blocks) { - return flattenBlocks(blocks, block => Object(external_lodash_["omit"])(block, 'attributes')); -} -/** - * Given an array of blocks, returns an object containing all block attributes, - * recursing into inner blocks. Keys correspond to the block client ID, the - * value of which is the attributes object. - * - * @param {Array} blocks Blocks to flatten. - * - * @return {Object} Flattened block attributes object. - */ - - -function getFlattenedBlockAttributes(blocks) { - return flattenBlocks(blocks, block => block.attributes); -} -/** - * Returns an object against which it is safe to perform mutating operations, - * given the original object and its current working copy. - * - * @param {Object} original Original object. - * @param {Object} working Working object. - * - * @return {Object} Mutation-safe object. - */ - - -function getMutateSafeObject(original, working) { - if (original === working) { - return { ...original - }; - } - - return working; -} -/** - * Returns true if the two object arguments have the same keys, or false - * otherwise. - * - * @param {Object} a First object. - * @param {Object} b Second object. - * - * @return {boolean} Whether the two objects have the same keys. - */ - - -function hasSameKeys(a, b) { - return Object(external_lodash_["isEqual"])(Object(external_lodash_["keys"])(a), Object(external_lodash_["keys"])(b)); -} -/** - * Returns true if, given the currently dispatching action and the previously - * dispatched action, the two actions are updating the same block attribute, or - * false otherwise. - * - * @param {Object} action Currently dispatching action. - * @param {Object} lastAction Previously dispatched action. - * - * @return {boolean} Whether actions are updating the same block attribute. - */ - -function isUpdatingSameBlockAttribute(action, lastAction) { - return action.type === 'UPDATE_BLOCK_ATTRIBUTES' && lastAction !== undefined && lastAction.type === 'UPDATE_BLOCK_ATTRIBUTES' && Object(external_lodash_["isEqual"])(action.clientIds, lastAction.clientIds) && hasSameKeys(action.attributes, lastAction.attributes); -} - -function buildBlockTree(state, blocks) { - const result = {}; - const stack = [...blocks]; - const flattenedBlocks = [...blocks]; - - while (stack.length) { - const block = stack.shift(); - stack.push(...block.innerBlocks); - flattenedBlocks.push(...block.innerBlocks); - } // Create objects before mutating them, that way it's always defined. - - - for (const block of flattenedBlocks) { - result[block.clientId] = {}; - } - - for (const block of flattenedBlocks) { - result[block.clientId] = Object.assign(result[block.clientId], { ...state.byClientId[block.clientId], - attributes: state.attributes[block.clientId], - innerBlocks: block.innerBlocks.map(subBlock => result[subBlock.clientId]) - }); - } - - return result; -} - -function updateParentInnerBlocksInTree(state, tree, updatedClientIds) { - let updateChildrenOfUpdatedClientIds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - const uncontrolledParents = new Set([]); - const controlledParents = new Set(); - - for (const clientId of updatedClientIds) { - let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents[clientId]; - - do { - if (state.controlledInnerBlocks[current]) { - // Should stop on controlled blocks. - // If we reach a controlled parent, break out of the loop. - controlledParents.add(current); - break; - } else { - // else continue traversing up through parents. - uncontrolledParents.add(current); - current = state.parents[current]; - } - } while (current !== undefined); - } // To make sure the order of assignments doesn't matter, - // we first create empty objects and mutates the inner blocks later. - - - for (const clientId of uncontrolledParents) { - tree[clientId] = { ...tree[clientId] - }; - } - - for (const clientId of uncontrolledParents) { - tree[clientId].innerBlocks = (state.order[clientId] || []).map(subClientId => tree[subClientId]); - } // Controlled parent blocks, need a dedicated key for their inner blocks - // to be used when doing getBlocks( controlledBlockClientId ). - - - for (const clientId of controlledParents) { - tree['controlled||' + clientId] = { - innerBlocks: (state.order[clientId] || []).map(subClientId => tree[subClientId]) - }; - } - - return tree; -} -/** - * Higher-order reducer intended to compute full block objects key for each block in the post. - * This is a denormalization to optimize the performance of the getBlock selectors and avoid - * recomputing the block objects and avoid heavy memoization. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -const withBlockTree = reducer => function () { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - const newState = reducer(state, action); - - if (newState === state) { - return state; - } - - newState.tree = state.tree ? state.tree : {}; - - switch (action.type) { - case 'RECEIVE_BLOCKS': - case 'INSERT_BLOCKS': - { - const subTree = buildBlockTree(newState, action.blocks); - newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, - ...subTree - }, action.rootClientId ? [action.rootClientId] : [''], true); - break; - } - - case 'UPDATE_BLOCK': - newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, - [action.clientId]: { ...newState.tree[action.clientId], - ...newState.byClientId[action.clientId], - attributes: newState.attributes[action.clientId] - } - }, [action.clientId], false); - break; - - case 'UPDATE_BLOCK_ATTRIBUTES': - { - const newSubTree = action.clientIds.reduce((result, clientId) => { - result[clientId] = { ...newState.tree[clientId], - attributes: newState.attributes[clientId] - }; - return result; - }, {}); - newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, - ...newSubTree - }, action.clientIds, false); - break; - } - - case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': - { - const subTree = buildBlockTree(newState, action.blocks); - newState.tree = updateParentInnerBlocksInTree(newState, { ...Object(external_lodash_["omit"])(newState.tree, action.replacedClientIds.concat( // Controlled inner blocks are only removed - // if the block doesn't move to another position - // otherwise their content will be lost. - action.replacedClientIds.filter(clientId => !subTree[clientId]).map(clientId => 'controlled||' + clientId))), - ...subTree - }, action.blocks.map(b => b.clientId), false); // If there are no replaced blocks, it means we're removing blocks so we need to update their parent. - - const parentsOfRemovedBlocks = []; - - for (const clientId of action.clientIds) { - if (state.parents[clientId] !== undefined && (state.parents[clientId] === '' || newState.byClientId[state.parents[clientId]])) { - parentsOfRemovedBlocks.push(state.parents[clientId]); - } - } - - newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, parentsOfRemovedBlocks, true); - break; - } - - case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': - const parentsOfRemovedBlocks = []; - - for (const clientId of action.clientIds) { - if (state.parents[clientId] !== undefined && (state.parents[clientId] === '' || newState.byClientId[state.parents[clientId]])) { - parentsOfRemovedBlocks.push(state.parents[clientId]); - } - } - - newState.tree = updateParentInnerBlocksInTree(newState, Object(external_lodash_["omit"])(newState.tree, action.removedClientIds.concat(action.removedClientIds.map(clientId => 'controlled||' + clientId))), parentsOfRemovedBlocks, true); - break; - - case 'MOVE_BLOCKS_TO_POSITION': - { - const updatedBlockUids = []; - - if (action.fromRootClientId) { - updatedBlockUids.push(action.fromRootClientId); - } - - if (action.toRootClientId) { - updatedBlockUids.push(action.toRootClientId); - } - - if (!action.fromRootClientId || !action.fromRootClientId) { - updatedBlockUids.push(''); - } - - newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, updatedBlockUids, true); - break; - } - - case 'MOVE_BLOCKS_UP': - case 'MOVE_BLOCKS_DOWN': - { - const updatedBlockUids = [action.rootClientId ? action.rootClientId : '']; - newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, updatedBlockUids, true); - break; - } - - case 'SAVE_REUSABLE_BLOCK_SUCCESS': - { - const updatedBlockUids = Object(external_lodash_["keys"])(Object(external_lodash_["omitBy"])(newState.attributes, (attributes, clientId) => { - return newState.byClientId[clientId].name !== 'core/block' || attributes.ref !== action.updatedId; - })); - newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, - ...updatedBlockUids.reduce((result, clientId) => { - result[clientId] = { ...newState.byClientId[clientId], - attributes: newState.attributes[clientId], - innerBlocks: newState.tree[clientId].innerBlocks - }; - return result; - }, {}) - }, updatedBlockUids, false); - } - } - - return newState; -}; -/** - * Higher-order reducer intended to augment the blocks reducer, assigning an - * `isPersistentChange` property value corresponding to whether a change in - * state can be considered as persistent. All changes are considered persistent - * except when updating the same block attribute as in the previous action. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -function withPersistentBlockChange(reducer) { - let lastAction; - let markNextChangeAsNotPersistent = false; - return (state, action) => { - let nextState = reducer(state, action); - const isExplicitPersistentChange = action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' || markNextChangeAsNotPersistent; // Defer to previous state value (or default) unless changing or - // explicitly marking as persistent. - - if (state === nextState && !isExplicitPersistentChange) { - var _state$isPersistentCh; - - markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; - const nextIsPersistentChange = (_state$isPersistentCh = state === null || state === void 0 ? void 0 : state.isPersistentChange) !== null && _state$isPersistentCh !== void 0 ? _state$isPersistentCh : true; - - if (state.isPersistentChange === nextIsPersistentChange) { - return state; - } - - return { ...nextState, - isPersistentChange: nextIsPersistentChange - }; - } - - nextState = { ...nextState, - isPersistentChange: isExplicitPersistentChange ? !markNextChangeAsNotPersistent : !isUpdatingSameBlockAttribute(action, lastAction) - }; // In comparing against the previous action, consider only those which - // would have qualified as one which would have been ignored or not - // have resulted in a changed state. - - lastAction = action; - markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; - return nextState; - }; -} -/** - * Higher-order reducer intended to augment the blocks reducer, assigning an - * `isIgnoredChange` property value corresponding to whether a change in state - * can be considered as ignored. A change is considered ignored when the result - * of an action not incurred by direct user interaction. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -function withIgnoredBlockChange(reducer) { - /** - * Set of action types for which a blocks state change should be ignored. - * - * @type {Set} - */ - const IGNORED_ACTION_TYPES = new Set(['RECEIVE_BLOCKS']); - return (state, action) => { - const nextState = reducer(state, action); - - if (nextState !== state) { - nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type); - } - - return nextState; - }; -} -/** - * Higher-order reducer targeting the combined blocks reducer, augmenting - * block client IDs in remove action to include cascade of inner blocks. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -const withInnerBlocksRemoveCascade = reducer => (state, action) => { - // Gets all children which need to be removed. - const getAllChildren = clientIds => { - let result = clientIds; - - for (let i = 0; i < result.length; i++) { - if (!state.order[result[i]] || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i]]) { - continue; - } - - if (result === clientIds) { - result = [...result]; - } - - result.push(...state.order[result[i]]); - } - - return result; - }; - - if (state) { - switch (action.type) { - case 'REMOVE_BLOCKS': - action = { ...action, - type: 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN', - removedClientIds: getAllChildren(action.clientIds) - }; - break; - - case 'REPLACE_BLOCKS': - action = { ...action, - type: 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN', - replacedClientIds: getAllChildren(action.clientIds) - }; - break; - } - } - - return reducer(state, action); -}; -/** - * Higher-order reducer which targets the combined blocks reducer and handles - * the `RESET_BLOCKS` action. When dispatched, this action will replace all - * blocks that exist in the post, leaving blocks that exist only in state (e.g. - * reusable blocks and blocks controlled by inner blocks controllers) alone. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -const withBlockReset = reducer => (state, action) => { - if (action.type === 'RESET_BLOCKS') { - const newState = { ...state, - byClientId: getFlattenedBlocksWithoutAttributes(action.blocks), - attributes: getFlattenedBlockAttributes(action.blocks), - order: mapBlockOrder(action.blocks), - parents: mapBlockParents(action.blocks), - controlledInnerBlocks: {} - }; - const subTree = buildBlockTree(newState, action.blocks); - newState.tree = { ...subTree, - // Root - '': { - innerBlocks: action.blocks.map(subBlock => subTree[subBlock.clientId]) - } - }; - return newState; - } - - return reducer(state, action); -}; -/** - * Higher-order reducer which targets the combined blocks reducer and handles - * the `REPLACE_INNER_BLOCKS` action. When dispatched, this action the state - * should become equivalent to the execution of a `REMOVE_BLOCKS` action - * containing all the child's of the root block followed by the execution of - * `INSERT_BLOCKS` with the new blocks. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -const withReplaceInnerBlocks = reducer => (state, action) => { - if (action.type !== 'REPLACE_INNER_BLOCKS') { - return reducer(state, action); - } // Finds every nested inner block controller. We must check the action blocks - // and not just the block parent state because some inner block controllers - // should be deleted if specified, whereas others should not be deleted. If - // a controlled should not be deleted, then we need to avoid deleting its - // inner blocks from the block state because its inner blocks will not be - // attached to the block in the action. - - - const nestedControllers = {}; - - if (Object.keys(state.controlledInnerBlocks).length) { - const stack = [...action.blocks]; - - while (stack.length) { - const { - innerBlocks, - ...block - } = stack.shift(); - stack.push(...innerBlocks); - - if (!!state.controlledInnerBlocks[block.clientId]) { - nestedControllers[block.clientId] = true; - } - } - } // The `keepControlledInnerBlocks` prop will keep the inner blocks of the - // marked block in the block state so that they can be reattached to the - // marked block when we re-insert everything a few lines below. - - - let stateAfterBlocksRemoval = state; - - if (state.order[action.rootClientId]) { - stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, { - type: 'REMOVE_BLOCKS', - keepControlledInnerBlocks: nestedControllers, - clientIds: state.order[action.rootClientId] - }); - } - - let stateAfterInsert = stateAfterBlocksRemoval; - - if (action.blocks.length) { - stateAfterInsert = reducer(stateAfterInsert, { ...action, - type: 'INSERT_BLOCKS', - index: 0 - }); // We need to re-attach the block order of the controlled inner blocks. - // Otherwise, an inner block controller's blocks will be deleted entirely - // from its entity.. - - stateAfterInsert.order = { ...stateAfterInsert.order, - ...Object(external_lodash_["reduce"])(nestedControllers, (result, value, key) => { - if (state.order[key]) { - result[key] = state.order[key]; - } - - return result; - }, {}) - }; - } - - return stateAfterInsert; -}; -/** - * Higher-order reducer which targets the combined blocks reducer and handles - * the `SAVE_REUSABLE_BLOCK_SUCCESS` action. This action can't be handled by - * regular reducers and needs a higher-order reducer since it needs access to - * both `byClientId` and `attributes` simultaneously. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -const withSaveReusableBlock = reducer => (state, action) => { - if (state && action.type === 'SAVE_REUSABLE_BLOCK_SUCCESS') { - const { - id, - updatedId - } = action; // If a temporary reusable block is saved, we swap the temporary id with the final one - - if (id === updatedId) { - return state; - } - - state = { ...state - }; - state.attributes = Object(external_lodash_["mapValues"])(state.attributes, (attributes, clientId) => { - const { - name - } = state.byClientId[clientId]; - - if (name === 'core/block' && attributes.ref === id) { - return { ...attributes, - ref: updatedId - }; - } - - return attributes; - }); - } - - return reducer(state, action); -}; -/** - * Higher-order reducer which removes blocks from state when switching parent block controlled state. - * - * @param {Function} reducer Original reducer function. - * - * @return {Function} Enhanced reducer function. - */ - - -const withResetControlledBlocks = reducer => (state, action) => { - if (action.type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { - // when switching a block from controlled to uncontrolled or inverse, - // we need to remove its content first. - const tempState = reducer(state, { - type: 'REPLACE_INNER_BLOCKS', - rootClientId: action.clientId, - blocks: [] - }); - return reducer(tempState, action); - } - - return reducer(state, action); -}; -/** - * Reducer returning the blocks state. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Updated state. - */ - - -const reducer_blocks = Object(external_lodash_["flow"])(external_wp_data_["combineReducers"], withSaveReusableBlock, // needs to be before withBlockCache -withBlockTree, // needs to be before withInnerBlocksRemoveCascade -withInnerBlocksRemoveCascade, withReplaceInnerBlocks, // needs to be after withInnerBlocksRemoveCascade -withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks)({ - byClientId() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'RECEIVE_BLOCKS': - case 'INSERT_BLOCKS': - return { ...state, - ...getFlattenedBlocksWithoutAttributes(action.blocks) - }; - - case 'UPDATE_BLOCK': - // Ignore updates if block isn't known - if (!state[action.clientId]) { - return state; - } // Do nothing if only attributes change. - - - const changes = Object(external_lodash_["omit"])(action.updates, 'attributes'); - - if (Object(external_lodash_["isEmpty"])(changes)) { - return state; - } - - return { ...state, - [action.clientId]: { ...state[action.clientId], - ...changes - } - }; - - case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': - if (!action.blocks) { - return state; - } - - return { ...Object(external_lodash_["omit"])(state, action.replacedClientIds), - ...getFlattenedBlocksWithoutAttributes(action.blocks) - }; - - case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': - return Object(external_lodash_["omit"])(state, action.removedClientIds); - } - - return state; - }, - - attributes() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'RECEIVE_BLOCKS': - case 'INSERT_BLOCKS': - return { ...state, - ...getFlattenedBlockAttributes(action.blocks) - }; - - case 'UPDATE_BLOCK': - // Ignore updates if block isn't known or there are no attribute changes. - if (!state[action.clientId] || !action.updates.attributes) { - return state; - } - - return { ...state, - [action.clientId]: { ...state[action.clientId], - ...action.updates.attributes - } - }; - - case 'UPDATE_BLOCK_ATTRIBUTES': - { - // Avoid a state change if none of the block IDs are known. - if (action.clientIds.every(id => !state[id])) { - return state; - } - - const next = action.clientIds.reduce((accumulator, id) => ({ ...accumulator, - [id]: Object(external_lodash_["reduce"])(action.uniqueByBlock ? action.attributes[id] : action.attributes, (result, value, key) => { - // Consider as updates only changed values. - if (value !== result[key]) { - result = getMutateSafeObject(state[id], result); - result[key] = value; - } - - return result; - }, state[id]) - }), {}); - - if (action.clientIds.every(id => next[id] === state[id])) { - return state; - } - - return { ...state, - ...next - }; - } - - case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': - if (!action.blocks) { - return state; - } - - return { ...Object(external_lodash_["omit"])(state, action.replacedClientIds), - ...getFlattenedBlockAttributes(action.blocks) - }; - - case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': - return Object(external_lodash_["omit"])(state, action.removedClientIds); - } - - return state; - }, - - order() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'RECEIVE_BLOCKS': - { - const blockOrder = mapBlockOrder(action.blocks); - return { ...state, - ...Object(external_lodash_["omit"])(blockOrder, ''), - '': ((state === null || state === void 0 ? void 0 : state['']) || []).concat(blockOrder['']) - }; - } - - case 'INSERT_BLOCKS': - { - const { - rootClientId = '' - } = action; - const subState = state[rootClientId] || []; - const mappedBlocks = mapBlockOrder(action.blocks, rootClientId); - const { - index = subState.length - } = action; - return { ...state, - ...mappedBlocks, - [rootClientId]: insertAt(subState, mappedBlocks[rootClientId], index) - }; - } - - case 'MOVE_BLOCKS_TO_POSITION': - { - const { - fromRootClientId = '', - toRootClientId = '', - clientIds - } = action; - const { - index = state[toRootClientId].length - } = action; // Moving inside the same parent block - - if (fromRootClientId === toRootClientId) { - const subState = state[toRootClientId]; - const fromIndex = subState.indexOf(clientIds[0]); - return { ...state, - [toRootClientId]: moveTo(state[toRootClientId], fromIndex, index, clientIds.length) - }; - } // Moving from a parent block to another - - - return { ...state, - [fromRootClientId]: Object(external_lodash_["without"])(state[fromRootClientId], ...clientIds), - [toRootClientId]: insertAt(state[toRootClientId], clientIds, index) - }; - } - - case 'MOVE_BLOCKS_UP': - { - const { - clientIds, - rootClientId = '' - } = action; - const firstClientId = Object(external_lodash_["first"])(clientIds); - const subState = state[rootClientId]; - - if (!subState.length || firstClientId === Object(external_lodash_["first"])(subState)) { - return state; - } - - const firstIndex = subState.indexOf(firstClientId); - return { ...state, - [rootClientId]: moveTo(subState, firstIndex, firstIndex - 1, clientIds.length) - }; - } - - case 'MOVE_BLOCKS_DOWN': - { - const { - clientIds, - rootClientId = '' - } = action; - const firstClientId = Object(external_lodash_["first"])(clientIds); - const lastClientId = Object(external_lodash_["last"])(clientIds); - const subState = state[rootClientId]; - - if (!subState.length || lastClientId === Object(external_lodash_["last"])(subState)) { - return state; - } - - const firstIndex = subState.indexOf(firstClientId); - return { ...state, - [rootClientId]: moveTo(subState, firstIndex, firstIndex + 1, clientIds.length) - }; - } - - case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': - { - const { - clientIds - } = action; - - if (!action.blocks) { - return state; - } - - const mappedBlocks = mapBlockOrder(action.blocks); - return Object(external_lodash_["flow"])([nextState => Object(external_lodash_["omit"])(nextState, action.replacedClientIds), nextState => ({ ...nextState, - ...Object(external_lodash_["omit"])(mappedBlocks, '') - }), nextState => Object(external_lodash_["mapValues"])(nextState, subState => Object(external_lodash_["reduce"])(subState, (result, clientId) => { - if (clientId === clientIds[0]) { - return [...result, ...mappedBlocks['']]; - } - - if (clientIds.indexOf(clientId) === -1) { - result.push(clientId); - } - - return result; - }, []))])(state); - } - - case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': - return Object(external_lodash_["flow"])([// Remove inner block ordering for removed blocks - nextState => Object(external_lodash_["omit"])(nextState, action.removedClientIds), // Remove deleted blocks from other blocks' orderings - nextState => Object(external_lodash_["mapValues"])(nextState, subState => Object(external_lodash_["without"])(subState, ...action.removedClientIds))])(state); - } - - return state; - }, - - // While technically redundant data as the inverse of `order`, it serves as - // an optimization for the selectors which derive the ancestry of a block. - parents() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'RECEIVE_BLOCKS': - return { ...state, - ...mapBlockParents(action.blocks) - }; - - case 'INSERT_BLOCKS': - return { ...state, - ...mapBlockParents(action.blocks, action.rootClientId || '') - }; - - case 'MOVE_BLOCKS_TO_POSITION': - { - return { ...state, - ...action.clientIds.reduce((accumulator, id) => { - accumulator[id] = action.toRootClientId || ''; - return accumulator; - }, {}) - }; - } - - case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': - return { ...Object(external_lodash_["omit"])(state, action.replacedClientIds), - ...mapBlockParents(action.blocks, state[action.clientIds[0]]) - }; - - case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': - return Object(external_lodash_["omit"])(state, action.removedClientIds); - } - - return state; - }, - - controlledInnerBlocks() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let { - type, - clientId, - hasControlledInnerBlocks - } = arguments.length > 1 ? arguments[1] : undefined; - - if (type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { - return { ...state, - [clientId]: hasControlledInnerBlocks - }; - } - - return state; - } - -}); -/** - * Reducer returning typing state. - * - * @param {boolean} state Current state. - * @param {Object} action Dispatched action. - * - * @return {boolean} Updated state. - */ - -function isTyping() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'START_TYPING': - return true; - - case 'STOP_TYPING': - return false; - } - - return state; -} -/** - * Reducer returning dragged block client id. - * - * @param {string[]} state Current state. - * @param {Object} action Dispatched action. - * - * @return {string[]} Updated state. - */ - -function draggedBlocks() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'START_DRAGGING_BLOCKS': - return action.clientIds; - - case 'STOP_DRAGGING_BLOCKS': - return []; - } - - return state; -} -/** - * Reducer returning whether the caret is within formatted text. - * - * @param {boolean} state Current state. - * @param {Object} action Dispatched action. - * - * @return {boolean} Updated state. - */ - -function isCaretWithinFormattedText() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'ENTER_FORMATTED_TEXT': - return true; - - case 'EXIT_FORMATTED_TEXT': - return false; - } - - return state; -} -/** - * Internal helper reducer for selectionStart and selectionEnd. Can hold a block - * selection, represented by an object with property clientId. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Updated state. - */ - -function selectionHelper() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'CLEAR_SELECTED_BLOCK': - { - if (state.clientId) { - return {}; - } - - return state; - } - - case 'SELECT_BLOCK': - if (action.clientId === state.clientId) { - return state; - } - - return { - clientId: action.clientId - }; - - case 'REPLACE_INNER_BLOCKS': - case 'INSERT_BLOCKS': - { - if (!action.updateSelection || !action.blocks.length) { - return state; - } - - return { - clientId: action.blocks[0].clientId - }; - } - - case 'REMOVE_BLOCKS': - if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) { - return state; - } - - return {}; - - case 'REPLACE_BLOCKS': - { - if (action.clientIds.indexOf(state.clientId) === -1) { - return state; - } - - const blockToSelect = action.blocks[action.indexToSelect] || action.blocks[action.blocks.length - 1]; - - if (!blockToSelect) { - return {}; - } - - if (blockToSelect.clientId === state.clientId) { - return state; - } - - return { - clientId: blockToSelect.clientId - }; - } - } - - return state; -} -/** - * Reducer returning the selection state. - * - * @param {boolean} state Current state. - * @param {Object} action Dispatched action. - * - * @return {boolean} Updated state. - */ - - -function selection() { - var _state$selectionStart, _state$selectionEnd; - - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'SELECTION_CHANGE': - return { - selectionStart: { - clientId: action.clientId, - attributeKey: action.attributeKey, - offset: action.startOffset - }, - selectionEnd: { - clientId: action.clientId, - attributeKey: action.attributeKey, - offset: action.endOffset - } - }; - - case 'RESET_SELECTION': - const { - selectionStart, - selectionEnd - } = action; - return { - selectionStart, - selectionEnd - }; - - case 'MULTI_SELECT': - const { - start, - end - } = action; - return { - selectionStart: { - clientId: start - }, - selectionEnd: { - clientId: end - } - }; - - case 'RESET_BLOCKS': - const startClientId = state === null || state === void 0 ? void 0 : (_state$selectionStart = state.selectionStart) === null || _state$selectionStart === void 0 ? void 0 : _state$selectionStart.clientId; - const endClientId = state === null || state === void 0 ? void 0 : (_state$selectionEnd = state.selectionEnd) === null || _state$selectionEnd === void 0 ? void 0 : _state$selectionEnd.clientId; // Do nothing if there's no selected block. - - if (!startClientId && !endClientId) { - return state; - } // If the start of the selection won't exist after reset, remove selection. - - - if (!action.blocks.some(block => block.clientId === startClientId)) { - return { - selectionStart: {}, - selectionEnd: {} - }; - } // If the end of the selection won't exist after reset, collapse selection. - - - if (!action.blocks.some(block => block.clientId === endClientId)) { - return { ...state, - selectionEnd: state.selectionStart - }; - } - - } - - return { - selectionStart: selectionHelper(state.selectionStart, action), - selectionEnd: selectionHelper(state.selectionEnd, action) - }; -} -/** - * Reducer returning whether the user is multi-selecting. - * - * @param {boolean} state Current state. - * @param {Object} action Dispatched action. - * - * @return {boolean} Updated state. - */ - -function isMultiSelecting() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'START_MULTI_SELECT': - return true; - - case 'STOP_MULTI_SELECT': - return false; - } - - return state; -} -/** - * Reducer returning whether selection is enabled. - * - * @param {boolean} state Current state. - * @param {Object} action Dispatched action. - * - * @return {boolean} Updated state. - */ - -function isSelectionEnabled() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'TOGGLE_SELECTION': - return action.isSelectionEnabled; - } - - return state; -} -/** - * Reducer returning the intial block selection. - * - * Currently this in only used to restore the selection after block deletion and - * pasting new content.This reducer should eventually be removed in favour of setting - * selection directly. - * - * @param {boolean} state Current state. - * @param {Object} action Dispatched action. - * - * @return {number|null} Initial position: 0, -1 or null. - */ - -function reducer_initialPosition() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let action = arguments.length > 1 ? arguments[1] : undefined; - - if (action.type === 'REPLACE_BLOCKS' && action.initialPosition !== undefined) { - return action.initialPosition; - } else if (['SELECT_BLOCK', 'RESET_SELECTION', 'INSERT_BLOCKS', 'REPLACE_INNER_BLOCKS'].includes(action.type)) { - return action.initialPosition; - } - - return state; -} -function blocksMode() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - if (action.type === 'TOGGLE_BLOCK_MODE') { - const { - clientId - } = action; - return { ...state, - [clientId]: state[clientId] && state[clientId] === 'html' ? 'visual' : 'html' - }; - } - - return state; -} -/** - * Reducer returning the block insertion point visibility, either null if there - * is not an explicit insertion point assigned, or an object of its `index` and - * `rootClientId`. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Updated state. - */ - -function insertionPoint() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'SHOW_INSERTION_POINT': - const { - rootClientId, - index, - __unstableWithInserter - } = action; - return { - rootClientId, - index, - __unstableWithInserter - }; - - case 'HIDE_INSERTION_POINT': - return null; - } - - return state; -} -/** - * Reducer returning whether the post blocks match the defined template or not. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {boolean} Updated state. - */ - -function reducer_template() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - isValid: true - }; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'SET_TEMPLATE_VALIDITY': - return { ...state, - isValid: action.isValid - }; - } - - return state; -} -/** - * Reducer returning the editor setting. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Updated state. - */ - -function settings() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults["b" /* SETTINGS_DEFAULTS */]; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'UPDATE_SETTINGS': - return { ...state, - ...action.settings - }; - } - - return state; -} -/** - * Reducer returning the user preferences. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {string} Updated state. - */ - -function preferences() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults["a" /* PREFERENCES_DEFAULTS */]; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'INSERT_BLOCKS': - case 'REPLACE_BLOCKS': - return action.blocks.reduce((prevState, block) => { - const { - attributes, - name: blockName - } = block; - const match = Object(external_wp_data_["select"])(external_wp_blocks_["store"]).getActiveBlockVariation(blockName, attributes); // If a block variation match is found change the name to be the same with the - // one that is used for block variations in the Inserter (`getItemFromVariation`). - - let id = match !== null && match !== void 0 && match.name ? `${blockName}/${match.name}` : blockName; - const insert = { - name: id - }; - - if (blockName === 'core/block') { - insert.ref = attributes.ref; - id += '/' + attributes.ref; - } - - return { ...prevState, - insertUsage: { ...prevState.insertUsage, - [id]: { - time: action.time, - count: prevState.insertUsage[id] ? prevState.insertUsage[id].count + 1 : 1, - insert - } - } - }; - }, state); - } - - return state; -} -/** - * Reducer returning an object where each key is a block client ID, its value - * representing the settings for its nested blocks. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Updated state. - */ - -const blockListSettings = function () { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - // Even if the replaced blocks have the same client ID, our logic - // should correct the state. - case 'REPLACE_BLOCKS': - case 'REMOVE_BLOCKS': - { - return Object(external_lodash_["omit"])(state, action.clientIds); - } - - case 'UPDATE_BLOCK_LIST_SETTINGS': - { - const { - clientId - } = action; - - if (!action.settings) { - if (state.hasOwnProperty(clientId)) { - return Object(external_lodash_["omit"])(state, clientId); - } - - return state; - } - - if (Object(external_lodash_["isEqual"])(state[clientId], action.settings)) { - return state; - } - - return { ...state, - [clientId]: action.settings - }; - } - } - - return state; -}; -/** - * Reducer returning whether the navigation mode is enabled or not. - * - * @param {string} state Current state. - * @param {Object} action Dispatched action. - * - * @return {string} Updated state. - */ - -function reducer_isNavigationMode() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - let action = arguments.length > 1 ? arguments[1] : undefined; - - // Let inserting block always trigger Edit mode. - if (action.type === 'INSERT_BLOCKS') { - return false; - } - - if (action.type === 'SET_NAVIGATION_MODE') { - return action.isNavigationMode; - } - - return state; -} -/** - * Reducer returning whether the block moving mode is enabled or not. - * - * @param {string|null} state Current state. - * @param {Object} action Dispatched action. - * - * @return {string|null} Updated state. - */ - -function reducer_hasBlockMovingClientId() { - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let action = arguments.length > 1 ? arguments[1] : undefined; - - // Let inserting block always trigger Edit mode. - if (action.type === 'SET_BLOCK_MOVING_MODE') { - return action.hasBlockMovingClientId; - } - - if (action.type === 'SET_NAVIGATION_MODE') { - return null; - } - - return state; -} -/** - * Reducer return an updated state representing the most recent block attribute - * update. The state is structured as an object where the keys represent the - * client IDs of blocks, the values a subset of attributes from the most recent - * block update. The state is always reset to null if the last action is - * anything other than an attributes update. - * - * @param {Object} state Current state. - * @param {Object} action Action object. - * - * @return {[string,Object]} Updated state. - */ - -function lastBlockAttributesChange(state, action) { - switch (action.type) { - case 'UPDATE_BLOCK': - if (!action.updates.attributes) { - break; - } - - return { - [action.clientId]: action.updates.attributes - }; - - case 'UPDATE_BLOCK_ATTRIBUTES': - return action.clientIds.reduce((accumulator, id) => ({ ...accumulator, - [id]: action.uniqueByBlock ? action.attributes[id] : action.attributes - }), {}); - } - - return null; -} -/** - * Reducer returning automatic change state. - * - * @param {boolean} state Current state. - * @param {Object} action Dispatched action. - * - * @return {string} Updated state. - */ - -function automaticChangeStatus(state, action) { - switch (action.type) { - case 'MARK_AUTOMATIC_CHANGE': - return 'pending'; - - case 'MARK_AUTOMATIC_CHANGE_FINAL': - if (state === 'pending') { - return 'final'; - } - - return; - - case 'SELECTION_CHANGE': - // As long as the state is not final, ignore any selection changes. - if (state !== 'final') { - return state; - } - - return; - // Undoing an automatic change should still be possible after mouse - // move. - - case 'START_TYPING': - case 'STOP_TYPING': - return state; - } // Reset the state by default (for any action not handled). - -} -/** - * Reducer returning current highlighted block. - * - * @param {boolean} state Current highlighted block. - * @param {Object} action Dispatched action. - * - * @return {string} Updated state. - */ - -function highlightedBlock(state, action) { - switch (action.type) { - case 'TOGGLE_BLOCK_HIGHLIGHT': - const { - clientId, - isHighlighted - } = action; - - if (isHighlighted) { - return clientId; - } else if (state === clientId) { - return null; - } - - return state; - - case 'SELECT_BLOCK': - if (action.clientId !== state) { - return null; - } - - } - - return state; -} -/** - * Reducer returning the block insertion event list state. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Updated state. - */ - -function lastBlockInserted() { - var _action$meta; - - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'INSERT_BLOCKS': - if (!action.blocks.length) { - return state; - } - - const clientId = action.blocks[0].clientId; - const source = (_action$meta = action.meta) === null || _action$meta === void 0 ? void 0 : _action$meta.source; - return { - clientId, - source - }; - - case 'RESET_BLOCKS': - return {}; - } - - return state; -} -/* harmony default export */ var store_reducer = (Object(external_wp_data_["combineReducers"])({ - blocks: reducer_blocks, - isTyping, - draggedBlocks, - isCaretWithinFormattedText, - selection, - isMultiSelecting, - isSelectionEnabled, - initialPosition: reducer_initialPosition, - blocksMode, - blockListSettings, - insertionPoint, - template: reducer_template, - settings, - preferences, - lastBlockAttributesChange, - isNavigationMode: reducer_isNavigationMode, - hasBlockMovingClientId: reducer_hasBlockMovingClientId, - automaticChangeStatus, - highlightedBlock, - lastBlockInserted -})); - -// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js -var rememo = __webpack_require__("pPDe"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","hooks"] -var external_wp_hooks_ = __webpack_require__("g56x"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js -var symbol = __webpack_require__("+WrK"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - -/** - * A block selection object. - * - * @typedef {Object} WPBlockSelection - * - * @property {string} clientId A block client ID. - * @property {string} attributeKey A block attribute key. - * @property {number} offset An attribute value offset, based on the rich - * text value. See `wp.richText.create`. - */ -// Module constants - -const MILLISECONDS_PER_HOUR = 3600 * 1000; -const MILLISECONDS_PER_DAY = 24 * 3600 * 1000; -const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000; -/** - * Shared reference to an empty array for cases where it is important to avoid - * returning a new array reference on every invocation, as in a connected or - * other pure component which performs `shouldComponentUpdate` check on props. - * This should be used as a last resort, since the normalized data should be - * maintained by the reducer result in state. - * - * @type {Array} - */ - -const EMPTY_ARRAY = []; -/** - * Returns a block's name given its client ID, or null if no block exists with - * the client ID. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {string} Block name. - */ - -function getBlockName(state, clientId) { - const block = state.blocks.byClientId[clientId]; - const socialLinkName = 'core/social-link'; - - if (external_wp_element_["Platform"].OS !== 'web' && (block === null || block === void 0 ? void 0 : block.name) === socialLinkName) { - const attributes = state.blocks.attributes[clientId]; - const { - service - } = attributes; - return service ? `${socialLinkName}-${service}` : socialLinkName; - } - - return block ? block.name : null; -} -/** - * Returns whether a block is valid or not. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {boolean} Is Valid. - */ - -function isBlockValid(state, clientId) { - const block = state.blocks.byClientId[clientId]; - return !!block && block.isValid; -} -/** - * Returns a block's attributes given its client ID, or null if no block exists with - * the client ID. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {Object?} Block attributes. - */ - -function getBlockAttributes(state, clientId) { - const block = state.blocks.byClientId[clientId]; - - if (!block) { - return null; - } - - return state.blocks.attributes[clientId]; -} -/** - * Returns a block given its client ID. This is a parsed copy of the block, - * containing its `blockName`, `clientId`, and current `attributes` state. This - * is not the block's registration settings, which must be retrieved from the - * blocks module registration store. - * - * getBlock recurses through its inner blocks until all its children blocks have - * been retrieved. Note that getBlock will not return the child inner blocks of - * an inner block controller. This is because an inner block controller syncs - * itself with its own entity, and should therefore not be included with the - * blocks of a different entity. For example, say you call `getBlocks( TP )` to - * get the blocks of a template part. If another template part is a child of TP, - * then the nested template part's child blocks will not be returned. This way, - * the template block itself is considered part of the parent, but the children - * are not. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {Object} Parsed block object. - */ - -function getBlock(state, clientId) { - const block = state.blocks.byClientId[clientId]; - - if (!block) { - return null; - } - - return state.blocks.tree[clientId]; -} -const __unstableGetBlockWithoutInnerBlocks = Object(rememo["a" /* default */])((state, clientId) => { - const block = state.blocks.byClientId[clientId]; - - if (!block) { - return null; - } - - return { ...block, - attributes: getBlockAttributes(state, clientId) - }; -}, (state, clientId) => [state.blocks.byClientId[clientId], state.blocks.attributes[clientId]]); -/** - * Returns all block objects for the current post being edited as an array in - * the order they appear in the post. Note that this will exclude child blocks - * of nested inner block controllers. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {Object[]} Post blocks. - */ - -function getBlocks(state, rootClientId) { - var _state$blocks$tree$tr; - - const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || '' : 'controlled||' + rootClientId; - return ((_state$blocks$tree$tr = state.blocks.tree[treeKey]) === null || _state$blocks$tree$tr === void 0 ? void 0 : _state$blocks$tree$tr.innerBlocks) || EMPTY_ARRAY; -} -/** - * Returns a stripped down block object containing only its client ID, - * and its inner blocks' client IDs. - * - * @param {Object} state Editor state. - * @param {string} clientId Client ID of the block to get. - * - * @return {Object} Client IDs of the post blocks. - */ - -const __unstableGetClientIdWithClientIdsTree = Object(rememo["a" /* default */])((state, clientId) => ({ - clientId, - innerBlocks: __unstableGetClientIdsTree(state, clientId) -}), state => [state.blocks.order]); -/** - * Returns the block tree represented in the block-editor store from the - * given root, consisting of stripped down block objects containing only - * their client IDs, and their inner blocks' client IDs. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {Object[]} Client IDs of the post blocks. - */ - -const __unstableGetClientIdsTree = Object(rememo["a" /* default */])(function (state) { - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - return Object(external_lodash_["map"])(getBlockOrder(state, rootClientId), clientId => __unstableGetClientIdWithClientIdsTree(state, clientId)); -}, state => [state.blocks.order]); -/** - * Returns an array containing the clientIds of all descendants - * of the blocks given. - * - * @param {Object} state Global application state. - * @param {Array} clientIds Array of blocks to inspect. - * - * @return {Array} ids of descendants. - */ - -const getClientIdsOfDescendants = (state, clientIds) => Object(external_lodash_["flatMap"])(clientIds, clientId => { - const descendants = getBlockOrder(state, clientId); - return [...descendants, ...getClientIdsOfDescendants(state, descendants)]; -}); -/** - * Returns an array containing the clientIds of the top-level blocks - * and their descendants of any depth (for nested blocks). - * - * @param {Object} state Global application state. - * - * @return {Array} ids of top-level and descendant blocks. - */ - -const getClientIdsWithDescendants = Object(rememo["a" /* default */])(state => { - const topLevelIds = getBlockOrder(state); - return [...topLevelIds, ...getClientIdsOfDescendants(state, topLevelIds)]; -}, state => [state.blocks.order]); -/** - * Returns the total number of blocks, or the total number of blocks with a specific name in a post. - * The number returned includes nested blocks. - * - * @param {Object} state Global application state. - * @param {?string} blockName Optional block name, if specified only blocks of that type will be counted. - * - * @return {number} Number of blocks in the post, or number of blocks with name equal to blockName. - */ - -const getGlobalBlockCount = Object(rememo["a" /* default */])((state, blockName) => { - const clientIds = getClientIdsWithDescendants(state); - - if (!blockName) { - return clientIds.length; - } - - return Object(external_lodash_["reduce"])(clientIds, (accumulator, clientId) => { - const block = state.blocks.byClientId[clientId]; - return block.name === blockName ? accumulator + 1 : accumulator; - }, 0); -}, state => [state.blocks.order, state.blocks.byClientId]); -/** - * Given an array of block client IDs, returns the corresponding array of block - * objects. - * - * @param {Object} state Editor state. - * @param {string[]} clientIds Client IDs for which blocks are to be returned. - * - * @return {WPBlock[]} Block objects. - */ - -const getBlocksByClientId = Object(rememo["a" /* default */])((state, clientIds) => Object(external_lodash_["map"])(Object(external_lodash_["castArray"])(clientIds), clientId => getBlock(state, clientId)), (state, clientIds) => Object(external_lodash_["map"])(Object(external_lodash_["castArray"])(clientIds), clientId => state.blocks.tree[clientId])); -/** - * Returns the number of blocks currently present in the post. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {number} Number of blocks in the post. - */ - -function getBlockCount(state, rootClientId) { - return getBlockOrder(state, rootClientId).length; -} -/** - * Returns the current selection start block client ID, attribute key and text - * offset. - * - * @param {Object} state Block editor state. - * - * @return {WPBlockSelection} Selection start information. - */ - -function getSelectionStart(state) { - return state.selection.selectionStart; -} -/** - * Returns the current selection end block client ID, attribute key and text - * offset. - * - * @param {Object} state Block editor state. - * - * @return {WPBlockSelection} Selection end information. - */ - -function getSelectionEnd(state) { - return state.selection.selectionEnd; -} -/** - * Returns the current block selection start. This value may be null, and it - * may represent either a singular block selection or multi-selection start. - * A selection is singular if its start and end match. - * - * @param {Object} state Global application state. - * - * @return {?string} Client ID of block selection start. - */ - -function getBlockSelectionStart(state) { - return state.selection.selectionStart.clientId; -} -/** - * Returns the current block selection end. This value may be null, and it - * may represent either a singular block selection or multi-selection end. - * A selection is singular if its start and end match. - * - * @param {Object} state Global application state. - * - * @return {?string} Client ID of block selection end. - */ - -function getBlockSelectionEnd(state) { - return state.selection.selectionEnd.clientId; -} -/** - * Returns the number of blocks currently selected in the post. - * - * @param {Object} state Global application state. - * - * @return {number} Number of blocks selected in the post. - */ - -function getSelectedBlockCount(state) { - const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length; - - if (multiSelectedBlockCount) { - return multiSelectedBlockCount; - } - - return state.selection.selectionStart.clientId ? 1 : 0; -} -/** - * Returns true if there is a single selected block, or false otherwise. - * - * @param {Object} state Editor state. - * - * @return {boolean} Whether a single block is selected. - */ - -function hasSelectedBlock(state) { - const { - selectionStart, - selectionEnd - } = state.selection; - return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId; -} -/** - * Returns the currently selected block client ID, or null if there is no - * selected block. - * - * @param {Object} state Editor state. - * - * @return {?string} Selected block client ID. - */ - -function getSelectedBlockClientId(state) { - const { - selectionStart, - selectionEnd - } = state.selection; - const { - clientId - } = selectionStart; - - if (!clientId || clientId !== selectionEnd.clientId) { - return null; - } - - return clientId; -} -/** - * Returns the currently selected block, or null if there is no selected block. - * - * @param {Object} state Global application state. - * - * @return {?Object} Selected block. - */ - -function getSelectedBlock(state) { - const clientId = getSelectedBlockClientId(state); - return clientId ? getBlock(state, clientId) : null; -} -/** - * Given a block client ID, returns the root block from which the block is - * nested, an empty string for top-level blocks, or null if the block does not - * exist. - * - * @param {Object} state Editor state. - * @param {string} clientId Block from which to find root client ID. - * - * @return {?string} Root client ID, if exists - */ - -function getBlockRootClientId(state, clientId) { - return state.blocks.parents[clientId] !== undefined ? state.blocks.parents[clientId] : null; -} -/** - * Given a block client ID, returns the list of all its parents from top to bottom. - * - * @param {Object} state Editor state. - * @param {string} clientId Block from which to find root client ID. - * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false). - * - * @return {Array} ClientIDs of the parent blocks. - */ - -const getBlockParents = Object(rememo["a" /* default */])(function (state, clientId) { - let ascending = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - const parents = []; - let current = clientId; - - while (!!state.blocks.parents[current]) { - current = state.blocks.parents[current]; - parents.push(current); - } - - return ascending ? parents : parents.reverse(); -}, state => [state.blocks.parents]); -/** - * Given a block client ID and a block name, returns the list of all its parents - * from top to bottom, filtered by the given name(s). For example, if passed - * 'core/group' as the blockName, it will only return parents which are group - * blocks. If passed `[ 'core/group', 'core/cover']`, as the blockName, it will - * return parents which are group blocks and parents which are cover blocks. - * - * @param {Object} state Editor state. - * @param {string} clientId Block from which to find root client ID. - * @param {string|string[]} blockName Block name(s) to filter. - * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false). - * - * @return {Array} ClientIDs of the parent blocks. - */ - -const getBlockParentsByBlockName = Object(rememo["a" /* default */])(function (state, clientId, blockName) { - let ascending = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - const parents = getBlockParents(state, clientId, ascending); - return Object(external_lodash_["map"])(Object(external_lodash_["filter"])(Object(external_lodash_["map"])(parents, id => ({ - id, - name: getBlockName(state, id) - })), _ref => { - let { - name - } = _ref; - - if (Array.isArray(blockName)) { - return blockName.includes(name); - } - - return name === blockName; - }), _ref2 => { - let { - id - } = _ref2; - return id; - }); -}, state => [state.blocks.parents]); -/** - * Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks. - * - * @param {Object} state Editor state. - * @param {string} clientId Block from which to find root client ID. - * - * @return {string} Root client ID - */ - -function getBlockHierarchyRootClientId(state, clientId) { - let current = clientId; - let parent; - - do { - parent = current; - current = state.blocks.parents[current]; - } while (current); - - return parent; -} -/** - * Given a block client ID, returns the lowest common ancestor with selected client ID. - * - * @param {Object} state Editor state. - * @param {string} clientId Block from which to find common ancestor client ID. - * - * @return {string} Common ancestor client ID or undefined - */ - -function getLowestCommonAncestorWithSelectedBlock(state, clientId) { - const selectedId = getSelectedBlockClientId(state); - const clientParents = [...getBlockParents(state, clientId), clientId]; - const selectedParents = [...getBlockParents(state, selectedId), selectedId]; - let lowestCommonAncestor; - const maxDepth = Math.min(clientParents.length, selectedParents.length); - - for (let index = 0; index < maxDepth; index++) { - if (clientParents[index] === selectedParents[index]) { - lowestCommonAncestor = clientParents[index]; - } else { - break; - } - } - - return lowestCommonAncestor; -} -/** - * Returns the client ID of the block adjacent one at the given reference - * startClientId and modifier directionality. Defaults start startClientId to - * the selected block, and direction as next block. Returns null if there is no - * adjacent block. - * - * @param {Object} state Editor state. - * @param {?string} startClientId Optional client ID of block from which to - * search. - * @param {?number} modifier Directionality multiplier (1 next, -1 - * previous). - * - * @return {?string} Return the client ID of the block, or null if none exists. - */ - -function getAdjacentBlockClientId(state, startClientId) { - let modifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - - // Default to selected block. - if (startClientId === undefined) { - startClientId = getSelectedBlockClientId(state); - } // Try multi-selection starting at extent based on modifier. - - - if (startClientId === undefined) { - if (modifier < 0) { - startClientId = getFirstMultiSelectedBlockClientId(state); - } else { - startClientId = getLastMultiSelectedBlockClientId(state); - } - } // Validate working start client ID. - - - if (!startClientId) { - return null; - } // Retrieve start block root client ID, being careful to allow the falsey - // empty string top-level root by explicitly testing against null. - - - const rootClientId = getBlockRootClientId(state, startClientId); - - if (rootClientId === null) { - return null; - } - - const { - order - } = state.blocks; - const orderSet = order[rootClientId]; - const index = orderSet.indexOf(startClientId); - const nextIndex = index + 1 * modifier; // Block was first in set and we're attempting to get previous. - - if (nextIndex < 0) { - return null; - } // Block was last in set and we're attempting to get next. - - - if (nextIndex === orderSet.length) { - return null; - } // Assume incremented index is within the set. - - - return orderSet[nextIndex]; -} -/** - * Returns the previous block's client ID from the given reference start ID. - * Defaults start to the selected block. Returns null if there is no previous - * block. - * - * @param {Object} state Editor state. - * @param {?string} startClientId Optional client ID of block from which to - * search. - * - * @return {?string} Adjacent block's client ID, or null if none exists. - */ - -function getPreviousBlockClientId(state, startClientId) { - return getAdjacentBlockClientId(state, startClientId, -1); -} -/** - * Returns the next block's client ID from the given reference start ID. - * Defaults start to the selected block. Returns null if there is no next - * block. - * - * @param {Object} state Editor state. - * @param {?string} startClientId Optional client ID of block from which to - * search. - * - * @return {?string} Adjacent block's client ID, or null if none exists. - */ - -function getNextBlockClientId(state, startClientId) { - return getAdjacentBlockClientId(state, startClientId, 1); -} -/* eslint-disable jsdoc/valid-types */ - -/** - * Returns the initial caret position for the selected block. - * This position is to used to position the caret properly when the selected block changes. - * If the current block is not a RichText, having initial position set to 0 means "focus block" - * - * @param {Object} state Global application state. - * - * @return {0|-1|null} Initial position. - */ - -function getSelectedBlocksInitialCaretPosition(state) { - /* eslint-enable jsdoc/valid-types */ - return state.initialPosition; -} -/** - * Returns the current selection set of block client IDs (multiselection or single selection). - * - * @param {Object} state Editor state. - * - * @return {Array} Multi-selected block client IDs. - */ - -const getSelectedBlockClientIds = Object(rememo["a" /* default */])(state => { - const { - selectionStart, - selectionEnd - } = state.selection; - - if (selectionStart.clientId === undefined || selectionEnd.clientId === undefined) { - return EMPTY_ARRAY; - } - - if (selectionStart.clientId === selectionEnd.clientId) { - return [selectionStart.clientId]; - } // Retrieve root client ID to aid in retrieving relevant nested block - // order, being careful to allow the falsey empty string top-level root - // by explicitly testing against null. - - - const rootClientId = getBlockRootClientId(state, selectionStart.clientId); - - if (rootClientId === null) { - return EMPTY_ARRAY; - } - - const blockOrder = getBlockOrder(state, rootClientId); - const startIndex = blockOrder.indexOf(selectionStart.clientId); - const endIndex = blockOrder.indexOf(selectionEnd.clientId); - - if (startIndex > endIndex) { - return blockOrder.slice(endIndex, startIndex + 1); - } - - return blockOrder.slice(startIndex, endIndex + 1); -}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]); -/** - * Returns the current multi-selection set of block client IDs, or an empty - * array if there is no multi-selection. - * - * @param {Object} state Editor state. - * - * @return {Array} Multi-selected block client IDs. - */ - -function getMultiSelectedBlockClientIds(state) { - const { - selectionStart, - selectionEnd - } = state.selection; - - if (selectionStart.clientId === selectionEnd.clientId) { - return EMPTY_ARRAY; - } - - return getSelectedBlockClientIds(state); -} -/** - * Returns the current multi-selection set of blocks, or an empty array if - * there is no multi-selection. - * - * @param {Object} state Editor state. - * - * @return {Array} Multi-selected block objects. - */ - -const getMultiSelectedBlocks = Object(rememo["a" /* default */])(state => { - const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); - - if (!multiSelectedBlockClientIds.length) { - return EMPTY_ARRAY; - } - - return multiSelectedBlockClientIds.map(clientId => getBlock(state, clientId)); -}, state => [...getSelectedBlockClientIds.getDependants(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes]); -/** - * Returns the client ID of the first block in the multi-selection set, or null - * if there is no multi-selection. - * - * @param {Object} state Editor state. - * - * @return {?string} First block client ID in the multi-selection set. - */ - -function getFirstMultiSelectedBlockClientId(state) { - return Object(external_lodash_["first"])(getMultiSelectedBlockClientIds(state)) || null; -} -/** - * Returns the client ID of the last block in the multi-selection set, or null - * if there is no multi-selection. - * - * @param {Object} state Editor state. - * - * @return {?string} Last block client ID in the multi-selection set. - */ - -function getLastMultiSelectedBlockClientId(state) { - return Object(external_lodash_["last"])(getMultiSelectedBlockClientIds(state)) || null; -} -/** - * Returns true if a multi-selection exists, and the block corresponding to the - * specified client ID is the first block of the multi-selection set, or false - * otherwise. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {boolean} Whether block is first in multi-selection. - */ - -function isFirstMultiSelectedBlock(state, clientId) { - return getFirstMultiSelectedBlockClientId(state) === clientId; -} -/** - * Returns true if the client ID occurs within the block multi-selection, or - * false otherwise. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {boolean} Whether block is in multi-selection set. - */ - -function isBlockMultiSelected(state, clientId) { - return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1; -} -/** - * Returns true if an ancestor of the block is multi-selected, or false - * otherwise. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {boolean} Whether an ancestor of the block is in multi-selection - * set. - */ - -const isAncestorMultiSelected = Object(rememo["a" /* default */])((state, clientId) => { - let ancestorClientId = clientId; - let isMultiSelected = false; - - while (ancestorClientId && !isMultiSelected) { - ancestorClientId = getBlockRootClientId(state, ancestorClientId); - isMultiSelected = isBlockMultiSelected(state, ancestorClientId); - } - - return isMultiSelected; -}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]); -/** - * Returns the client ID of the block which begins the multi-selection set, or - * null if there is no multi-selection. - * - * This is not necessarily the first client ID in the selection. - * - * @see getFirstMultiSelectedBlockClientId - * - * @param {Object} state Editor state. - * - * @return {?string} Client ID of block beginning multi-selection. - */ - -function getMultiSelectedBlocksStartClientId(state) { - const { - selectionStart, - selectionEnd - } = state.selection; - - if (selectionStart.clientId === selectionEnd.clientId) { - return null; - } - - return selectionStart.clientId || null; -} -/** - * Returns the client ID of the block which ends the multi-selection set, or - * null if there is no multi-selection. - * - * This is not necessarily the last client ID in the selection. - * - * @see getLastMultiSelectedBlockClientId - * - * @param {Object} state Editor state. - * - * @return {?string} Client ID of block ending multi-selection. - */ - -function getMultiSelectedBlocksEndClientId(state) { - const { - selectionStart, - selectionEnd - } = state.selection; - - if (selectionStart.clientId === selectionEnd.clientId) { - return null; - } - - return selectionEnd.clientId || null; -} -/** - * Returns an array containing all block client IDs in the editor in the order - * they appear. Optionally accepts a root client ID of the block list for which - * the order should be returned, defaulting to the top-level block order. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {Array} Ordered client IDs of editor blocks. - */ - -function getBlockOrder(state, rootClientId) { - return state.blocks.order[rootClientId || ''] || EMPTY_ARRAY; -} -/** - * Returns the index at which the block corresponding to the specified client - * ID occurs within the block order, or `-1` if the block does not exist. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {number} Index at which block exists in order. - */ - -function getBlockIndex(state, clientId) { - const rootClientId = getBlockRootClientId(state, clientId); - return getBlockOrder(state, rootClientId).indexOf(clientId); -} -/** - * Returns true if the block corresponding to the specified client ID is - * currently selected and no multi-selection exists, or false otherwise. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {boolean} Whether block is selected and multi-selection exists. - */ - -function isBlockSelected(state, clientId) { - const { - selectionStart, - selectionEnd - } = state.selection; - - if (selectionStart.clientId !== selectionEnd.clientId) { - return false; - } - - return selectionStart.clientId === clientId; -} -/** - * Returns true if one of the block's inner blocks is selected. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * @param {boolean} deep Perform a deep check. - * - * @return {boolean} Whether the block as an inner block selected - */ - -function hasSelectedInnerBlock(state, clientId) { - let deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - return Object(external_lodash_["some"])(getBlockOrder(state, clientId), innerClientId => isBlockSelected(state, innerClientId) || isBlockMultiSelected(state, innerClientId) || deep && hasSelectedInnerBlock(state, innerClientId, deep)); -} -/** - * Returns true if the block corresponding to the specified client ID is - * currently selected but isn't the last of the selected blocks. Here "last" - * refers to the block sequence in the document, _not_ the sequence of - * multi-selection, which is why `state.selectionEnd` isn't used. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {boolean} Whether block is selected and not the last in the - * selection. - */ - -function isBlockWithinSelection(state, clientId) { - if (!clientId) { - return false; - } - - const clientIds = getMultiSelectedBlockClientIds(state); - const index = clientIds.indexOf(clientId); - return index > -1 && index < clientIds.length - 1; -} -/** - * Returns true if a multi-selection has been made, or false otherwise. - * - * @param {Object} state Editor state. - * - * @return {boolean} Whether multi-selection has been made. - */ - -function hasMultiSelection(state) { - const { - selectionStart, - selectionEnd - } = state.selection; - return selectionStart.clientId !== selectionEnd.clientId; -} -/** - * Whether in the process of multi-selecting or not. This flag is only true - * while the multi-selection is being selected (by mouse move), and is false - * once the multi-selection has been settled. - * - * @see hasMultiSelection - * - * @param {Object} state Global application state. - * - * @return {boolean} True if multi-selecting, false if not. - */ - -function selectors_isMultiSelecting(state) { - return state.isMultiSelecting; -} -/** - * Selector that returns if multi-selection is enabled or not. - * - * @param {Object} state Global application state. - * - * @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled. - */ - -function selectors_isSelectionEnabled(state) { - return state.isSelectionEnabled; -} -/** - * Returns the block's editing mode, defaulting to "visual" if not explicitly - * assigned. - * - * @param {Object} state Editor state. - * @param {string} clientId Block client ID. - * - * @return {Object} Block editing mode. - */ - -function getBlockMode(state, clientId) { - return state.blocksMode[clientId] || 'visual'; -} -/** - * Returns true if the user is typing, or false otherwise. - * - * @param {Object} state Global application state. - * - * @return {boolean} Whether user is typing. - */ - -function selectors_isTyping(state) { - return state.isTyping; -} -/** - * Returns true if the user is dragging blocks, or false otherwise. - * - * @param {Object} state Global application state. - * - * @return {boolean} Whether user is dragging blocks. - */ - -function isDraggingBlocks(state) { - return !!state.draggedBlocks.length; -} -/** - * Returns the client ids of any blocks being directly dragged. - * - * This does not include children of a parent being dragged. - * - * @param {Object} state Global application state. - * - * @return {string[]} Array of dragged block client ids. - */ - -function getDraggedBlockClientIds(state) { - return state.draggedBlocks; -} -/** - * Returns whether the block is being dragged. - * - * Only returns true if the block is being directly dragged, - * not if the block is a child of a parent being dragged. - * See `isAncestorBeingDragged` for child blocks. - * - * @param {Object} state Global application state. - * @param {string} clientId Client id for block to check. - * - * @return {boolean} Whether the block is being dragged. - */ - -function isBlockBeingDragged(state, clientId) { - return state.draggedBlocks.includes(clientId); -} -/** - * Returns whether a parent/ancestor of the block is being dragged. - * - * @param {Object} state Global application state. - * @param {string} clientId Client id for block to check. - * - * @return {boolean} Whether the block's ancestor is being dragged. - */ - -function isAncestorBeingDragged(state, clientId) { - // Return early if no blocks are being dragged rather than - // the more expensive check for parents. - if (!isDraggingBlocks(state)) { - return false; - } - - const parents = getBlockParents(state, clientId); - return Object(external_lodash_["some"])(parents, parentClientId => isBlockBeingDragged(state, parentClientId)); -} -/** - * Returns true if the caret is within formatted text, or false otherwise. - * - * @param {Object} state Global application state. - * - * @return {boolean} Whether the caret is within formatted text. - */ - -function selectors_isCaretWithinFormattedText(state) { - return state.isCaretWithinFormattedText; -} -/** - * Returns the insertion point, the index at which the new inserted block would - * be placed. Defaults to the last index. - * - * @param {Object} state Editor state. - * - * @return {Object} Insertion point object with `rootClientId`, `index`. - */ - -function getBlockInsertionPoint(state) { - let rootClientId, index; - const { - insertionPoint, - selection: { - selectionEnd - } - } = state; - - if (insertionPoint !== null) { - return insertionPoint; - } - - const { - clientId - } = selectionEnd; - - if (clientId) { - rootClientId = getBlockRootClientId(state, clientId) || undefined; - index = getBlockIndex(state, selectionEnd.clientId, rootClientId) + 1; - } else { - index = getBlockOrder(state).length; - } - - return { - rootClientId, - index - }; -} -/** - * Returns true if we should show the block insertion point. - * - * @param {Object} state Global application state. - * - * @return {?boolean} Whether the insertion point is visible or not. - */ - -function isBlockInsertionPointVisible(state) { - return state.insertionPoint !== null; -} -/** - * Returns whether the blocks matches the template or not. - * - * @param {boolean} state - * @return {?boolean} Whether the template is valid or not. - */ - -function selectors_isValidTemplate(state) { - return state.template.isValid; -} -/** - * Returns the defined block template - * - * @param {boolean} state - * - * @return {?Array} Block Template. - */ - -function getTemplate(state) { - return state.settings.template; -} -/** - * Returns the defined block template lock. Optionally accepts a root block - * client ID as context, otherwise defaulting to the global context. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional block root client ID. - * - * @return {?string} Block Template Lock - */ - -function getTemplateLock(state, rootClientId) { - if (!rootClientId) { - return state.settings.templateLock; - } - - const blockListSettings = getBlockListSettings(state, rootClientId); - - if (!blockListSettings) { - return null; - } - - return blockListSettings.templateLock; -} - -const checkAllowList = function (list, item) { - let defaultResult = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - - if (Object(external_lodash_["isBoolean"])(list)) { - return list; - } - - if (Object(external_lodash_["isArray"])(list)) { - // TODO: when there is a canonical way to detect that we are editing a post - // the following check should be changed to something like: - // if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null ) - if (list.includes('core/post-content') && item === null) { - return true; - } - - return list.includes(item); - } - - return defaultResult; -}; -/** - * Determines if the given block type is allowed to be inserted into the block list. - * This function is not exported and not memoized because using a memoized selector - * inside another memoized selector is just a waste of time. - * - * @param {Object} state Editor state. - * @param {string|Object} blockName The block type object, e.g., the response - * from the block directory; or a string name of - * an installed block type, e.g.' core/paragraph'. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given block type is allowed to be inserted. - */ - - -const canInsertBlockTypeUnmemoized = function (state, blockName) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - let blockType; - - if (blockName && 'object' === typeof blockName) { - blockType = blockName; - blockName = blockType.name; - } else { - blockType = Object(external_wp_blocks_["getBlockType"])(blockName); - } - - if (!blockType) { - return false; - } - - const { - allowedBlockTypes - } = getSettings(state); - const isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true); - - if (!isBlockAllowedInEditor) { - return false; - } - - const isLocked = !!getTemplateLock(state, rootClientId); - - if (isLocked) { - return false; - } - - const parentBlockListSettings = getBlockListSettings(state, rootClientId); // The parent block doesn't have settings indicating it doesn't support - // inner blocks, return false. - - if (rootClientId && parentBlockListSettings === undefined) { - return false; - } - - const parentAllowedBlocks = parentBlockListSettings === null || parentBlockListSettings === void 0 ? void 0 : parentBlockListSettings.allowedBlocks; - const hasParentAllowedBlock = checkAllowList(parentAllowedBlocks, blockName); - const blockAllowedParentBlocks = blockType.parent; - const parentName = getBlockName(state, rootClientId); - const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName); - const canInsert = hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true; - - if (!canInsert) { - return canInsert; - } - /** - * This filter is an ad-hoc solution to prevent adding template parts inside post content. - * Conceptually, having a filter inside a selector is bad pattern so this code will be - * replaced by a declarative API that doesn't the following drawbacks: - * - * Filters are not reactive: Upon switching between "template mode" and non "template mode", - * the filter and selector won't necessarily be executed again. For now, it doesn't matter much - * because you can't switch between the two modes while the inserter stays open. - * - * Filters are global: Once they're defined, they will affect all editor instances and all registries. - * An ideal API would only affect specific editor instances. - */ - - - return Object(external_wp_hooks_["applyFilters"])('blockEditor.__unstableCanInsertBlockType', canInsert, blockType, rootClientId, { - // Pass bound selectors of the current registry. If we're in a nested - // context, the data will differ from the one selected from the root - // registry. - getBlock: getBlock.bind(null, state), - getBlockParentsByBlockName: getBlockParentsByBlockName.bind(null, state) - }); -}; -/** - * Determines if the given block type is allowed to be inserted into the block list. - * - * @param {Object} state Editor state. - * @param {string} blockName The name of the block type, e.g.' core/paragraph'. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given block type is allowed to be inserted. - */ - - -const canInsertBlockType = Object(rememo["a" /* default */])(canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId[rootClientId], state.settings.allowedBlockTypes, state.settings.templateLock]); -/** - * Determines if the given blocks are allowed to be inserted into the block - * list. - * - * @param {Object} state Editor state. - * @param {string} clientIds The block client IDs to be inserted. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given blocks are allowed to be inserted. - */ - -function canInsertBlocks(state, clientIds) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - return clientIds.every(id => canInsertBlockType(state, getBlockName(state, id), rootClientId)); -} -/** - * Determines if the given block is allowed to be deleted. - * - * @param {Object} state Editor state. - * @param {string} clientId The block client Id. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given block is allowed to be removed. - */ - -function canRemoveBlock(state, clientId) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - const attributes = getBlockAttributes(state, clientId); // attributes can be null if the block is already deleted. - - if (attributes === null) { - return true; - } - - const { - lock - } = attributes; - const parentIsLocked = !!getTemplateLock(state, rootClientId); // If we don't have a lock on the blockType level, we differ to the parent templateLock. - - if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.remove) === undefined) { - return !parentIsLocked; - } // when remove is true, it means we cannot remove it. - - - return !(lock !== null && lock !== void 0 && lock.remove); -} -/** - * Determines if the given blocks are allowed to be removed. - * - * @param {Object} state Editor state. - * @param {string} clientIds The block client IDs to be removed. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given blocks are allowed to be removed. - */ - -function selectors_canRemoveBlocks(state, clientIds) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - return clientIds.every(clientId => canRemoveBlock(state, clientId, rootClientId)); -} -/** - * Determines if the given block is allowed to be moved. - * - * @param {Object} state Editor state. - * @param {string} clientId The block client Id. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given block is allowed to be moved. - */ - -function canMoveBlock(state, clientId) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - const attributes = getBlockAttributes(state, clientId); - - if (attributes === null) { - return; - } - - const { - lock - } = attributes; - const parentIsLocked = getTemplateLock(state, rootClientId) === 'all'; // If we don't have a lock on the blockType level, we differ to the parent templateLock. - - if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.move) === undefined) { - return !parentIsLocked; - } // when move is true, it means we cannot move it. - - - return !(lock !== null && lock !== void 0 && lock.move); -} -/** - * Determines if the given blocks are allowed to be moved. - * - * @param {Object} state Editor state. - * @param {string} clientIds The block client IDs to be moved. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given blocks are allowed to be moved. - */ - -function selectors_canMoveBlocks(state, clientIds) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId)); -} -/** - * Returns information about how recently and frequently a block has been inserted. - * - * @param {Object} state Global application state. - * @param {string} id A string which identifies the insert, e.g. 'core/block/12' - * - * @return {?{ time: number, count: number }} An object containing `time` which is when the last - * insert occurred as a UNIX epoch, and `count` which is - * the number of inserts that have occurred. - */ - -function getInsertUsage(state, id) { - var _state$preferences$in, _state$preferences$in2; - - return (_state$preferences$in = (_state$preferences$in2 = state.preferences.insertUsage) === null || _state$preferences$in2 === void 0 ? void 0 : _state$preferences$in2[id]) !== null && _state$preferences$in !== void 0 ? _state$preferences$in : null; -} -/** - * Returns whether we can show a block type in the inserter - * - * @param {Object} state Global State - * @param {Object} blockType BlockType - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Whether the given block type is allowed to be shown in the inserter. - */ - - -const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => { - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'inserter', true)) { - return false; - } - - return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId); -}; -/** - * Return a function to be used to tranform a block variation to an inserter item - * - * @param {Object} state Global State - * @param {Object} item Denormalized inserter item - * @return {Function} Function to transform a block variation to inserter item - */ - - -const getItemFromVariation = (state, item) => variation => { - const variationId = `${item.id}/${variation.name}`; - const { - time, - count = 0 - } = getInsertUsage(state, variationId) || {}; - return { ...item, - id: variationId, - icon: variation.icon || item.icon, - title: variation.title || item.title, - description: variation.description || item.description, - category: variation.category || item.category, - // If `example` is explicitly undefined for the variation, the preview will not be shown. - example: variation.hasOwnProperty('example') ? variation.example : item.example, - initialAttributes: { ...item.initialAttributes, - ...variation.attributes - }, - innerBlocks: variation.innerBlocks, - keywords: variation.keywords || item.keywords, - frecency: calculateFrecency(time, count) - }; -}; -/** - * Returns the calculated frecency. - * - * 'frecency' is a heuristic (https://en.wikipedia.org/wiki/Frecency) - * that combines block usage frequenty and recency. - * - * @param {number} time When the last insert occurred as a UNIX epoch - * @param {number} count The number of inserts that have occurred. - * - * @return {number} The calculated frecency. - */ - - -const calculateFrecency = (time, count) => { - if (!time) { - return count; - } // The selector is cached, which means Date.now() is the last time that the - // relevant state changed. This suits our needs. - - - const duration = Date.now() - time; - - switch (true) { - case duration < MILLISECONDS_PER_HOUR: - return count * 4; - - case duration < MILLISECONDS_PER_DAY: - return count * 2; - - case duration < MILLISECONDS_PER_WEEK: - return count / 2; - - default: - return count / 4; - } -}; -/** - * Returns a function that accepts a block type and builds an item to be shown - * in a specific context. It's used for building items for Inserter and available - * block Transfroms list. - * - * @param {Object} state Editor state. - * @param {Object} options Options object for handling the building of a block type. - * @param {string} options.buildScope The scope for which the item is going to be used. - * @return {Function} Function returns an item to be shown in a specific context (Inserter|Transforms list). - */ - - -const buildBlockTypeItem = (state, _ref3) => { - let { - buildScope = 'inserter' - } = _ref3; - return blockType => { - const id = blockType.name; - let isDisabled = false; - - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType.name, 'multiple', true)) { - isDisabled = Object(external_lodash_["some"])(getBlocksByClientId(state, getClientIdsWithDescendants(state)), { - name: blockType.name - }); - } - - const { - time, - count = 0 - } = getInsertUsage(state, id) || {}; - const blockItemBase = { - id, - name: blockType.name, - title: blockType.title, - icon: blockType.icon, - isDisabled, - frecency: calculateFrecency(time, count) - }; - if (buildScope === 'transform') return blockItemBase; - const inserterVariations = Object(external_wp_blocks_["getBlockVariations"])(blockType.name, 'inserter'); - return { ...blockItemBase, - initialAttributes: {}, - description: blockType.description, - category: blockType.category, - keywords: blockType.keywords, - variations: inserterVariations, - example: blockType.example, - utility: 1 // deprecated - - }; - }; -}; -/** - * Determines the items that appear in the inserter. Includes both static - * items (e.g. a regular block type) and dynamic items (e.g. a reusable block). - * - * Each item object contains what's necessary to display a button in the - * inserter and handle its selection. - * - * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency) - * that combines block usage frequenty and recency. - * - * Items are returned ordered descendingly by their 'utility' and 'frecency'. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {WPEditorInserterItem[]} Items that appear in inserter. - * - * @typedef {Object} WPEditorInserterItem - * @property {string} id Unique identifier for the item. - * @property {string} name The type of block to create. - * @property {Object} initialAttributes Attributes to pass to the newly created block. - * @property {string} title Title of the item, as it appears in the inserter. - * @property {string} icon Dashicon for the item, as it appears in the inserter. - * @property {string} category Block category that the item is associated with. - * @property {string[]} keywords Keywords that can be searched to find this item. - * @property {boolean} isDisabled Whether or not the user should be prevented from inserting - * this item. - * @property {number} frecency Heuristic that combines frequency and recency. - */ - - -const getInserterItems = Object(rememo["a" /* default */])(function (state) { - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - const buildBlockTypeInserterItem = buildBlockTypeItem(state, { - buildScope: 'inserter' - }); - /* - * Matches block comment delimiters amid serialized content. - * - * @see `tokenizer` in `@wordpress/block-serialization-default-parser` - * package - * - * blockParserTokenizer differs from the original tokenizer in the - * following ways: - * - * - removed global flag (/g) - * - prepended ^\s* - * - */ - - const blockParserTokenizer = /^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/; - - const buildReusableBlockInserterItem = reusableBlock => { - let icon = symbol["a" /* default */]; - /* - * Instead of always displaying a generic "symbol" icon for every - * reusable block, try to use an icon that represents the first - * outermost block contained in the reusable block. This requires - * scanning the serialized form of the reusable block to find its - * first block delimiter, then looking up the corresponding block - * type, if available. - */ - - if (external_wp_element_["Platform"].OS === 'web') { - const content = typeof reusableBlock.content.raw === 'string' ? reusableBlock.content.raw : reusableBlock.content; - const rawBlockMatch = content.match(blockParserTokenizer); - - if (rawBlockMatch) { - const [,, namespace = 'core/', blockName] = rawBlockMatch; - const referencedBlockType = Object(external_wp_blocks_["getBlockType"])(namespace + blockName); - - if (referencedBlockType) { - icon = referencedBlockType.icon; - } - } - } - - const id = `core/block/${reusableBlock.id}`; - const { - time, - count = 0 - } = getInsertUsage(state, id) || {}; - const frecency = calculateFrecency(time, count); - return { - id, - name: 'core/block', - initialAttributes: { - ref: reusableBlock.id - }, - title: reusableBlock.title.raw, - icon, - category: 'reusable', - keywords: [], - isDisabled: false, - utility: 1, - // deprecated - frecency - }; - }; - - const blockTypeInserterItems = Object(external_wp_blocks_["getBlockTypes"])().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)).map(buildBlockTypeInserterItem); - const reusableBlockInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? getReusableBlocks(state).map(buildReusableBlockInserterItem) : []; - const items = blockTypeInserterItems.reduce((accumulator, item) => { - const { - variations = [] - } = item; // Exclude any block type item that is to be replaced by a default variation - - if (!variations.some(_ref4 => { - let { - isDefault - } = _ref4; - return isDefault; - })) { - accumulator.push(item); - } - - if (variations.length) { - const variationMapper = getItemFromVariation(state, item); - accumulator.push(...variations.map(variationMapper)); - } - - return accumulator; - }, []); // Ensure core blocks are prioritized in the returned results, - // because third party blocks can be registered earlier than - // the core blocks (usually by using the `init` action), - // thus affecting the display order. - // We don't sort reusable blocks as they are handled differently. - - const groupByType = (blocks, block) => { - const { - core, - noncore - } = blocks; - const type = block.name.startsWith('core/') ? core : noncore; - type.push(block); - return blocks; - }; - - const { - core: coreItems, - noncore: nonCoreItems - } = items.reduce(groupByType, { - core: [], - noncore: [] - }); - const sortedBlockTypes = [...coreItems, ...nonCoreItems]; - return [...sortedBlockTypes, ...reusableBlockInserterItems]; -}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.blocks.order, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), Object(external_wp_blocks_["getBlockTypes"])()]); -/** - * Determines the items that appear in the available block transforms list. - * - * Each item object contains what's necessary to display a menu item in the - * transform list and handle its selection. - * - * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency) - * that combines block usage frequenty and recency. - * - * Items are returned ordered descendingly by their 'frecency'. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {WPEditorTransformItem[]} Items that appear in inserter. - * - * @typedef {Object} WPEditorTransformItem - * @property {string} id Unique identifier for the item. - * @property {string} name The type of block to create. - * @property {string} title Title of the item, as it appears in the inserter. - * @property {string} icon Dashicon for the item, as it appears in the inserter. - * @property {boolean} isDisabled Whether or not the user should be prevented from inserting - * this item. - * @property {number} frecency Heuristic that combines frequency and recency. - */ - -const getBlockTransformItems = Object(rememo["a" /* default */])(function (state, blocks) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - const buildBlockTypeTransformItem = buildBlockTypeItem(state, { - buildScope: 'transform' - }); - const blockTypeTransformItems = Object(external_wp_blocks_["getBlockTypes"])().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)).map(buildBlockTypeTransformItem); - const itemsByName = Object(external_lodash_["mapKeys"])(blockTypeTransformItems, _ref5 => { - let { - name - } = _ref5; - return name; - }); - const possibleTransforms = Object(external_wp_blocks_["getPossibleBlockTransformations"])(blocks).reduce((accumulator, block) => { - if (itemsByName[block === null || block === void 0 ? void 0 : block.name]) { - accumulator.push(itemsByName[block.name]); - } - - return accumulator; - }, []); - const possibleBlockTransformations = Object(external_lodash_["orderBy"])(possibleTransforms, block => itemsByName[block.name].frecency, 'desc'); - return possibleBlockTransformations; -}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, Object(external_wp_blocks_["getBlockTypes"])()]); -/** - * Determines whether there are items to show in the inserter. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {boolean} Items that appear in inserter. - */ - -const hasInserterItems = Object(rememo["a" /* default */])(function (state) { - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - const hasBlockType = Object(external_lodash_["some"])(Object(external_wp_blocks_["getBlockTypes"])(), blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)); - - if (hasBlockType) { - return true; - } - - const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && getReusableBlocks(state).length > 0; - return hasReusableBlock; -}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), Object(external_wp_blocks_["getBlockTypes"])()]); -/** - * Returns the list of allowed inserter blocks for inner blocks children - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {Array?} The list of allowed block types. - */ - -const __experimentalGetAllowedBlocks = Object(rememo["a" /* default */])(function (state) { - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (!rootClientId) { - return; - } - - return Object(external_lodash_["filter"])(Object(external_wp_blocks_["getBlockTypes"])(), blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)); -}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, Object(external_wp_blocks_["getBlockTypes"])()]); -/** - * Returns the block to be directly inserted by the block appender. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {?Array} The block type to be directly inserted. - */ - -const __experimentalGetDirectInsertBlock = Object(rememo["a" /* default */])(function (state) { - var _state$blockListSetti, _state$blockListSetti2; - - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (!rootClientId) { - return; - } - - const defaultBlock = (_state$blockListSetti = state.blockListSettings[rootClientId]) === null || _state$blockListSetti === void 0 ? void 0 : _state$blockListSetti.__experimentalDefaultBlock; - const directInsert = (_state$blockListSetti2 = state.blockListSettings[rootClientId]) === null || _state$blockListSetti2 === void 0 ? void 0 : _state$blockListSetti2.__experimentalDirectInsert; - - if (!defaultBlock || !directInsert) { - return; - } - - if (typeof directInsert === 'function') { - return directInsert(getBlock(state, rootClientId)) ? defaultBlock : null; - } - - return defaultBlock; -}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree[rootClientId]]); - -const checkAllowListRecursive = (blocks, allowedBlockTypes) => { - if (Object(external_lodash_["isBoolean"])(allowedBlockTypes)) { - return allowedBlockTypes; - } - - const blocksQueue = [...blocks]; - - while (blocksQueue.length > 0) { - var _block$innerBlocks; - - const block = blocksQueue.shift(); - const isAllowed = checkAllowList(allowedBlockTypes, block.name || block.blockName, true); - - if (!isAllowed) { - return false; - } - - (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => { - blocksQueue.push(innerBlock); - }); - } - - return true; -}; - -const __experimentalGetParsedPattern = Object(rememo["a" /* default */])((state, patternName) => { - const patterns = state.settings.__experimentalBlockPatterns; - const pattern = patterns.find(_ref6 => { - let { - name - } = _ref6; - return name === patternName; - }); - - if (!pattern) { - return null; - } - - return { ...pattern, - blocks: Object(external_wp_blocks_["parse"])(pattern.content) - }; -}, state => [state.settings.__experimentalBlockPatterns]); -const getAllAllowedPatterns = Object(rememo["a" /* default */])(state => { - const patterns = state.settings.__experimentalBlockPatterns; - const { - allowedBlockTypes - } = getSettings(state); - const parsedPatterns = patterns.filter(_ref7 => { - let { - inserter = true - } = _ref7; - return !!inserter; - }).map(_ref8 => { - let { - name - } = _ref8; - return __experimentalGetParsedPattern(state, name); - }); - const allowedPatterns = parsedPatterns.filter(_ref9 => { - let { - blocks - } = _ref9; - return checkAllowListRecursive(blocks, allowedBlockTypes); - }); - return allowedPatterns; -}, state => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes]); -/** - * Returns the list of allowed patterns for inner blocks children. - * - * @param {Object} state Editor state. - * @param {?string} rootClientId Optional target root client ID. - * - * @return {Array?} The list of allowed patterns. - */ - -const __experimentalGetAllowedPatterns = Object(rememo["a" /* default */])(function (state) { - let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - const availableParsedPatterns = getAllAllowedPatterns(state); - const patternsAllowed = Object(external_lodash_["filter"])(availableParsedPatterns, _ref10 => { - let { - blocks - } = _ref10; - return blocks.every(_ref11 => { - let { - name - } = _ref11; - return canInsertBlockType(state, name, rootClientId); - }); - }); - return patternsAllowed; -}, (state, rootClientId) => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes, state.settings.templateLock, state.blockListSettings[rootClientId], state.blocks.byClientId[rootClientId]]); -/** - * Returns the list of patterns based on their declared `blockTypes` - * and a block's name. - * Patterns can use `blockTypes` to integrate in work flows like - * suggesting appropriate patterns in a Placeholder state(during insertion) - * or blocks transformations. - * - * @param {Object} state Editor state. - * @param {string|string[]} blockNames Block's name or array of block names to find matching pattens. - * @param {?string} rootClientId Optional target root client ID. - * - * @return {Array} The list of matched block patterns based on declared `blockTypes` and block name. - */ - -const __experimentalGetPatternsByBlockTypes = Object(rememo["a" /* default */])(function (state, blockNames) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - if (!blockNames) return EMPTY_ARRAY; - - const patterns = __experimentalGetAllowedPatterns(state, rootClientId); - - const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; - return patterns.filter(pattern => { - var _pattern$blockTypes, _pattern$blockTypes$s; - - return pattern === null || pattern === void 0 ? void 0 : (_pattern$blockTypes = pattern.blockTypes) === null || _pattern$blockTypes === void 0 ? void 0 : (_pattern$blockTypes$s = _pattern$blockTypes.some) === null || _pattern$blockTypes$s === void 0 ? void 0 : _pattern$blockTypes$s.call(_pattern$blockTypes, blockName => normalizedBlockNames.includes(blockName)); - }); -}, (state, rootClientId) => [...__experimentalGetAllowedPatterns.getDependants(state, rootClientId)]); -/** - * Determines the items that appear in the available pattern transforms list. - * - * For now we only handle blocks without InnerBlocks and take into account - * the `__experimentalRole` property of blocks' attributes for the transformation. - * - * We return the first set of possible eligible block patterns, - * by checking the `blockTypes` property. We still have to recurse through - * block pattern's blocks and try to find matches from the selected blocks. - * Now this happens in the consumer to avoid heavy operations in the selector. - * - * @param {Object} state Editor state. - * @param {Object[]} blocks The selected blocks. - * @param {?string} rootClientId Optional root client ID of block list. - * - * @return {WPBlockPattern[]} Items that are eligible for a pattern transformation. - */ - -const __experimentalGetPatternTransformItems = Object(rememo["a" /* default */])(function (state, blocks) { - let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - if (!blocks) return EMPTY_ARRAY; - /** - * For now we only handle blocks without InnerBlocks and take into account - * the `__experimentalRole` property of blocks' attributes for the transformation. - * Note that the blocks have been retrieved through `getBlock`, which doesn't - * return the inner blocks of an inner block controller, so we still need - * to check for this case too. - */ - - if (blocks.some(_ref12 => { - let { - clientId, - innerBlocks - } = _ref12; - return innerBlocks.length || areInnerBlocksControlled(state, clientId); - })) { - return EMPTY_ARRAY; - } // Create a Set of the selected block names that is used in patterns filtering. - - - const selectedBlockNames = Array.from(new Set(blocks.map(_ref13 => { - let { - name - } = _ref13; - return name; - }))); - /** - * Here we will return first set of possible eligible block patterns, - * by checking the `blockTypes` property. We still have to recurse through - * block pattern's blocks and try to find matches from the selected blocks. - * Now this happens in the consumer to avoid heavy operations in the selector. - */ - - return __experimentalGetPatternsByBlockTypes(state, selectedBlockNames, rootClientId); -}, (state, rootClientId) => [...__experimentalGetPatternsByBlockTypes.getDependants(state, rootClientId)]); -/** - * Returns the Block List settings of a block, if any exist. - * - * @param {Object} state Editor state. - * @param {?string} clientId Block client ID. - * - * @return {?Object} Block settings of the block if set. - */ - -function getBlockListSettings(state, clientId) { - return state.blockListSettings[clientId]; -} -/** - * Returns the editor settings. - * - * @param {Object} state Editor state. - * - * @return {Object} The editor settings object. - */ - -function getSettings(state) { - return state.settings; -} -/** - * Returns true if the most recent block change is be considered persistent, or - * false otherwise. A persistent change is one committed by BlockEditorProvider - * via its `onChange` callback, in addition to `onInput`. - * - * @param {Object} state Block editor state. - * - * @return {boolean} Whether the most recent block change was persistent. - */ - -function isLastBlockChangePersistent(state) { - return state.blocks.isPersistentChange; -} -/** - * Returns the block list settings for an array of blocks, if any exist. - * - * @param {Object} state Editor state. - * @param {Array} clientIds Block client IDs. - * - * @return {Object} An object where the keys are client ids and the values are - * a block list setting object. - */ - -const __experimentalGetBlockListSettingsForBlocks = Object(rememo["a" /* default */])(function (state) { - let clientIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - return clientIds.reduce((blockListSettingsForBlocks, clientId) => { - if (!state.blockListSettings[clientId]) { - return blockListSettingsForBlocks; - } - - return { ...blockListSettingsForBlocks, - [clientId]: state.blockListSettings[clientId] - }; - }, {}); -}, state => [state.blockListSettings]); -/** - * Returns the title of a given reusable block - * - * @param {Object} state Global application state. - * @param {number|string} ref The shared block's ID. - * - * @return {string} The reusable block saved title. - */ - -const __experimentalGetReusableBlockTitle = Object(rememo["a" /* default */])((state, ref) => { - var _reusableBlock$title; - - const reusableBlock = Object(external_lodash_["find"])(getReusableBlocks(state), block => block.id === ref); - - if (!reusableBlock) { - return null; - } - - return (_reusableBlock$title = reusableBlock.title) === null || _reusableBlock$title === void 0 ? void 0 : _reusableBlock$title.raw; -}, state => [getReusableBlocks(state)]); -/** - * Returns true if the most recent block change is be considered ignored, or - * false otherwise. An ignored change is one not to be committed by - * BlockEditorProvider, neither via `onChange` nor `onInput`. - * - * @param {Object} state Block editor state. - * - * @return {boolean} Whether the most recent block change was ignored. - */ - -function __unstableIsLastBlockChangeIgnored(state) { - // TODO: Removal Plan: Changes incurred by RECEIVE_BLOCKS should not be - // ignored if in-fact they result in a change in blocks state. The current - // need to ignore changes not a result of user interaction should be - // accounted for in the refactoring of reusable blocks as occurring within - // their own separate block editor / state (#7119). - return state.blocks.isIgnoredChange; -} -/** - * Returns the block attributes changed as a result of the last dispatched - * action. - * - * @param {Object} state Block editor state. - * - * @return {Object} Subsets of block attributes changed, keyed - * by block client ID. - */ - -function __experimentalGetLastBlockAttributeChanges(state) { - return state.lastBlockAttributesChange; -} -/** - * Returns the available reusable blocks - * - * @param {Object} state Global application state. - * - * @return {Array} Reusable blocks - */ - -function getReusableBlocks(state) { - var _state$settings$__exp, _state$settings; - - return (_state$settings$__exp = state === null || state === void 0 ? void 0 : (_state$settings = state.settings) === null || _state$settings === void 0 ? void 0 : _state$settings.__experimentalReusableBlocks) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : EMPTY_ARRAY; -} -/** - * Returns whether the navigation mode is enabled. - * - * @param {Object} state Editor state. - * - * @return {boolean} Is navigation mode enabled. - */ - - -function selectors_isNavigationMode(state) { - return state.isNavigationMode; -} -/** - * Returns whether block moving mode is enabled. - * - * @param {Object} state Editor state. - * - * @return {string} Client Id of moving block. - */ - -function selectors_hasBlockMovingClientId(state) { - return state.hasBlockMovingClientId; -} -/** - * Returns true if the last change was an automatic change, false otherwise. - * - * @param {Object} state Global application state. - * - * @return {boolean} Whether the last change was automatic. - */ - -function didAutomaticChange(state) { - return !!state.automaticChangeStatus; -} -/** - * Returns true if the current highlighted block matches the block clientId. - * - * @param {Object} state Global application state. - * @param {string} clientId The block to check. - * - * @return {boolean} Whether the block is currently highlighted. - */ - -function isBlockHighlighted(state, clientId) { - return state.highlightedBlock === clientId; -} -/** - * Checks if a given block has controlled inner blocks. - * - * @param {Object} state Global application state. - * @param {string} clientId The block to check. - * - * @return {boolean} True if the block has controlled inner blocks. - */ - -function areInnerBlocksControlled(state, clientId) { - return !!state.blocks.controlledInnerBlocks[clientId]; -} -/** - * Returns the clientId for the first 'active' block of a given array of block names. - * A block is 'active' if it (or a child) is the selected block. - * Returns the first match moving up the DOM from the selected block. - * - * @param {Object} state Global application state. - * @param {string[]} validBlocksNames The names of block types to check for. - * - * @return {string} The matching block's clientId. - */ - -const __experimentalGetActiveBlockIdByBlockNames = Object(rememo["a" /* default */])((state, validBlockNames) => { - if (!validBlockNames.length) { - return null; - } // Check if selected block is a valid entity area. - - - const selectedBlockClientId = getSelectedBlockClientId(state); - - if (validBlockNames.includes(getBlockName(state, selectedBlockClientId))) { - return selectedBlockClientId; - } // Check if first selected block is a child of a valid entity area. - - - const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); - const entityAreaParents = getBlockParentsByBlockName(state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames); - - if (entityAreaParents) { - // Last parent closest/most interior. - return Object(external_lodash_["last"])(entityAreaParents); - } - - return null; -}, (state, validBlockNames) => [state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId, validBlockNames]); -/** - * Tells if the block with the passed clientId was just inserted. - * - * @param {Object} state Global application state. - * @param {Object} clientId Client Id of the block. - * @param {?string} source Optional insertion source of the block. - * @return {boolean} True if the block matches the last block inserted from the specified source. - */ - -function wasBlockJustInserted(state, clientId, source) { - const { - lastBlockInserted - } = state; - return lastBlockInserted.clientId === clientId && lastBlockInserted.source === source; -} - -// EXTERNAL MODULE: external ["wp","a11y"] -var external_wp_a11y_ = __webpack_require__("gdqT"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","richText"] -var external_wp_richText_ = __webpack_require__("qRz9"); - -// EXTERNAL MODULE: external ["wp","deprecated"] -var external_wp_deprecated_ = __webpack_require__("NMb1"); -var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/actions.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Action which will insert a default block insert action if there - * are no other blocks at the root of the editor. This action should be used - * in actions which may result in no blocks remaining in the editor (removal, - * replacement, etc). - */ - -const ensureDefaultBlock = () => _ref => { - let { - select, - dispatch - } = _ref; - // To avoid a focus loss when removing the last block, assure there is - // always a default block if the last of the blocks have been removed. - const count = select.getBlockCount(); - - if (count > 0) { - return; - } // If there's an custom appender, don't insert default block. - // We have to remember to manually move the focus elsewhere to - // prevent it from being lost though. - - - const { - __unstableHasCustomAppender - } = select.getSettings(); - - if (__unstableHasCustomAppender) { - return; - } - - dispatch.insertDefaultBlock(); -}; -/** - * Action that resets blocks state to the specified array of blocks, taking precedence - * over any other content reflected as an edit in state. - * - * @param {Array} blocks Array of blocks. - */ - - -const resetBlocks = blocks => _ref2 => { - let { - dispatch - } = _ref2; - dispatch({ - type: 'RESET_BLOCKS', - blocks - }); - dispatch(validateBlocksToTemplate(blocks)); -}; -/** - * Block validity is a function of blocks state (at the point of a - * reset) and the template setting. As a compromise to its placement - * across distinct parts of state, it is implemented here as a side- - * effect of the block reset action. - * - * @param {Array} blocks Array of blocks. - */ - -const validateBlocksToTemplate = blocks => _ref3 => { - let { - select, - dispatch - } = _ref3; - const template = select.getTemplate(); - const templateLock = select.getTemplateLock(); // Unlocked templates are considered always valid because they act - // as default values only. - - const isBlocksValidToTemplate = !template || templateLock !== 'all' || Object(external_wp_blocks_["doBlocksMatchTemplate"])(blocks, template); // Update if validity has changed. - - const isValidTemplate = select.isValidTemplate(); - - if (isBlocksValidToTemplate !== isValidTemplate) { - dispatch.setTemplateValidity(isBlocksValidToTemplate); - return isBlocksValidToTemplate; - } -}; -/** - * A block selection object. - * - * @typedef {Object} WPBlockSelection - * - * @property {string} clientId A block client ID. - * @property {string} attributeKey A block attribute key. - * @property {number} offset An attribute value offset, based on the rich - * text value. See `wp.richText.create`. - */ - -/* eslint-disable jsdoc/valid-types */ - -/** - * Returns an action object used in signalling that selection state should be - * reset to the specified selection. - * - * @param {WPBlockSelection} selectionStart The selection start. - * @param {WPBlockSelection} selectionEnd The selection end. - * @param {0|-1|null} initialPosition Initial block position. - * - * @return {Object} Action object. - */ - -function resetSelection(selectionStart, selectionEnd, initialPosition) { - /* eslint-enable jsdoc/valid-types */ - return { - type: 'RESET_SELECTION', - selectionStart, - selectionEnd, - initialPosition - }; -} -/** - * Returns an action object used in signalling that blocks have been received. - * Unlike resetBlocks, these should be appended to the existing known set, not - * replacing. - * - * @deprecated - * - * @param {Object[]} blocks Array of block objects. - * - * @return {Object} Action object. - */ - -function receiveBlocks(blocks) { - external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).receiveBlocks', { - since: '5.9', - alternative: 'resetBlocks or insertBlocks' - }); - return { - type: 'RECEIVE_BLOCKS', - blocks - }; -} -/** - * Action that updates attributes of multiple blocks with the specified client IDs. - * - * @param {string|string[]} clientIds Block client IDs. - * @param {Object} attributes Block attributes to be merged. Should be keyed by clientIds if - * uniqueByBlock is true. - * @param {boolean} uniqueByBlock true if each block in clientIds array has a unique set of attributes - * @return {Object} Action object. - */ - -function updateBlockAttributes(clientIds, attributes) { - let uniqueByBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - return { - type: 'UPDATE_BLOCK_ATTRIBUTES', - clientIds: Object(external_lodash_["castArray"])(clientIds), - attributes, - uniqueByBlock - }; -} -/** - * Action that updates the block with the specified client ID. - * - * @param {string} clientId Block client ID. - * @param {Object} updates Block attributes to be merged. - * - * @return {Object} Action object. - */ - -function updateBlock(clientId, updates) { - return { - type: 'UPDATE_BLOCK', - clientId, - updates - }; -} -/* eslint-disable jsdoc/valid-types */ - -/** - * Returns an action object used in signalling that the block with the - * specified client ID has been selected, optionally accepting a position - * value reflecting its selection directionality. An initialPosition of -1 - * reflects a reverse selection. - * - * @param {string} clientId Block client ID. - * @param {0|-1|null} initialPosition Optional initial position. Pass as -1 to - * reflect reverse selection. - * - * @return {Object} Action object. - */ - -function selectBlock(clientId) { - let initialPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - /* eslint-enable jsdoc/valid-types */ - return { - type: 'SELECT_BLOCK', - initialPosition, - clientId - }; -} -/** - * Yields action objects used in signalling that the block preceding the given - * clientId should be selected. - * - * @param {string} clientId Block client ID. - */ - -const selectPreviousBlock = clientId => _ref4 => { - let { - select, - dispatch - } = _ref4; - const previousBlockClientId = select.getPreviousBlockClientId(clientId); - - if (previousBlockClientId) { - dispatch.selectBlock(previousBlockClientId, -1); - } -}; -/** - * Yields action objects used in signalling that the block following the given - * clientId should be selected. - * - * @param {string} clientId Block client ID. - */ - -const selectNextBlock = clientId => _ref5 => { - let { - select, - dispatch - } = _ref5; - const nextBlockClientId = select.getNextBlockClientId(clientId); - - if (nextBlockClientId) { - dispatch.selectBlock(nextBlockClientId); - } -}; -/** - * Action that starts block multi-selection. - * - * @return {Object} Action object. - */ - -function startMultiSelect() { - return { - type: 'START_MULTI_SELECT' - }; -} -/** - * Action that stops block multi-selection. - * - * @return {Object} Action object. - */ - -function stopMultiSelect() { - return { - type: 'STOP_MULTI_SELECT' - }; -} -/** - * Action that changes block multi-selection. - * - * @param {string} start First block of the multi selection. - * @param {string} end Last block of the multiselection. - */ - -const multiSelect = (start, end) => _ref6 => { - let { - select, - dispatch - } = _ref6; - const startBlockRootClientId = select.getBlockRootClientId(start); - const endBlockRootClientId = select.getBlockRootClientId(end); // Only allow block multi-selections at the same level. - - if (startBlockRootClientId !== endBlockRootClientId) { - return; - } - - dispatch({ - type: 'MULTI_SELECT', - start, - end - }); - const blockCount = select.getSelectedBlockCount(); - Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["sprintf"])( - /* translators: %s: number of selected blocks */ - Object(external_wp_i18n_["_n"])('%s block selected.', '%s blocks selected.', blockCount), blockCount), 'assertive'); -}; -/** - * Action that clears the block selection. - * - * @return {Object} Action object. - */ - -function clearSelectedBlock() { - return { - type: 'CLEAR_SELECTED_BLOCK' - }; -} -/** - * Action that enables or disables block selection. - * - * @param {boolean} [isSelectionEnabled=true] Whether block selection should - * be enabled. - * - * @return {Object} Action object. - */ - -function toggleSelection() { - let isSelectionEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - return { - type: 'TOGGLE_SELECTION', - isSelectionEnabled - }; -} - -function getBlocksWithDefaultStylesApplied(blocks, blockEditorSettings) { - var _blockEditorSettings$, _blockEditorSettings$2; - - const preferredStyleVariations = (_blockEditorSettings$ = blockEditorSettings === null || blockEditorSettings === void 0 ? void 0 : (_blockEditorSettings$2 = blockEditorSettings.__experimentalPreferredStyleVariations) === null || _blockEditorSettings$2 === void 0 ? void 0 : _blockEditorSettings$2.value) !== null && _blockEditorSettings$ !== void 0 ? _blockEditorSettings$ : {}; - return blocks.map(block => { - var _block$attributes; - - const blockName = block.name; - - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'defaultStylePicker', true)) { - return block; - } - - if (!preferredStyleVariations[blockName]) { - return block; - } - - const className = (_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.className; - - if (className !== null && className !== void 0 && className.includes('is-style-')) { - return block; - } - - const { - attributes = {} - } = block; - const blockStyle = preferredStyleVariations[blockName]; - return { ...block, - attributes: { ...attributes, - className: `${className || ''} is-style-${blockStyle}`.trim() - } - }; - }); -} -/* eslint-disable jsdoc/valid-types */ - -/** - * Action that replaces given blocks with one or more replacement blocks. - * - * @param {(string|string[])} clientIds Block client ID(s) to replace. - * @param {(Object|Object[])} blocks Replacement block(s). - * @param {number} indexToSelect Index of replacement block to select. - * @param {0|-1|null} initialPosition Index of caret after in the selected block after the operation. - * @param {?Object} meta Optional Meta values to be passed to the action object. - * - * @return {Object} Action object. - */ - - -const replaceBlocks = function (clientIds, blocks, indexToSelect) { - let initialPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - let meta = arguments.length > 4 ? arguments[4] : undefined; - return _ref7 => { - let { - select, - dispatch - } = _ref7; - - /* eslint-enable jsdoc/valid-types */ - clientIds = Object(external_lodash_["castArray"])(clientIds); - blocks = getBlocksWithDefaultStylesApplied(Object(external_lodash_["castArray"])(blocks), select.getSettings()); - const rootClientId = select.getBlockRootClientId(Object(external_lodash_["first"])(clientIds)); // Replace is valid if the new blocks can be inserted in the root block. - - for (let index = 0; index < blocks.length; index++) { - const block = blocks[index]; - const canInsertBlock = select.canInsertBlockType(block.name, rootClientId); - - if (!canInsertBlock) { - return; - } - } - - dispatch({ - type: 'REPLACE_BLOCKS', - clientIds, - blocks, - time: Date.now(), - indexToSelect, - initialPosition, - meta - }); - dispatch(ensureDefaultBlock()); - }; -}; -/** - * Action that replaces a single block with one or more replacement blocks. - * - * @param {(string|string[])} clientId Block client ID to replace. - * @param {(Object|Object[])} block Replacement block(s). - * - * @return {Object} Action object. - */ - -function replaceBlock(clientId, block) { - return replaceBlocks(clientId, block); -} -/** - * Higher-order action creator which, given the action type to dispatch creates - * an action creator for managing block movement. - * - * @param {string} type Action type to dispatch. - * - * @return {Function} Action creator. - */ - -const createOnMove = type => (clientIds, rootClientId) => _ref8 => { - let { - select, - dispatch - } = _ref8; - // If one of the blocks is locked or the parent is locked, we cannot move any block. - const canMoveBlocks = select.canMoveBlocks(clientIds, rootClientId); - - if (!canMoveBlocks) { - return; - } - - dispatch({ - type, - clientIds: Object(external_lodash_["castArray"])(clientIds), - rootClientId - }); -}; - -const moveBlocksDown = createOnMove('MOVE_BLOCKS_DOWN'); -const moveBlocksUp = createOnMove('MOVE_BLOCKS_UP'); -/** - * Action that moves given blocks to a new position. - * - * @param {?string} clientIds The client IDs of the blocks. - * @param {?string} fromRootClientId Root client ID source. - * @param {?string} toRootClientId Root client ID destination. - * @param {number} index The index to move the blocks to. - */ - -const moveBlocksToPosition = function (clientIds) { - let fromRootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - let toRootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - let index = arguments.length > 3 ? arguments[3] : undefined; - return _ref9 => { - let { - select, - dispatch - } = _ref9; - const canMoveBlocks = select.canMoveBlocks(clientIds, fromRootClientId); // If one of the blocks is locked or the parent is locked, we cannot move any block. - - if (!canMoveBlocks) { - return; - } // If moving inside the same root block the move is always possible. - - - if (fromRootClientId !== toRootClientId) { - const canRemoveBlocks = select.canRemoveBlocks(clientIds, fromRootClientId); // If we're moving to another block, it means we're deleting blocks from - // the original block, so we need to check if removing is possible. - - if (!canRemoveBlocks) { - return; - } - - const canInsertBlocks = select.canInsertBlocks(clientIds, toRootClientId); // If moving to other parent block, the move is possible if we can insert a block of the same type inside the new parent block. - - if (!canInsertBlocks) { - return; - } - } - - dispatch({ - type: 'MOVE_BLOCKS_TO_POSITION', - fromRootClientId, - toRootClientId, - clientIds, - index - }); - }; -}; -/** - * Action that moves given block to a new position. - * - * @param {?string} clientId The client ID of the block. - * @param {?string} fromRootClientId Root client ID source. - * @param {?string} toRootClientId Root client ID destination. - * @param {number} index The index to move the block to. - */ - -function moveBlockToPosition(clientId) { - let fromRootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - let toRootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - let index = arguments.length > 3 ? arguments[3] : undefined; - return moveBlocksToPosition([clientId], fromRootClientId, toRootClientId, index); -} -/** - * Action that inserts a single block, optionally at a specific index respective a root block list. - * - * @param {Object} block Block object to insert. - * @param {?number} index Index at which block should be inserted. - * @param {?string} rootClientId Optional root client ID of block list on which to insert. - * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true. - * @param {?Object} meta Optional Meta values to be passed to the action object. - * - * @return {Object} Action object. - */ - -function insertBlock(block, index, rootClientId, updateSelection, meta) { - return insertBlocks([block], index, rootClientId, updateSelection, 0, meta); -} -/* eslint-disable jsdoc/valid-types */ - -/** - * Action that inserts an array of blocks, optionally at a specific index respective a root block list. - * - * @param {Object[]} blocks Block objects to insert. - * @param {?number} index Index at which block should be inserted. - * @param {?string} rootClientId Optional root client ID of block list on which to insert. - * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true. - * @param {0|-1|null} initialPosition Initial focus position. Setting it to null prevent focusing the inserted block. - * @param {?Object} meta Optional Meta values to be passed to the action object. - * @return {Object} Action object. - */ - -const insertBlocks = function (blocks, index, rootClientId) { - let updateSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; - let initialPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; - let meta = arguments.length > 5 ? arguments[5] : undefined; - return _ref10 => { - let { - select, - dispatch - } = _ref10; - - /* eslint-enable jsdoc/valid-types */ - if (Object(external_lodash_["isObject"])(initialPosition)) { - meta = initialPosition; - initialPosition = 0; - external_wp_deprecated_default()("meta argument in wp.data.dispatch('core/block-editor')", { - since: '10.1', - plugin: 'Gutenberg', - hint: 'The meta argument is now the 6th argument of the function' - }); - } - - blocks = getBlocksWithDefaultStylesApplied(Object(external_lodash_["castArray"])(blocks), select.getSettings()); - const allowedBlocks = []; - - for (const block of blocks) { - const isValid = select.canInsertBlockType(block.name, rootClientId); - - if (isValid) { - allowedBlocks.push(block); - } - } - - if (allowedBlocks.length) { - dispatch({ - type: 'INSERT_BLOCKS', - blocks: allowedBlocks, - index, - rootClientId, - time: Date.now(), - updateSelection, - initialPosition: updateSelection ? initialPosition : null, - meta - }); - } - }; -}; -/** - * Action that shows the insertion point. - * - * @param {?string} rootClientId Optional root client ID of block list on - * which to insert. - * @param {?number} index Index at which block should be inserted. - * @param {Object} __unstableOptions Wether or not to show an inserter button. - * - * @return {Object} Action object. - */ - -function showInsertionPoint(rootClientId, index) { - let __unstableOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - const { - __unstableWithInserter - } = __unstableOptions; - return { - type: 'SHOW_INSERTION_POINT', - rootClientId, - index, - __unstableWithInserter - }; -} -/** - * Action that hides the insertion point. - * - * @return {Object} Action object. - */ - -function hideInsertionPoint() { - return { - type: 'HIDE_INSERTION_POINT' - }; -} -/** - * Action that resets the template validity. - * - * @param {boolean} isValid template validity flag. - * - * @return {Object} Action object. - */ - -function setTemplateValidity(isValid) { - return { - type: 'SET_TEMPLATE_VALIDITY', - isValid - }; -} -/** - * Action that synchronizes the template with the list of blocks. - * - * @return {Object} Action object. - */ - -const synchronizeTemplate = () => _ref11 => { - let { - select, - dispatch - } = _ref11; - dispatch({ - type: 'SYNCHRONIZE_TEMPLATE' - }); - const blocks = select.getBlocks(); - const template = select.getTemplate(); - const updatedBlockList = Object(external_wp_blocks_["synchronizeBlocksWithTemplate"])(blocks, template); - dispatch.resetBlocks(updatedBlockList); -}; -/** - * Action that merges two blocks. - * - * @param {string} firstBlockClientId Client ID of the first block to merge. - * @param {string} secondBlockClientId Client ID of the second block to merge. - */ - -const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => { - let { - select, - dispatch - } = _ref12; - const blocks = [firstBlockClientId, secondBlockClientId]; - dispatch({ - type: 'MERGE_BLOCKS', - blocks - }); - const [clientIdA, clientIdB] = blocks; - const blockA = select.getBlock(clientIdA); - const blockAType = Object(external_wp_blocks_["getBlockType"])(blockA.name); // Only focus the previous block if it's not mergeable - - if (blockAType && !blockAType.merge) { - dispatch.selectBlock(blockA.clientId); - return; - } - - const blockB = select.getBlock(clientIdB); - const blockBType = Object(external_wp_blocks_["getBlockType"])(blockB.name); - const { - clientId, - attributeKey, - offset - } = select.getSelectionStart(); - const selectedBlockType = clientId === clientIdA ? blockAType : blockBType; - const attributeDefinition = selectedBlockType.attributes[attributeKey]; - const canRestoreTextSelection = (clientId === clientIdA || clientId === clientIdB) && attributeKey !== undefined && offset !== undefined && // We cannot restore text selection if the RichText identifier - // is not a defined block attribute key. This can be the case if the - // fallback intance ID is used to store selection (and no RichText - // identifier is set), or when the identifier is wrong. - !!attributeDefinition; - - if (!attributeDefinition) { - if (typeof attributeKey === 'number') { - window.console.error(`RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${typeof attributeKey}`); - } else { - window.console.error('The RichText identifier prop does not match any attributes defined by the block.'); - } - } // A robust way to retain selection position through various transforms - // is to insert a special character at the position and then recover it. - - - const START_OF_SELECTED_AREA = '\u0086'; // Clone the blocks so we don't insert the character in a "live" block. - - const cloneA = Object(external_wp_blocks_["cloneBlock"])(blockA); - const cloneB = Object(external_wp_blocks_["cloneBlock"])(blockB); - - if (canRestoreTextSelection) { - const selectedBlock = clientId === clientIdA ? cloneA : cloneB; - const html = selectedBlock.attributes[attributeKey]; - const { - multiline: multilineTag, - __unstableMultilineWrapperTags: multilineWrapperTags, - __unstablePreserveWhiteSpace: preserveWhiteSpace - } = attributeDefinition; - const value = Object(external_wp_richText_["insert"])(Object(external_wp_richText_["create"])({ - html, - multilineTag, - multilineWrapperTags, - preserveWhiteSpace - }), START_OF_SELECTED_AREA, offset, offset); - selectedBlock.attributes[attributeKey] = Object(external_wp_richText_["toHTMLString"])({ - value, - multilineTag, - preserveWhiteSpace - }); - } // We can only merge blocks with similar types - // thus, we transform the block to merge first - - - const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : Object(external_wp_blocks_["switchToBlockType"])(cloneB, blockA.name); // If the block types can not match, do nothing - - if (!blocksWithTheSameType || !blocksWithTheSameType.length) { - return; - } // Calling the merge to update the attributes and remove the block to be merged - - - const updatedAttributes = blockAType.merge(cloneA.attributes, blocksWithTheSameType[0].attributes); - - if (canRestoreTextSelection) { - const newAttributeKey = Object(external_lodash_["findKey"])(updatedAttributes, v => typeof v === 'string' && v.indexOf(START_OF_SELECTED_AREA) !== -1); - const convertedHtml = updatedAttributes[newAttributeKey]; - const { - multiline: multilineTag, - __unstableMultilineWrapperTags: multilineWrapperTags, - __unstablePreserveWhiteSpace: preserveWhiteSpace - } = blockAType.attributes[newAttributeKey]; - const convertedValue = Object(external_wp_richText_["create"])({ - html: convertedHtml, - multilineTag, - multilineWrapperTags, - preserveWhiteSpace - }); - const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA); - const newValue = Object(external_wp_richText_["remove"])(convertedValue, newOffset, newOffset + 1); - const newHtml = Object(external_wp_richText_["toHTMLString"])({ - value: newValue, - multilineTag, - preserveWhiteSpace - }); - updatedAttributes[newAttributeKey] = newHtml; - dispatch.selectionChange(blockA.clientId, newAttributeKey, newOffset, newOffset); - } - - dispatch.replaceBlocks([blockA.clientId, blockB.clientId], [{ ...blockA, - attributes: { ...blockA.attributes, - ...updatedAttributes - } - }, ...blocksWithTheSameType.slice(1)], 0 // If we don't pass the `indexToSelect` it will default to the last block. - ); -}; -/** - * Yields action objects used in signalling that the blocks corresponding to - * the set of specified client IDs are to be removed. - * - * @param {string|string[]} clientIds Client IDs of blocks to remove. - * @param {boolean} selectPrevious True if the previous block should be - * selected when a block is removed. - */ - -const removeBlocks = function (clientIds) { - let selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - return _ref13 => { - let { - select, - dispatch - } = _ref13; - - if (!clientIds || !clientIds.length) { - return; - } - - clientIds = Object(external_lodash_["castArray"])(clientIds); - const rootClientId = select.getBlockRootClientId(clientIds[0]); - const canRemoveBlocks = select.canRemoveBlocks(clientIds, rootClientId); - - if (!canRemoveBlocks) { - return; - } - - if (selectPrevious) { - dispatch.selectPreviousBlock(clientIds[0]); - } - - dispatch({ - type: 'REMOVE_BLOCKS', - clientIds - }); // To avoid a focus loss when removing the last block, assure there is - // always a default block if the last of the blocks have been removed. - - dispatch(ensureDefaultBlock()); - }; -}; -/** - * Returns an action object used in signalling that the block with the - * specified client ID is to be removed. - * - * @param {string} clientId Client ID of block to remove. - * @param {boolean} selectPrevious True if the previous block should be - * selected when a block is removed. - * - * @return {Object} Action object. - */ - -function removeBlock(clientId, selectPrevious) { - return removeBlocks([clientId], selectPrevious); -} -/* eslint-disable jsdoc/valid-types */ - -/** - * Returns an action object used in signalling that the inner blocks with the - * specified client ID should be replaced. - * - * @param {string} rootClientId Client ID of the block whose InnerBlocks will re replaced. - * @param {Object[]} blocks Block objects to insert as new InnerBlocks - * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to false. - * @param {0|-1|null} initialPosition Initial block position. - * @return {Object} Action object. - */ - -function replaceInnerBlocks(rootClientId, blocks) { - let updateSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - let initialPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - - /* eslint-enable jsdoc/valid-types */ - return { - type: 'REPLACE_INNER_BLOCKS', - rootClientId, - blocks, - updateSelection, - initialPosition: updateSelection ? initialPosition : null, - time: Date.now() - }; -} -/** - * Returns an action object used to toggle the block editing mode between - * visual and HTML modes. - * - * @param {string} clientId Block client ID. - * - * @return {Object} Action object. - */ - -function toggleBlockMode(clientId) { - return { - type: 'TOGGLE_BLOCK_MODE', - clientId - }; -} -/** - * Returns an action object used in signalling that the user has begun to type. - * - * @return {Object} Action object. - */ - -function startTyping() { - return { - type: 'START_TYPING' - }; -} -/** - * Returns an action object used in signalling that the user has stopped typing. - * - * @return {Object} Action object. - */ - -function stopTyping() { - return { - type: 'STOP_TYPING' - }; -} -/** - * Returns an action object used in signalling that the user has begun to drag blocks. - * - * @param {string[]} clientIds An array of client ids being dragged - * - * @return {Object} Action object. - */ - -function startDraggingBlocks() { - let clientIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - return { - type: 'START_DRAGGING_BLOCKS', - clientIds - }; -} -/** - * Returns an action object used in signalling that the user has stopped dragging blocks. - * - * @return {Object} Action object. - */ - -function stopDraggingBlocks() { - return { - type: 'STOP_DRAGGING_BLOCKS' - }; -} -/** - * Returns an action object used in signalling that the caret has entered formatted text. - * - * @return {Object} Action object. - */ - -function enterFormattedText() { - return { - type: 'ENTER_FORMATTED_TEXT' - }; -} -/** - * Returns an action object used in signalling that the user caret has exited formatted text. - * - * @return {Object} Action object. - */ - -function exitFormattedText() { - return { - type: 'EXIT_FORMATTED_TEXT' - }; -} -/** - * Action that changes the position of the user caret. - * - * @param {string} clientId The selected block client ID. - * @param {string} attributeKey The selected block attribute key. - * @param {number} startOffset The start offset. - * @param {number} endOffset The end offset. - * - * @return {Object} Action object. - */ - -function selectionChange(clientId, attributeKey, startOffset, endOffset) { - return { - type: 'SELECTION_CHANGE', - clientId, - attributeKey, - startOffset, - endOffset - }; -} -/** - * Action that adds a new block of the default type to the block list. - * - * @param {?Object} attributes Optional attributes of the block to assign. - * @param {?string} rootClientId Optional root client ID of block list on which - * to append. - * @param {?number} index Optional index where to insert the default block - * - * @return {Object} Action object - */ - -function insertDefaultBlock(attributes, rootClientId, index) { - // Abort if there is no default block type (if it has been unregistered). - const defaultBlockName = Object(external_wp_blocks_["getDefaultBlockName"])(); - - if (!defaultBlockName) { - return; - } - - const block = Object(external_wp_blocks_["createBlock"])(defaultBlockName, attributes); - return insertBlock(block, index, rootClientId); -} -/** - * Action that changes the nested settings of a given block. - * - * @param {string} clientId Client ID of the block whose nested setting are - * being received. - * @param {Object} settings Object with the new settings for the nested block. - * - * @return {Object} Action object - */ - -function updateBlockListSettings(clientId, settings) { - return { - type: 'UPDATE_BLOCK_LIST_SETTINGS', - clientId, - settings - }; -} -/** - * Action that updates the block editor settings. - * - * @param {Object} settings Updated settings - * - * @return {Object} Action object - */ - -function updateSettings(settings) { - return { - type: 'UPDATE_SETTINGS', - settings - }; -} -/** - * Action that signals that a temporary reusable block has been saved - * in order to switch its temporary id with the real id. - * - * @param {string} id Reusable block's id. - * @param {string} updatedId Updated block's id. - * - * @return {Object} Action object. - */ - -function __unstableSaveReusableBlock(id, updatedId) { - return { - type: 'SAVE_REUSABLE_BLOCK_SUCCESS', - id, - updatedId - }; -} -/** - * Action that marks the last block change explicitly as persistent. - * - * @return {Object} Action object. - */ - -function __unstableMarkLastChangeAsPersistent() { - return { - type: 'MARK_LAST_CHANGE_AS_PERSISTENT' - }; -} -/** - * Action that signals that the next block change should be marked explicitly as not persistent. - * - * @return {Object} Action object. - */ - -function __unstableMarkNextChangeAsNotPersistent() { - return { - type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT' - }; -} -/** - * Action that marks the last block change as an automatic change, meaning it was not - * performed by the user, and can be undone using the `Escape` and `Backspace` keys. - * This action must be called after the change was made, and any actions that are a - * consequence of it, so it is recommended to be called at the next idle period to ensure all - * selection changes have been recorded. - */ - -const __unstableMarkAutomaticChange = () => _ref14 => { - let { - dispatch - } = _ref14; - dispatch({ - type: 'MARK_AUTOMATIC_CHANGE' - }); - const { - requestIdleCallback = cb => setTimeout(cb, 100) - } = window; - requestIdleCallback(() => { - dispatch({ - type: 'MARK_AUTOMATIC_CHANGE_FINAL' - }); - }); -}; -/** - * Action that enables or disables the navigation mode. - * - * @param {string} isNavigationMode Enable/Disable navigation mode. - */ - -const setNavigationMode = function () { - let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - return _ref15 => { - let { - dispatch - } = _ref15; - dispatch({ - type: 'SET_NAVIGATION_MODE', - isNavigationMode - }); - - if (isNavigationMode) { - Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.')); - } else { - Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('You are currently in edit mode. To return to the navigation mode, press Escape.')); - } - }; -}; -/** - * Action that enables or disables the block moving mode. - * - * @param {string|null} hasBlockMovingClientId Enable/Disable block moving mode. - */ - -const setBlockMovingClientId = function () { - let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - return _ref16 => { - let { - dispatch - } = _ref16; - dispatch({ - type: 'SET_BLOCK_MOVING_MODE', - hasBlockMovingClientId - }); - - if (hasBlockMovingClientId) { - Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block.')); - } - }; -}; -/** - * Action that duplicates a list of blocks. - * - * @param {string[]} clientIds - * @param {boolean} updateSelection - */ - -const duplicateBlocks = function (clientIds) { - let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - return _ref17 => { - let { - select, - dispatch - } = _ref17; - - if (!clientIds || !clientIds.length) { - return; - } // Return early if blocks don't exist. - - - const blocks = select.getBlocksByClientId(clientIds); - - if (Object(external_lodash_["some"])(blocks, block => !block)) { - return; - } // Return early if blocks don't support multiple usage. - - - const blockNames = blocks.map(block => block.name); - - if (blockNames.some(blockName => !Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'multiple', true))) { - return; - } - - const rootClientId = select.getBlockRootClientId(clientIds[0]); - const lastSelectedIndex = select.getBlockIndex(Object(external_lodash_["last"])(Object(external_lodash_["castArray"])(clientIds))); - const clonedBlocks = blocks.map(block => Object(external_wp_blocks_["__experimentalCloneSanitizedBlock"])(block)); - dispatch.insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection); - - if (clonedBlocks.length > 1 && updateSelection) { - dispatch.multiSelect(Object(external_lodash_["first"])(clonedBlocks).clientId, Object(external_lodash_["last"])(clonedBlocks).clientId); - } - - return clonedBlocks.map(block => block.clientId); - }; -}; -/** - * Action that inserts an empty block before a given block. - * - * @param {string} clientId - */ - -const insertBeforeBlock = clientId => _ref18 => { - let { - select, - dispatch - } = _ref18; - - if (!clientId) { - return; - } - - const rootClientId = select.getBlockRootClientId(clientId); - const isLocked = select.getTemplateLock(rootClientId); - - if (isLocked) { - return; - } - - const firstSelectedIndex = select.getBlockIndex(clientId); - return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex); -}; -/** - * Action that inserts an empty block after a given block. - * - * @param {string} clientId - */ - -const insertAfterBlock = clientId => _ref19 => { - let { - select, - dispatch - } = _ref19; - - if (!clientId) { - return; - } - - const rootClientId = select.getBlockRootClientId(clientId); - const isLocked = select.getTemplateLock(rootClientId); - - if (isLocked) { - return; - } - - const firstSelectedIndex = select.getBlockIndex(clientId); - return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex + 1); -}; -/** - * Action that toggles the highlighted block state. - * - * @param {string} clientId The block's clientId. - * @param {boolean} isHighlighted The highlight state. - */ - -function toggleBlockHighlight(clientId, isHighlighted) { - return { - type: 'TOGGLE_BLOCK_HIGHLIGHT', - clientId, - isHighlighted - }; -} -/** - * Action that "flashes" the block with a given `clientId` by rhythmically highlighting it. - * - * @param {string} clientId Target block client ID. - */ - -const flashBlock = clientId => async _ref20 => { - let { - dispatch - } = _ref20; - dispatch(toggleBlockHighlight(clientId, true)); - await new Promise(resolve => setTimeout(resolve, 150)); - dispatch(toggleBlockHighlight(clientId, false)); -}; -/** - * Action that sets whether a block has controlled inner blocks. - * - * @param {string} clientId The block's clientId. - * @param {boolean} hasControlledInnerBlocks True if the block's inner blocks are controlled. - */ - -function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) { - return { - type: 'SET_HAS_CONTROLLED_INNER_BLOCKS', - hasControlledInnerBlocks, - clientId - }; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/constants.js -var constants = __webpack_require__("AHN3"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - - -/** - * Block 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, - __experimentalUseThunks: true -}; -/** - * Store definition for the block editor namespace. - * - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore - * - * @type {Object} - */ - -const store = Object(external_wp_data_["createReduxStore"])(constants["a" /* STORE_NAME */], { ...storeConfig, - persist: ['preferences'] -}); // Ideally we'd use register instead of register stores. - -Object(external_wp_data_["registerStore"])(constants["a" /* STORE_NAME */], { ...storeConfig, - persist: ['preferences'] -}); - - -/***/ }), - -/***/ "Bo0k": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getFontAppearanceLabel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FontAppearanceControl; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); - - -/** - * WordPress dependencies - */ - - - -const FONT_STYLES = [{ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Regular', 'font style'), - value: 'normal' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Italic', 'font style'), - value: 'italic' -}]; -const FONT_WEIGHTS = [{ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Thin', 'font weight'), - value: '100' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Extra Light', 'font weight'), - value: '200' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Light', 'font weight'), - value: '300' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Regular', 'font weight'), - value: '400' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Medium', 'font weight'), - value: '500' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Semi Bold', 'font weight'), - value: '600' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Bold', 'font weight'), - value: '700' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Extra Bold', 'font weight'), - value: '800' -}, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Black', 'font weight'), - value: '900' -}]; -/** - * Adjusts font appearance field label in case either font styles or weights - * are disabled. - * - * @param {boolean} hasFontStyles Whether font styles are enabled and present. - * @param {boolean} hasFontWeights Whether font weights are enabled and present. - * @return {string} A label representing what font appearance is being edited. - */ - -const getFontAppearanceLabel = (hasFontStyles, hasFontWeights) => { - if (!hasFontStyles) { - return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Font weight'); - } - - if (!hasFontWeights) { - return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Font style'); - } - - return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Appearance'); -}; -/** - * Control to display unified font style and weight options. - * - * @param {Object} props Component props. - * - * @return {WPElement} Font appearance control. - */ - -function FontAppearanceControl(props) { - const { - onChange, - hasFontStyles = true, - hasFontWeights = true, - value: { - fontStyle, - fontWeight - } - } = props; - const hasStylesOrWeights = hasFontStyles || hasFontWeights; - const label = getFontAppearanceLabel(hasFontStyles, hasFontWeights); - const defaultOption = { - key: 'default', - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Default'), - style: { - fontStyle: undefined, - fontWeight: undefined - } - }; // Combines both font style and weight options into a single dropdown. - - const combineOptions = () => { - const combinedOptions = [defaultOption]; - FONT_STYLES.forEach(_ref => { - let { - name: styleName, - value: styleValue - } = _ref; - FONT_WEIGHTS.forEach(_ref2 => { - let { - name: weightName, - value: weightValue - } = _ref2; - const optionName = styleValue === 'normal' ? weightName : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])( - /* translators: 1: Font weight name. 2: Font style name. */ - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('%1$s %2$s'), weightName, styleName); - combinedOptions.push({ - key: `${styleValue}-${weightValue}`, - name: optionName, - style: { - fontStyle: styleValue, - fontWeight: weightValue - } - }); - }); - }); - return combinedOptions; - }; // Generates select options for font styles only. - - - const styleOptions = () => { - const combinedOptions = [defaultOption]; - FONT_STYLES.forEach(_ref3 => { - let { - name, - value - } = _ref3; - combinedOptions.push({ - key: value, - name, - style: { - fontStyle: value, - fontWeight: undefined - } - }); - }); - return combinedOptions; - }; // Generates select options for font weights only. - - - const weightOptions = () => { - const combinedOptions = [defaultOption]; - FONT_WEIGHTS.forEach(_ref4 => { - let { - name, - value - } = _ref4; - combinedOptions.push({ - key: value, - name, - style: { - fontStyle: undefined, - fontWeight: value - } - }); - }); - return combinedOptions; - }; // Map font styles and weights to select options. - - - const selectOptions = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => { - if (hasFontStyles && hasFontWeights) { - return combineOptions(); - } - - return hasFontStyles ? styleOptions() : weightOptions(); - }, [props.options]); // Find current selection by comparing font style & weight against options, - // and fall back to the Default option if there is no matching option. - - const currentSelection = selectOptions.find(option => option.style.fontStyle === fontStyle && option.style.fontWeight === fontWeight) || selectOptions[0]; // Adjusts screen reader description based on styles or weights. - - const getDescribedBy = () => { - if (!currentSelection) { - return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('No selected font appearance'); - } - - if (!hasFontStyles) { - return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])( // translators: %s: Currently selected font weight. - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Currently selected font weight: %s'), currentSelection.name); - } - - if (!hasFontWeights) { - return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])( // translators: %s: Currently selected font style. - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Currently selected font style: %s'), currentSelection.name); - } - - return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])( // translators: %s: Currently selected font appearance. - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Currently selected font appearance: %s'), currentSelection.name); - }; - - return hasStylesOrWeights && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["CustomSelectControl"], { - className: "components-font-appearance-control", - label: label, - describedBy: getDescribedBy(), - options: selectOptions, - value: currentSelection, - onChange: _ref5 => { - let { - selectedItem - } = _ref5; - return onChange(selectedItem.style); - } - }); -} - - -/***/ }), - -/***/ "Bpkj": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (link); - - -/***/ }), - -/***/ "Btt3": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __experimentalGetMatchingVariation; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/** - * External dependencies - */ - -/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ - -/** - * Matches the provided block variations with a block's attributes. If no match - * or more than one matches are found it returns `undefined`. If a single match is - * found it returns it. - * - * This is a simple implementation for now as it takes into account only the attributes - * of a block variation and not `InnerBlocks`. - * - * @param {Object} blockAttributes - The block attributes to try to find a match. - * @param {WPBlockVariation[]} variations - A list of block variations to test for a match. - * @return {?WPBlockVariation} - If a match is found returns it. If not or more than one matches are found returns `undefined`. - */ - -const __experimentalGetMatchingVariation = (blockAttributes, variations) => { - if (!variations || !blockAttributes) return; - const matches = variations.filter(_ref => { - let { - attributes - } = _ref; - if (!attributes || !Object.keys(attributes).length) return false; - return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isMatch"])(blockAttributes, attributes); - }); - if (matches.length !== 1) return; - return matches[0]; -}; - - -/***/ }), - -/***/ "CNgt": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || Object.assign || function(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; -}; -var __rest = (this && this.__rest) || function (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) - t[p[i]] = s[p[i]]; - return t; -}; -exports.__esModule = true; -var React = __webpack_require__("cDcd"); -var PropTypes = __webpack_require__("17x9"); -var autosize = __webpack_require__("GemG"); -var _getLineHeight = __webpack_require__("Rk8H"); -var getLineHeight = _getLineHeight; -var RESIZED = "autosize:resized"; -/** - * A light replacement for built-in textarea component - * which automaticaly adjusts its height to match the content - */ -var TextareaAutosizeClass = /** @class */ (function (_super) { - __extends(TextareaAutosizeClass, _super); - function TextareaAutosizeClass() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.state = { - lineHeight: null - }; - _this.textarea = null; - _this.onResize = function (e) { - if (_this.props.onResize) { - _this.props.onResize(e); - } - }; - _this.updateLineHeight = function () { - if (_this.textarea) { - _this.setState({ - lineHeight: getLineHeight(_this.textarea) - }); - } - }; - _this.onChange = function (e) { - var onChange = _this.props.onChange; - _this.currentValue = e.currentTarget.value; - onChange && onChange(e); - }; - return _this; - } - TextareaAutosizeClass.prototype.componentDidMount = function () { - var _this = this; - var _a = this.props, maxRows = _a.maxRows, async = _a.async; - if (typeof maxRows === "number") { - this.updateLineHeight(); - } - if (typeof maxRows === "number" || async) { - /* - the defer is needed to: - - force "autosize" to activate the scrollbar when this.props.maxRows is passed - - support StyledComponents (see #71) - */ - setTimeout(function () { return _this.textarea && autosize(_this.textarea); }); - } - else { - this.textarea && autosize(this.textarea); - } - if (this.textarea) { - this.textarea.addEventListener(RESIZED, this.onResize); - } - }; - TextareaAutosizeClass.prototype.componentWillUnmount = function () { - if (this.textarea) { - this.textarea.removeEventListener(RESIZED, this.onResize); - autosize.destroy(this.textarea); - } - }; - TextareaAutosizeClass.prototype.render = function () { - var _this = this; - var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; - var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; - return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) { - _this.textarea = element; - if (typeof _this.props.innerRef === 'function') { - _this.props.innerRef(element); - } - else if (_this.props.innerRef) { - _this.props.innerRef.current = element; - } - } }), children)); - }; - TextareaAutosizeClass.prototype.componentDidUpdate = function () { - this.textarea && autosize.update(this.textarea); - }; - TextareaAutosizeClass.defaultProps = { - rows: 1, - async: false - }; - TextareaAutosizeClass.propTypes = { - rows: PropTypes.number, - maxRows: PropTypes.number, - onResize: PropTypes.func, - innerRef: PropTypes.any, - async: PropTypes.bool - }; - return TextareaAutosizeClass; -}(React.Component)); -exports.TextareaAutosize = React.forwardRef(function (props, ref) { - return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref })); -}); - - -/***/ }), - -/***/ "Civd": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const layout = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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 */ __webpack_exports__["a"] = (layout); - - -/***/ }), - -/***/ "Cn0l": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __experimentalGetGradientClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getGradientValueBySlug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __experimentalGetGradientObjectByGradientValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getGradientSlugByValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __experimentalUseGradient; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("ur0x"); -/* harmony import */ var _use_setting__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("v5LD"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("BhPs"); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function __experimentalGetGradientClass(gradientSlug) { - if (!gradientSlug) { - return undefined; - } - - return `has-${gradientSlug}-gradient-background`; -} -/** - * Retrieves the gradient value per slug. - * - * @param {Array} gradients Gradient Palette - * @param {string} slug Gradient slug - * - * @return {string} Gradient value. - */ - -function getGradientValueBySlug(gradients, slug) { - const gradient = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(gradients, ['slug', slug]); - return gradient && gradient.gradient; -} -function __experimentalGetGradientObjectByGradientValue(gradients, value) { - const gradient = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(gradients, ['gradient', value]); - return gradient; -} -/** - * Retrieves the gradient slug per slug. - * - * @param {Array} gradients Gradient Palette - * @param {string} value Gradient value - * @return {string} Gradient slug. - */ - -function getGradientSlugByValue(gradients, value) { - const gradient = __experimentalGetGradientObjectByGradientValue(gradients, value); - - return gradient && gradient.slug; -} -function __experimentalUseGradient() { - let { - gradientAttribute = 'gradient', - customGradientAttribute = 'customGradient' - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const { - clientId - } = Object(_block_edit__WEBPACK_IMPORTED_MODULE_3__[/* useBlockEditContext */ "c"])(); - const userGradientPalette = Object(_use_setting__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])('color.gradients.custom'); - const themeGradientPalette = Object(_use_setting__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])('color.gradients.theme'); - const defaultGradientPalette = Object(_use_setting__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])('color.gradients.default'); - const allGradients = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => [...(userGradientPalette || []), ...(themeGradientPalette || []), ...(defaultGradientPalette || [])], [userGradientPalette, themeGradientPalette, defaultGradientPalette]); - const { - gradient, - customGradient - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => { - const { - getBlockAttributes - } = select(_store__WEBPACK_IMPORTED_MODULE_5__[/* store */ "a"]); - const attributes = getBlockAttributes(clientId) || {}; - return { - customGradient: attributes[customGradientAttribute], - gradient: attributes[gradientAttribute] - }; - }, [clientId, gradientAttribute, customGradientAttribute]); - const { - updateBlockAttributes - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_5__[/* store */ "a"]); - const setGradient = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(newGradientValue => { - const slug = getGradientSlugByValue(allGradients, newGradientValue); - - if (slug) { - updateBlockAttributes(clientId, { - [gradientAttribute]: slug, - [customGradientAttribute]: undefined - }); - return; - } - - updateBlockAttributes(clientId, { - [gradientAttribute]: undefined, - [customGradientAttribute]: newGradientValue - }); - }, [allGradients, clientId, updateBlockAttributes]); - - const gradientClass = __experimentalGetGradientClass(gradient); - - let gradientValue; - - if (gradient) { - gradientValue = getGradientValueBySlug(allGradients, gradient); - } else { - gradientValue = customGradient; - } - - return { - gradientClass, - gradientValue, - setGradient - }; -} - - -/***/ }), - -/***/ "Crq9": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const formatStrikethrough = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (formatStrikethrough); - - -/***/ }), - -/***/ "DmX/": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const justifyCenter = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z" -})); -/* harmony default export */ __webpack_exports__["a"] = (justifyCenter); - - -/***/ }), - -/***/ "ERVc": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockCustomClassName; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * Returns the custom class name if the block is a light block. - * - * @param {string} clientId The block client ID. - * - * @return {string} The custom class name. - */ - -function useBlockCustomClassName(clientId) { - // It's good for this to be a separate selector because it will be executed - // on every attribute change, while the other selectors are not re-evaluated - // as much. - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(select => { - const { - getBlockName, - getBlockAttributes - } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - const attributes = getBlockAttributes(clientId); - - if (!(attributes !== null && attributes !== void 0 && attributes.className)) { - return; - } - - const blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockType"])(getBlockName(clientId)); - const hasLightBlockWrapper = (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) > 1; - - if (!hasLightBlockWrapper) { - return; - } - - return attributes.className; - }, [clientId]); -} - - -/***/ }), - -/***/ "EpZT": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const positionCenter = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (positionCenter); - - -/***/ }), - -/***/ "Fmc1": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _block_preview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("REKd"); -/* harmony import */ var _inserter_draggable_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("j6zP"); - - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function BlockPattern(_ref) { - let { - isDraggable, - pattern, - onClick, - composite - } = _ref; - const { - blocks, - viewportWidth - } = pattern; - const instanceId = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["useInstanceId"])(BlockPattern); - const descriptionId = `block-editor-block-patterns-list__item-description-${instanceId}`; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_inserter_draggable_blocks__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { - isEnabled: isDraggable, - blocks: blocks - }, _ref2 => { - let { - draggable, - onDragStart, - onDragEnd - } = _ref2; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { - className: "block-editor-block-patterns-list__list-item", - "aria-label": pattern.title, - "aria-describedby": pattern.description ? descriptionId : undefined, - draggable: draggable, - onDragStart: onDragStart, - onDragEnd: onDragEnd - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__unstableCompositeItem"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - role: "option", - as: "div" - }, composite, { - className: "block-editor-block-patterns-list__item", - onClick: () => onClick(pattern, blocks) - }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_preview__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], { - blocks: blocks, - viewportWidth: viewportWidth - }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { - className: "block-editor-block-patterns-list__item-title" - }, pattern.title), !!pattern.description && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["VisuallyHidden"], { - id: descriptionId - }, pattern.description))); - }); -} - -function BlockPatternPlaceholder() { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { - className: "block-editor-block-patterns-list__item is-placeholder" - }); -} - -function BlockPatternList(_ref3) { - let { - isDraggable, - blockPatterns, - shownPatterns, - onClickPattern, - orientation, - label = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Block Patterns') - } = _ref3; - const composite = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__unstableUseCompositeState"])({ - orientation - }); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__unstableComposite"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, composite, { - role: "listbox", - className: "block-editor-block-patterns-list", - "aria-label": label - }), blockPatterns.map(pattern => { - const isShown = shownPatterns.includes(pattern); - return isShown ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(BlockPattern, { - key: pattern.name, - pattern: pattern, - onClick: onClickPattern, - isDraggable: isDraggable, - composite: composite - }) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(BlockPatternPlaceholder, { - key: pattern.name - }); - })); -} - -/* harmony default export */ __webpack_exports__["a"] = (BlockPatternList); - - -/***/ }), - -/***/ "FnAh": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const info = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (info); - - -/***/ }), - -/***/ "G4zt": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useScrollIntoView; }); -/* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9Do8"); -/* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("1CF3"); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("BhPs"); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -function useScrollIntoView(clientId) { - const ref = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(); - const isSelectionEnd = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => { - const { - isBlockSelected, - getBlockSelectionEnd - } = select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - return isBlockSelected(clientId) || getBlockSelectionEnd() === clientId; - }, [clientId]); // Note that we can't use `useRefEffect` here, since an element change does - // not mean we can scroll. `isSelectionEnd` should be the sole dependency, - // while with `useRefEffect`, the element is a dependency as well. - - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - if (!isSelectionEnd) { - return; - } - - const extentNode = ref.current; - - if (!extentNode) { - return; - } // If the block is focused, the browser will already have scrolled into - // view if necessary. - - - if (extentNode.contains(extentNode.ownerDocument.activeElement)) { - return; - } - - const scrollContainer = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_3__["getScrollContainer"])(extentNode) || extentNode.ownerDocument.defaultView; // If there's no scroll container, it follows that there's no scrollbar - // and thus there's no need to try to scroll into view. - - if (!scrollContainer) { - return; - } - - dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_0___default()(extentNode, scrollContainer, { - onlyScrollIfNeeded: true - }); - }, [isSelectionEnd]); - return ref; -} - - -/***/ }), - -/***/ "GKUk": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FontFamilyControl; }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _use_setting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("v5LD"); - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function FontFamilyControl(_ref) { - let { - value = '', - onChange, - fontFamilies, - ...props - } = _ref; - const blockLevelFontFamilies = Object(_use_setting__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])('typography.fontFamilies'); - - if (!fontFamilies) { - fontFamilies = blockLevelFontFamilies; - } - - if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isEmpty"])(fontFamilies)) { - return null; - } - - const options = [{ - value: '', - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Default') - }, ...fontFamilies.map(_ref2 => { - let { - fontFamily, - name - } = _ref2; - return { - value: fontFamily, - label: name || fontFamily - }; - })]; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["SelectControl"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Font family'), - options: options, - value: value, - onChange: onChange, - labelPosition: "top" - }, props)); -} - - -/***/ }), - -/***/ "GOly": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - -const InserterListboxContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(); -/* harmony default export */ __webpack_exports__["a"] = (InserterListboxContext); - - -/***/ }), - -/***/ "GRId": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["element"]; }()); - -/***/ }), - -/***/ "GemG": -/***/ (function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! autosize 4.0.4 license: MIT @@ -23727,9 +12,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ (function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { var mod; } })(this, function (module, exports) { 'use strict'; @@ -24005,3495 +290,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /***/ }), -/***/ "GkEL": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("NMb1"); -/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("1CF3"); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("hF7m"); -/* harmony import */ var _wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_5__); - - - -/** - * WordPress dependencies - */ - - - - - - -function hasOnlyToolbarItem(elements) { - const dataProp = 'toolbarItem'; - return !elements.some(element => !(dataProp in element.dataset)); -} - -function getAllToolbarItemsIn(container) { - return Array.from(container.querySelectorAll('[data-toolbar-item]')); -} - -function hasFocusWithin(container) { - return container.contains(container.ownerDocument.activeElement); -} - -function focusFirstTabbableIn(container) { - const [firstTabbable] = _wordpress_dom__WEBPACK_IMPORTED_MODULE_4__["focus"].tabbable.find(container); - - if (firstTabbable) { - firstTabbable.focus(); - } -} - -function useIsAccessibleToolbar(ref) { - /* - * By default, we'll assume the starting accessible state of the Toolbar - * is true, as it seems to be the most common case. - * - * Transitioning from an (initial) false to true state causes the - * component to mount twice, which is causing undesired - * side-effects. These side-effects appear to only affect certain - * E2E tests. - * - * This was initial discovered in this pull-request: - * https://github.com/WordPress/gutenberg/pull/23425 - */ - const initialAccessibleToolbarState = true; // By default, it's gonna render NavigableMenu. If all the tabbable elements - // inside the toolbar are ToolbarItem components (or derived components like - // ToolbarButton), then we can wrap them with the accessible Toolbar - // component. - - const [isAccessibleToolbar, setIsAccessibleToolbar] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(initialAccessibleToolbarState); - const determineIsAccessibleToolbar = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(() => { - const tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_4__["focus"].tabbable.find(ref.current); - const onlyToolbarItem = hasOnlyToolbarItem(tabbables); - - if (!onlyToolbarItem) { - _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3___default()('Using custom components as toolbar controls', { - since: '5.6', - alternative: 'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components', - link: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols' - }); - } - - setIsAccessibleToolbar(onlyToolbarItem); - }, []); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useLayoutEffect"])(() => { - // Toolbar buttons may be rendered asynchronously, so we use - // MutationObserver to check if the toolbar subtree has been modified - const observer = new window.MutationObserver(determineIsAccessibleToolbar); - observer.observe(ref.current, { - childList: true, - subtree: true - }); - return () => observer.disconnect(); - }, [isAccessibleToolbar]); - return isAccessibleToolbar; -} - -function useToolbarFocus(ref, focusOnMount, isAccessibleToolbar, defaultIndex, onIndexChange) { - // Make sure we don't use modified versions of this prop - const [initialFocusOnMount] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(focusOnMount); - const [initialIndex] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(defaultIndex); - const focusToolbar = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(() => { - focusFirstTabbableIn(ref.current); - }, []); // Focus on toolbar when pressing alt+F10 when the toolbar is visible - - Object(_wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_5__["useShortcut"])('core/block-editor/focus-toolbar', focusToolbar); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - if (initialFocusOnMount) { - focusToolbar(); - } - }, [isAccessibleToolbar, initialFocusOnMount, focusToolbar]); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - // If initialIndex is passed, we focus on that toolbar item when the - // toolbar gets mounted and initial focus is not forced. - // We have to wait for the next browser paint because block controls aren't - // rendered right away when the toolbar gets mounted. - let raf = 0; - - if (initialIndex && !initialFocusOnMount) { - raf = window.requestAnimationFrame(() => { - const items = getAllToolbarItemsIn(ref.current); - const index = initialIndex || 0; - - if (items[index] && hasFocusWithin(ref.current)) { - items[index].focus(); - } - }); - } - - return () => { - window.cancelAnimationFrame(raf); - if (!onIndexChange || !ref.current) return; // When the toolbar element is unmounted and onIndexChange is passed, we - // pass the focused toolbar item index so it can be hydrated later. - - const items = getAllToolbarItemsIn(ref.current); - const index = items.findIndex(item => item.tabIndex === 0); - onIndexChange(index); - }; - }, [initialIndex, initialFocusOnMount]); -} - -function NavigableToolbar(_ref) { - let { - children, - focusOnMount, - __experimentalInitialIndex: initialIndex, - __experimentalOnIndexChange: onIndexChange, - ...props - } = _ref; - const ref = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(); - const isAccessibleToolbar = useIsAccessibleToolbar(ref); - useToolbarFocus(ref, focusOnMount, isAccessibleToolbar, initialIndex, onIndexChange); - - if (isAccessibleToolbar) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Toolbar"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - label: props['aria-label'], - ref: ref - }, props), children); - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["NavigableMenu"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - orientation: "horizontal", - role: "toolbar", - ref: ref - }, props), children); -} - -/* harmony default export */ __webpack_exports__["a"] = (NavigableToolbar); - - -/***/ }), - -/***/ "GvwK": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("NMb1"); -/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("7SSY"); - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - -function BlockCard(_ref) { - let { - title, - icon, - description, - blockType - } = _ref; - - if (blockType) { - _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1___default()('`blockType` property in `BlockCard component`', { - since: '5.7', - alternative: '`title, icon and description` properties' - }); - ({ - title, - icon, - description - } = blockType); - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-block-card" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], { - icon: icon, - showColors: true - }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-block-card__content" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("h2", { - className: "block-editor-block-card__title" - }, title), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { - className: "block-editor-block-card__description" - }, description))); -} - -/* harmony default export */ __webpack_exports__["a"] = (BlockCard); - - -/***/ }), - -/***/ "HC45": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("GOly"); - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function InserterListboxRow(props, ref) { - const state = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_context__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__unstableCompositeGroup"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - state: state, - role: "presentation", - ref: ref - }, props)); -} - -/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(InserterListboxRow)); - - -/***/ }), - -/***/ "HSyU": +/***/ 4403: /***/ (function(module, exports) { -(function() { module.exports = window["wp"]["blocks"]; }()); - -/***/ }), - -/***/ "HgtZ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useDisplayBlockControls; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("ur0x"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - -function useDisplayBlockControls() { - const { - isSelected, - clientId, - name - } = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_1__[/* useBlockEditContext */ "c"])(); - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(select => { - if (isSelected) { - return true; - } - - const { - getBlockName, - isFirstMultiSelectedBlock, - getMultiSelectedBlockClientIds - } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - - if (isFirstMultiSelectedBlock(clientId)) { - return getMultiSelectedBlockClientIds().every(id => getBlockName(id) === name); - } - - return false; - }, [clientId, isSelected, name]); -} - - -/***/ }), - -/***/ "I5Hl": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ButtonBlockerAppender; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("iClF"); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Q4Sy"); -/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("NMb1"); -/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("qrxh"); - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -function ButtonBlockAppender(_ref, ref) { - let { - rootClientId, - className, - onFocus, - tabIndex - } = _ref; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], { - position: "bottom center", - rootClientId: rootClientId, - __experimentalIsQuick: true, - renderToggle: _ref2 => { - let { - onToggle, - disabled, - isOpen, - blockTitle, - hasSingleBlockType - } = _ref2; - let label; - - if (hasSingleBlockType) { - label = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["sprintf"])( // translators: %s: the name of the block when there is only one - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["_x"])('Add %s', 'directly add the only allowed block'), blockTitle); - } else { - label = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["_x"])('Add block', 'Generic label for block inserter button'); - } - - const isToggleButton = !hasSingleBlockType; - let inserterButton = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Button"], { - ref: ref, - onFocus: onFocus, - tabIndex: tabIndex, - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'block-editor-button-block-appender'), - onClick: onToggle, - "aria-haspopup": isToggleButton ? 'true' : undefined, - "aria-expanded": isToggleButton ? isOpen : undefined, - disabled: disabled, - label: label - }, !hasSingleBlockType && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["VisuallyHidden"], { - as: "span" - }, label), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_icons__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], { - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"] - })); - - if (isToggleButton || hasSingleBlockType) { - inserterButton = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Tooltip"], { - text: label - }, inserterButton); - } - - return inserterButton; - }, - isAppender: true - }); -} -/** - * Use `ButtonBlockAppender` instead. - * - * @deprecated - */ - - -const ButtonBlockerAppender = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])((props, ref) => { - _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6___default()(`wp.blockEditor.ButtonBlockerAppender`, { - alternative: 'wp.blockEditor.ButtonBlockAppender' - }); - return ButtonBlockAppender(props, ref); -}); -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md - */ - -/* harmony default export */ __webpack_exports__["b"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(ButtonBlockAppender)); - - -/***/ }), - -/***/ "JDWi": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useNavModeExit; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * Allows navigation mode to be exited by clicking in the selected block. - * - * @param {string} clientId Block client ID. - */ - -function useNavModeExit(clientId) { - const { - isNavigationMode, - isBlockSelected - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - const { - setNavigationMode, - selectBlock - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["useRefEffect"])(node => { - function onMouseDown(event) { - // Don't select a block if it's already handled by a child - // block. - if (isNavigationMode() && !event.defaultPrevented) { - // Prevent focus from moving to the block. - event.preventDefault(); // When clicking on a selected block, exit navigation mode. - - if (isBlockSelected(clientId)) { - setNavigationMode(false); - } else { - selectBlock(clientId); - } - } - } - - node.addEventListener('mousedown', onMouseDown); - return () => { - node.addEventListener('mousedown', onMouseDown); - }; - }, [clientId, isNavigationMode, isBlockSelected, setNavigationMode]); -} - - -/***/ }), - -/***/ "JGYp": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockSync; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("BhPs"); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -/** - * A function to call when the block value has been updated in the block-editor - * store. - * - * @callback onBlockUpdate - * @param {Object[]} blocks The updated blocks. - * @param {Object} options The updated block options, such as selectionStart - * and selectionEnd. - */ - -/** - * useBlockSync is a side effect which handles bidirectional sync between the - * block-editor store and a controlling data source which provides blocks. This - * is most commonly used by the BlockEditorProvider to synchronize the contents - * of the block-editor store with the root entity, like a post. - * - * Another example would be the template part block, which provides blocks from - * a separate entity data source than a root entity. This hook syncs edits to - * the template part in the block editor back to the entity and vice-versa. - * - * Here are some of its basic functions: - * - Initalizes the block-editor store for the given clientID to the blocks - * given via props. - * - Adds incoming changes (like undo) to the block-editor store. - * - Adds outgoing changes (like editing content) to the controlling entity, - * determining if a change should be considered persistent or not. - * - Handles edge cases and race conditions which occur in those operations. - * - Ignores changes which happen to other entities (like nested inner block - * controllers. - * - Passes selection state from the block-editor store to the controlling entity. - * - * @param {Object} props Props for the block sync hook - * @param {string} props.clientId The client ID of the inner block controller. - * If none is passed, then it is assumed to be a - * root controller rather than an inner block - * controller. - * @param {Object[]} props.value The control value for the blocks. This value - * is used to initalize the block-editor store - * and for resetting the blocks to incoming - * changes like undo. - * @param {Object} props.selection The selection state responsible to restore the selection on undo/redo. - * @param {onBlockUpdate} props.onChange Function to call when a persistent - * change has been made in the block-editor blocks - * for the given clientId. For example, after - * this function is called, an entity is marked - * dirty because it has changes to save. - * @param {onBlockUpdate} props.onInput Function to call when a non-persistent - * change has been made in the block-editor blocks - * for the given clientId. When this is called, - * controlling sources do not become dirty. - */ - -function useBlockSync(_ref) { - let { - clientId = null, - value: controlledBlocks, - selection: controlledSelection, - onChange = lodash__WEBPACK_IMPORTED_MODULE_0__["noop"], - onInput = lodash__WEBPACK_IMPORTED_MODULE_0__["noop"] - } = _ref; - const registry = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useRegistry"])(); - const { - resetBlocks, - resetSelection, - replaceInnerBlocks, - setHasControlledInnerBlocks, - __unstableMarkNextChangeAsNotPersistent - } = registry.dispatch(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - const { - getBlockName, - getBlocks - } = registry.select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - const isControlled = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => { - return !clientId || select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]).areInnerBlocksControlled(clientId); - }, [clientId]); - const pendingChanges = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])({ - incoming: null, - outgoing: [] - }); - const subscribed = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); - - const setControlledBlocks = () => { - if (!controlledBlocks) { - return; - } // We don't need to persist this change because we only replace - // controlled inner blocks when the change was caused by an entity, - // and so it would already be persisted. - - - __unstableMarkNextChangeAsNotPersistent(); - - if (clientId) { - // It is important to batch here because otherwise, - // as soon as `setHasControlledInnerBlocks` is called - // the effect to restore might be triggered - // before the actual blocks get set properly in state. - registry.batch(() => { - setHasControlledInnerBlocks(clientId, true); - const storeBlocks = controlledBlocks.map(block => Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["cloneBlock"])(block)); - - if (subscribed.current) { - pendingChanges.current.incoming = storeBlocks; - } - - __unstableMarkNextChangeAsNotPersistent(); - - replaceInnerBlocks(clientId, storeBlocks); - }); - } else { - if (subscribed.current) { - pendingChanges.current.incoming = controlledBlocks; - } - - resetBlocks(controlledBlocks); - } - }; // Add a subscription to the block-editor registry to detect when changes - // have been made. This lets us inform the data source of changes. This - // is an effect so that the subscriber can run synchronously without - // waiting for React renders for changes. - - - const onInputRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(onInput); - const onChangeRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(onChange); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - onInputRef.current = onInput; - onChangeRef.current = onChange; - }, [onInput, onChange]); // Determine if blocks need to be reset when they change. - - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - if (pendingChanges.current.outgoing.includes(controlledBlocks)) { - // Skip block reset if the value matches expected outbound sync - // triggered by this component by a preceding change detection. - // Only skip if the value matches expectation, since a reset should - // still occur if the value is modified (not equal by reference), - // to allow that the consumer may apply modifications to reflect - // back on the editor. - if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["last"])(pendingChanges.current.outgoing) === controlledBlocks) { - pendingChanges.current.outgoing = []; - } - } else if (getBlocks(clientId) !== controlledBlocks) { - // Reset changing value in all other cases than the sync described - // above. Since this can be reached in an update following an out- - // bound sync, unset the outbound value to avoid considering it in - // subsequent renders. - pendingChanges.current.outgoing = []; - setControlledBlocks(); - - if (controlledSelection) { - resetSelection(controlledSelection.selectionStart, controlledSelection.selectionEnd, controlledSelection.initialPosition); - } - } - }, [controlledBlocks, clientId]); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - // When the block becomes uncontrolled, it means its inner state has been reset - // we need to take the blocks again from the external value property. - if (!isControlled) { - pendingChanges.current.outgoing = []; - setControlledBlocks(); - } - }, [isControlled]); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - const { - getSelectionStart, - getSelectionEnd, - getSelectedBlocksInitialCaretPosition, - isLastBlockChangePersistent, - __unstableIsLastBlockChangeIgnored, - areInnerBlocksControlled - } = registry.select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - let blocks = getBlocks(clientId); - let isPersistent = isLastBlockChangePersistent(); - let previousAreBlocksDifferent = false; - subscribed.current = true; - const unsubscribe = registry.subscribe(() => { - // Sometimes, when changing block lists, lingering subscriptions - // might trigger before they are cleaned up. If the block for which - // the subscription runs is no longer in the store, this would clear - // its parent entity's block list. To avoid this, we bail out if - // the subscription is triggering for a block (`clientId !== null`) - // and its block name can't be found because it's not on the list. - // (`getBlockName( clientId ) === null`). - if (clientId !== null && getBlockName(clientId) === null) return; // When RESET_BLOCKS on parent blocks get called, the controlled blocks - // can reset to uncontrolled, in these situations, it means we need to populate - // the blocks again from the external blocks (the value property here) - // and we should stop triggering onChange - - const isStillControlled = !clientId || areInnerBlocksControlled(clientId); - - if (!isStillControlled) { - return; - } - - const newIsPersistent = isLastBlockChangePersistent(); - const newBlocks = getBlocks(clientId); - const areBlocksDifferent = newBlocks !== blocks; - blocks = newBlocks; - - if (areBlocksDifferent && (pendingChanges.current.incoming || __unstableIsLastBlockChangeIgnored())) { - pendingChanges.current.incoming = null; - isPersistent = newIsPersistent; - return; - } // Since we often dispatch an action to mark the previous action as - // persistent, we need to make sure that the blocks changed on the - // previous action before committing the change. - - - const didPersistenceChange = previousAreBlocksDifferent && !areBlocksDifferent && newIsPersistent && !isPersistent; - - if (areBlocksDifferent || didPersistenceChange) { - isPersistent = newIsPersistent; // We know that onChange/onInput will update controlledBlocks. - // We need to be aware that it was caused by an outgoing change - // so that we do not treat it as an incoming change later on, - // which would cause a block reset. - - pendingChanges.current.outgoing.push(blocks); // Inform the controlling entity that changes have been made to - // the block-editor store they should be aware about. - - const updateParent = isPersistent ? onChangeRef.current : onInputRef.current; - updateParent(blocks, { - selection: { - selectionStart: getSelectionStart(), - selectionEnd: getSelectionEnd(), - initialPosition: getSelectedBlocksInitialCaretPosition() - } - }); - } - - previousAreBlocksDifferent = areBlocksDifferent; - }); - return () => unsubscribe(); - }, [registry, clientId]); -} - - -/***/ }), - -/***/ "JRTi": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockEdit; }); - -// UNUSED EXPORTS: useBlockEditContext - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-context/index.js -var block_context = __webpack_require__("uoCR"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/edit.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -/** - * Default value used for blocks which do not define their own context needs, - * used to guarantee that a block's `context` prop will always be an object. It - * is assigned as a constant since it is always expected to be an empty object, - * and in order to avoid unnecessary React reconciliations of a changing object. - * - * @type {{}} - */ - -const DEFAULT_BLOCK_CONTEXT = {}; -const Edit = props => { - const { - attributes = {}, - name - } = props; - const blockType = Object(external_wp_blocks_["getBlockType"])(name); - const blockContext = Object(external_wp_element_["useContext"])(block_context["b" /* default */]); // Assign context values using the block type's declared context needs. - - const context = Object(external_wp_element_["useMemo"])(() => { - return blockType && blockType.usesContext ? Object(external_lodash_["pick"])(blockContext, blockType.usesContext) : DEFAULT_BLOCK_CONTEXT; - }, [blockType, blockContext]); - - if (!blockType) { - return null; - } // `edit` and `save` are functions or components describing the markup - // with which a block is displayed. If `blockType` is valid, assign - // them preferentially as the render value for the block. - - - const Component = blockType.edit || blockType.save; - - if (blockType.apiVersion > 1) { - return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({}, props, { - context: context - })); - } // Generate a class name for the block's editable form - - - const generatedClassName = Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'className', true) ? Object(external_wp_blocks_["getBlockDefaultClassName"])(name) : null; - const className = classnames_default()(generatedClassName, attributes.className); - return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({}, props, { - context: context, - className: className - })); -}; -/* harmony default export */ var edit = (Object(external_wp_components_["withFilters"])('editor.BlockEdit')(Edit)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js -var block_edit_context = __webpack_require__("ur0x"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -function BlockEdit(props) { - const { - name, - isSelected, - clientId - } = props; - const context = { - name, - isSelected, - clientId - }; - return Object(external_wp_element_["createElement"])(block_edit_context["a" /* BlockEditContextProvider */] // It is important to return the same object if props haven't - // changed to avoid unnecessary rerenders. - // See https://reactjs.org/docs/context.html#caveats. - , { - value: Object(external_wp_element_["useMemo"])(() => context, Object.values(context)) - }, Object(external_wp_element_["createElement"])(edit, props)); -} - - -/***/ }), - -/***/ "JUfZ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _navigable_toolbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("GkEL"); -/* harmony import */ var _block_toolbar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("+gtr"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("BhPs"); - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - -function BlockContextualToolbar(_ref) { - let { - focusOnMount, - isFixed, - ...props - } = _ref; - const { - blockType, - hasParents, - showParentSelector - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["useSelect"])(select => { - const { - getBlockName, - getBlockParents, - getSelectedBlockClientIds - } = select(_store__WEBPACK_IMPORTED_MODULE_8__[/* store */ "a"]); - const { - getBlockType - } = select(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["store"]); - const selectedBlockClientIds = getSelectedBlockClientIds(); - const selectedBlockClientId = selectedBlockClientIds[0]; - const parents = getBlockParents(selectedBlockClientId); - const firstParentClientId = parents[parents.length - 1]; - const parentBlockName = getBlockName(firstParentClientId); - const parentBlockType = getBlockType(parentBlockName); - return { - blockType: selectedBlockClientId && getBlockType(getBlockName(selectedBlockClientId)), - hasParents: parents.length, - showParentSelector: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["hasBlockSupport"])(parentBlockType, '__experimentalParentSelector', true) && selectedBlockClientIds.length <= 1 - }; - }, []); - - if (blockType) { - if (!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["hasBlockSupport"])(blockType, '__experimentalToolbar', true)) { - return null; - } - } // Shifts the toolbar to make room for the parent block selector. - - - const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('block-editor-block-contextual-toolbar', { - 'has-parent': hasParents && showParentSelector, - 'is-fixed': isFixed - }); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_navigable_toolbar__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - focusOnMount: focusOnMount, - className: classes - /* translators: accessibility text for the block toolbar */ - , - "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Block tools') - }, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_toolbar__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], { - hideDragHandle: isFixed - })); -} - -/* harmony default export */ __webpack_exports__["a"] = (BlockContextualToolbar); - - -/***/ }), - -/***/ "JygI": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("xN+R"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var _block_draggable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("ZAjO"); -/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("9Ma0"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("BhPs"); - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - -function BlockMover(_ref) { - let { - isFirst, - isLast, - clientIds, - canMove, - isHidden, - rootClientId, - orientation, - hideDragHandle - } = _ref; - const [isFocused, setIsFocused] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(false); - - const onFocus = () => setIsFocused(true); - - const onBlur = () => setIsFocused(false); - - if (!canMove || isFirst && isLast && !rootClientId) { - return null; - } - - const dragHandleLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Drag'); // We emulate a disabled state because forcefully applying the `disabled` - // attribute on the buttons while it has focus causes the screen to change - // to an unfocused state (body as active element) without firing blur on, - // the rendering parent, leaving it unable to react to focus out. - - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { - className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('block-editor-block-mover', { - 'is-visible': isFocused || !isHidden, - 'is-horizontal': orientation === 'horizontal' - }) - }, !hideDragHandle && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_draggable__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"], { - clientIds: clientIds, - cloneClassname: "block-editor-block-mover__drag-clone" - }, draggableProps => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Button"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], - className: "block-editor-block-mover__drag-handle", - "aria-hidden": "true", - label: dragHandleLabel // Should not be able to tab to drag handle as this - // button can only be used with a pointer device. - , - tabIndex: "-1" - }, draggableProps))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["ToolbarGroup"], { - className: "block-editor-block-mover__move-button-container" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["ToolbarItem"], { - onFocus: onFocus, - onBlur: onBlur - }, itemProps => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_10__[/* BlockMoverUpButton */ "b"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - clientIds: clientIds - }, itemProps))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["ToolbarItem"], { - onFocus: onFocus, - onBlur: onBlur - }, itemProps => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_10__[/* BlockMoverDownButton */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - clientIds: clientIds - }, itemProps))))); -} - -/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])((select, _ref2) => { - var _getBlockListSettings; - - let { - clientIds - } = _ref2; - const { - getBlock, - getBlockIndex, - getBlockListSettings, - canMoveBlocks, - getBlockOrder, - getBlockRootClientId - } = select(_store__WEBPACK_IMPORTED_MODULE_11__[/* store */ "a"]); - const normalizedClientIds = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["castArray"])(clientIds); - const firstClientId = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["first"])(normalizedClientIds); - const block = getBlock(firstClientId); - const rootClientId = getBlockRootClientId(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["first"])(normalizedClientIds)); - const firstIndex = getBlockIndex(firstClientId); - const lastIndex = getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["last"])(normalizedClientIds)); - const blockOrder = getBlockOrder(rootClientId); - const isFirst = firstIndex === 0; - const isLast = lastIndex === blockOrder.length - 1; - return { - blockType: block ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["getBlockType"])(block.name) : null, - canMove: canMoveBlocks(clientIds, rootClientId), - rootClientId, - firstIndex, - isFirst, - isLast, - orientation: (_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation - }; -})(BlockMover)); - - -/***/ }), - -/***/ "Jyyd": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - -const { - Fill: __unstableBlockSettingsMenuFirstItem, - Slot -} = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('__unstableBlockSettingsMenuFirstItem'); -__unstableBlockSettingsMenuFirstItem.Slot = Slot; -/* harmony default export */ __webpack_exports__["a"] = (__unstableBlockSettingsMenuFirstItem); - - -/***/ }), - -/***/ "K/rC": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useAvailableAlignments; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _block_list_layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("w8sn"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); -/* harmony import */ var _layouts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("PPMp"); -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -const DEFAULT_CONTROLS = ['none', 'left', 'center', 'right', 'wide', 'full']; -const WIDE_CONTROLS = ['wide', 'full']; -function useAvailableAlignments() { - let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CONTROLS; - - // Always add the `none` option if not exists. - if (!controls.includes('none')) { - controls = ['none', ...controls]; - } - - const { - wideControlsEnabled = false, - themeSupportsLayout - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(select => { - const { - getSettings - } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - const settings = getSettings(); - return { - wideControlsEnabled: settings.alignWide, - themeSupportsLayout: settings.supportsLayout - }; - }, []); - const layout = Object(_block_list_layout__WEBPACK_IMPORTED_MODULE_1__[/* useLayout */ "d"])(); - const layoutType = Object(_layouts__WEBPACK_IMPORTED_MODULE_3__[/* getLayoutType */ "a"])(layout === null || layout === void 0 ? void 0 : layout.type); - const layoutAlignments = layoutType.getAlignments(layout); - - if (themeSupportsLayout) { - const alignments = layoutAlignments.filter(_ref => { - let { - name: alignmentName - } = _ref; - return controls.includes(alignmentName); - }); // While we treat `none` as an alignment, we shouldn't return it if no - // other alignments exist. - - if (alignments.length === 1 && alignments[0].name === 'none') { - return []; - } - - return alignments; - } // Starting here, it's the fallback for themes not supporting the layout config. - - - if (layoutType.name !== 'default') { - return []; - } - - const { - alignments: availableAlignments = DEFAULT_CONTROLS - } = layout; - const enabledControls = controls.filter(control => (layout.alignments || // Ignore the global wideAlignment check if the layout explicitely defines alignments. - wideControlsEnabled || !WIDE_CONTROLS.includes(control)) && availableAlignments.includes(control)).map(enabledControl => ({ - name: enabledControl - })); // While we treat `none` as an alignment, we shouldn't return it if no - // other alignments exist. - - if (enabledControls.length === 1 && enabledControls[0].name === 'none') { - return []; - } - - return enabledControls; -} - - -/***/ }), - -/***/ "K8zD": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const globe = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (globe); - - -/***/ }), - -/***/ "K9lf": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["compose"]; }()); - -/***/ }), - -/***/ "KyyN": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EditorStyles; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var colord__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fHnH"); -/* harmony import */ var colord_plugins_names__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("abaT"); -/* harmony import */ var colord_plugins_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("7bKH"); -/* harmony import */ var _utils_transform_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("vSu0"); - - -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -const EDITOR_STYLES_SELECTOR = '.editor-styles-wrapper'; -Object(colord__WEBPACK_IMPORTED_MODULE_1__[/* extend */ "b"])([colord_plugins_names__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], colord_plugins_a11y__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]]); - -function useDarkThemeBodyClassName(styles) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(node => { - if (!node) { - return; - } - - const { - ownerDocument - } = node; - const { - defaultView, - body - } = ownerDocument; - const canvas = ownerDocument.querySelector(EDITOR_STYLES_SELECTOR); - let backgroundColor; - - if (!canvas) { - // The real .editor-styles-wrapper element might not exist in the - // DOM, so calculate the background color by creating a fake - // wrapper. - const tempCanvas = ownerDocument.createElement('div'); - tempCanvas.classList.add('editor-styles-wrapper'); - body.appendChild(tempCanvas); - backgroundColor = defaultView.getComputedStyle(tempCanvas, null).getPropertyValue('background-color'); - body.removeChild(tempCanvas); - } else { - backgroundColor = defaultView.getComputedStyle(canvas, null).getPropertyValue('background-color'); - } - - const colordBackgroundColor = Object(colord__WEBPACK_IMPORTED_MODULE_1__[/* colord */ "a"])(backgroundColor); // If background is transparent, it should be treated as light color. - - if (colordBackgroundColor.luminance() > 0.5 || colordBackgroundColor.alpha() === 0) { - body.classList.remove('is-dark-theme'); - } else { - body.classList.add('is-dark-theme'); - } - }, [styles]); -} - -function EditorStyles(_ref) { - let { - styles - } = _ref; - const transformedStyles = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => Object(_utils_transform_styles__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(styles, EDITOR_STYLES_SELECTOR), [styles]); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("style", { - ref: useDarkThemeBodyClassName(styles) - }), transformedStyles.map((css, index) => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("style", { - key: index - }, css))); -} - - -/***/ }), - -/***/ "LolH": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("iClF"); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("//Lo"); - - -/** - * WordPress dependencies - */ - - - -function InserterNoResults() { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-inserter__no-results" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], { - className: "block-editor-inserter__no-results-icon", - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"] - }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('No results found.'))); -} - -/* harmony default export */ __webpack_exports__["a"] = (InserterNoResults); - - -/***/ }), - -/***/ "M+co": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("GOly"); - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function InserterListboxItem(_ref, ref) { - let { - isFirst, - as: Component, - children, - ...props - } = _ref; - const state = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_context__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__unstableCompositeItem"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - ref: ref, - state: state, - role: "option" // Use the CompositeItem `focusable` prop over Button's - // isFocusable. The latter was shown to cause an issue - // with tab order in the inserter list. - , - focusable: true - }, props), htmlProps => { - const propsWithTabIndex = { ...htmlProps, - tabIndex: isFirst ? 0 : htmlProps.tabIndex - }; - - if (Component) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Component, propsWithTabIndex, children); - } - - if (typeof children === 'function') { - return children(propsWithTabIndex); - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Button"], propsWithTabIndex, children); - }); -} - -/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(InserterListboxItem)); - - -/***/ }), - -/***/ "Mmq9": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["url"]; }()); - -/***/ }), - -/***/ "Mp0b": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" -})); -/* harmony default export */ __webpack_exports__["a"] = (linkOff); - - -/***/ }), - -/***/ "NMUH": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getFontSize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getFontSizeObjectByValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getFontSizeClass; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/** - * External dependencies - */ - -/** - * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. - * If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. - * - * @param {Array} fontSizes Array of font size objects containing at least the "name" and "size" values as properties. - * @param {?string} fontSizeAttribute Content of the font size attribute (slug). - * @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value). - * - * @return {?Object} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug. - * Otherwise, an object with just the size value based on customFontSize is returned. - */ - -const getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => { - if (fontSizeAttribute) { - const fontSizeObject = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(fontSizes, { - slug: fontSizeAttribute - }); - - if (fontSizeObject) { - return fontSizeObject; - } - } - - return { - size: customFontSizeAttribute - }; -}; -/** - * Returns the corresponding font size object for a given value. - * - * @param {Array} fontSizes Array of font size objects. - * @param {number} value Font size value. - * - * @return {Object} Font size object. - */ - -function getFontSizeObjectByValue(fontSizes, value) { - const fontSizeObject = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(fontSizes, { - size: value - }); - - if (fontSizeObject) { - return fontSizeObject; - } - - return { - size: value - }; -} -/** - * Returns a class based on fontSizeName. - * - * @param {string} fontSizeSlug Slug of the fontSize. - * - * @return {string} String with the class corresponding to the fontSize passed. - * The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'. - */ - -function getFontSizeClass(fontSizeSlug) { - if (!fontSizeSlug) { - return; - } - - return `has-${Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(fontSizeSlug)}-font-size`; -} - - -/***/ }), - -/***/ "NMb1": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["deprecated"]; }()); - -/***/ }), - -/***/ "NTP4": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const upload = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (upload); - - -/***/ }), - -/***/ "NWDH": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const chevronDown = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" -})); -/* harmony default export */ __webpack_exports__["a"] = (chevronDown); - - -/***/ }), - -/***/ "NtoT": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InspectorControlsFill; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Z23Y"); -/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _use_display_block_controls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("HgtZ"); -/* harmony import */ var _groups__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("VrEk"); - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function InspectorControlsFill(_ref) { - var _groups$group; - - let { - __experimentalGroup: group = 'default', - children - } = _ref; - const isDisplayed = Object(_use_display_block_controls__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(); - const Fill = (_groups$group = _groups__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"][group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Fill; - - if (!Fill) { - typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default()(`Unknown InspectorControl group "${group}" provided.`) : void 0; - return null; - } - - if (!isDisplayed) { - return null; - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__experimentalStyleProvider"], { - document: document - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Fill, null, fillProps => { - // Children passed to InspectorControlsFill will not have - // access to any React Context whose Provider is part of - // the InspectorControlsSlot tree. So we re-create the - // Provider in this subtree. - const value = !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(fillProps) ? fillProps : null; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__experimentalToolsPanelContext"].Provider, { - value: value - }, children); - })); -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) - -/***/ }), - -/***/ "O6Fj": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -exports.__esModule = true; -var TextareaAutosize_1 = __webpack_require__("CNgt"); -exports["default"] = TextareaAutosize_1.TextareaAutosize; - - -/***/ }), - -/***/ "OL6h": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isInSameBlock; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isInsideRootBlock; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getBlockClientId; }); -const BLOCK_SELECTOR = '.block-editor-block-list__block'; -const APPENDER_SELECTOR = '.block-list-appender'; -/** - * Returns true if two elements are contained within the same block. - * - * @param {Element} a First element. - * @param {Element} b Second element. - * - * @return {boolean} Whether elements are in the same block. - */ - -function isInSameBlock(a, b) { - return a.closest(BLOCK_SELECTOR) === b.closest(BLOCK_SELECTOR); -} -/** - * Returns true if an element is considered part of the block and not its inner - * blocks or appender. - * - * @param {Element} blockElement Block container element. - * @param {Element} element Element. - * - * @return {boolean} Whether an element is considered part of the block and not - * its inner blocks or appender. - */ - -function isInsideRootBlock(blockElement, element) { - const parentBlock = element.closest([BLOCK_SELECTOR, APPENDER_SELECTOR].join(',')); - return parentBlock === blockElement; -} -/** - * Finds the block client ID given any DOM node inside the block. - * - * @param {Node?} node DOM node. - * - * @return {string|undefined} Client ID or undefined if the node is not part of - * a block. - */ - -function getBlockClientId(node) { - while (node && node.nodeType !== node.ELEMENT_NODE) { - node = node.parentNode; - } - - if (!node) { - return; - } - - const elementNode = - /** @type {Element} */ - node; - const blockNode = elementNode.closest(BLOCK_SELECTOR); - - if (!blockNode) { - return; - } - - return blockNode.id.slice('block-'.length); -} - - -/***/ }), - -/***/ "OzlF": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const listView = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (listView); - - -/***/ }), - -/***/ "P7XM": -/***/ (function(module, exports) { - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} - - -/***/ }), - -/***/ "PKbb": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return useBlockRefProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useBlockRef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockElement; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _provider_block_refs_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("cDhi"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** @typedef {import('@wordpress/element').RefCallback} RefCallback */ - -/** @typedef {import('@wordpress/element').RefObject} RefObject */ - -/** - * Provides a ref to the BlockRefs context. - * - * @param {string} clientId The client ID of the element ref. - * - * @return {RefCallback} Ref callback. - */ - -function useBlockRefProvider(clientId) { - const { - refs, - callbacks - } = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_provider_block_refs_provider__WEBPACK_IMPORTED_MODULE_2__[/* BlockRefs */ "a"]); - const ref = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useRef"])(); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"])(() => { - refs.set(ref, clientId); - return () => { - refs.delete(ref); - }; - }, [clientId]); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["useRefEffect"])(element => { - // Update the ref in the provider. - ref.current = element; // Call any update functions. - - callbacks.forEach((id, setElement) => { - if (clientId === id) { - setElement(element); - } - }); - }, [clientId]); -} -/** - * Gets a ref pointing to the current block element. Continues to return a - * stable ref even if the block client ID changes. - * - * @param {string} clientId The client ID to get a ref for. - * - * @return {RefObject} A ref containing the element. - */ - -function useBlockRef(clientId) { - const { - refs - } = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_provider_block_refs_provider__WEBPACK_IMPORTED_MODULE_2__[/* BlockRefs */ "a"]); - const freshClientId = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useRef"])(); - freshClientId.current = clientId; // Always return an object, even if no ref exists for a given client ID, so - // that `current` works at a later point. - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => ({ - get current() { - let element = null; // Multiple refs may be created for a single block. Find the - // first that has an element set. - - for (const [ref, id] of refs.entries()) { - if (id === freshClientId.current && ref.current) { - element = ref.current; - } - } - - return element; - } - - }), []); -} -/** - * Return the element for a given client ID. Updates whenever the element - * changes, becomes available, or disappears. - * - * @param {string} clientId The client ID to an element for. - * - * @return {Element|null} The block's wrapper element. - */ - - -function useBlockElement(clientId) { - const { - callbacks - } = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_provider_block_refs_provider__WEBPACK_IMPORTED_MODULE_2__[/* BlockRefs */ "a"]); - const ref = useBlockRef(clientId); - const [element, setElement] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useState"])(null); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"])(() => { - if (!clientId) { - return; - } - - callbacks.set(setElement, clientId); - return () => { - callbacks.delete(setElement); - }; - }, [clientId]); - return ref.current || element; -} - - - - - -/***/ }), - -/***/ "PPMp": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getLayoutType; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getLayoutTypes; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-left.js -var justify_left = __webpack_require__("kWXm"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-center.js -var justify_center = __webpack_require__("DmX/"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-right.js -var justify_right = __webpack_require__("suLj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-space-between.js -var justify_space_between = __webpack_require__("bTSr"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-right.js - - -/** - * WordPress dependencies - */ - -const arrowRight = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z" -})); -/* harmony default export */ var arrow_right = (arrowRight); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-down.js - - -/** - * WordPress dependencies - */ - -const arrowDown = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z" -})); -/* harmony default export */ var arrow_down = (arrowDown); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/utils.js -/** - * Utility to generate the proper CSS selector for layout styles. - * - * @param {string|string[]} selectors - CSS selectors - * @param {boolean} append - string to append. - * - * @return {string} - CSS selector. - */ -function appendSelectors(selectors) { - let append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - // Ideally we shouldn't need the `.editor-styles-wrapper` increased specificity here - // The problem though is that we have a `.editor-styles-wrapper p { margin: reset; }` style - // it's used to reset the default margin added by wp-admin to paragraphs - // so we need this to be higher speficity otherwise, it won't be applied to paragraphs inside containers - // When the post editor is fully iframed, this extra classname could be removed. - return selectors.split(',').map(subselector => `.editor-styles-wrapper ${subselector} ${append}`).join(','); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js -var use_setting = __webpack_require__("v5LD"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js + 4 modules -var block_controls = __webpack_require__("fOYa"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/index.js + 1 modules -var justify_content_control = __webpack_require__("0E5u"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/flex.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - // Used with the default, horizontal flex orientation. - -const justifyContentMap = { - left: 'flex-start', - right: 'flex-end', - center: 'center', - 'space-between': 'space-between' -}; // Used with the vertical (column) flex orientation. - -const alignItemsMap = { - left: 'flex-start', - right: 'flex-end', - center: 'center' -}; -const flexWrapOptions = ['wrap', 'nowrap']; -/* harmony default export */ var flex = ({ - name: 'flex', - label: Object(external_wp_i18n_["__"])('Flex'), - inspectorControls: function FlexLayoutInspectorControls(_ref) { - let { - layout = {}, - onChange - } = _ref; - const { - allowOrientation = true - } = layout; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], null, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(FlexLayoutJustifyContentControl, { - layout: layout, - onChange: onChange - })), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, allowOrientation && Object(external_wp_element_["createElement"])(OrientationControl, { - layout: layout, - onChange: onChange - }))), Object(external_wp_element_["createElement"])(FlexWrapControl, { - layout: layout, - onChange: onChange - })); - }, - toolBarControls: function FlexLayoutToolbarControls(_ref2) { - let { - layout = {}, - onChange, - layoutBlockSupport - } = _ref2; - - if (layoutBlockSupport !== null && layoutBlockSupport !== void 0 && layoutBlockSupport.allowSwitching) { - return null; - } - - return Object(external_wp_element_["createElement"])(block_controls["b" /* default */], { - group: "block", - __experimentalShareWithChildBlocks: true - }, Object(external_wp_element_["createElement"])(FlexLayoutJustifyContentControl, { - layout: layout, - onChange: onChange, - isToolbar: true - })); - }, - save: function FlexLayoutStyle(_ref3) { - var _style$spacing$blockG, _style$spacing; - - let { - selector, - layout, - style - } = _ref3; - const { - orientation = 'horizontal' - } = layout; - const blockGapSupport = Object(use_setting["a" /* default */])('spacing.blockGap'); - const hasBlockGapStylesSupport = blockGapSupport !== null; - const blockGapValue = (_style$spacing$blockG = style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) !== null && _style$spacing$blockG !== void 0 ? _style$spacing$blockG : 'var( --wp--style--block-gap, 0.5em )'; - const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left; - const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap'; - const rowOrientation = ` - flex-direction: row; - align-items: center; - justify-content: ${justifyContent}; - `; - const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left; - const columnOrientation = ` - flex-direction: column; - align-items: ${alignItems}; - `; - return Object(external_wp_element_["createElement"])("style", null, ` - ${appendSelectors(selector)} { - display: flex; - gap: ${hasBlockGapStylesSupport ? blockGapValue : '0.5em'}; - flex-wrap: ${flexWrap}; - ${orientation === 'horizontal' ? rowOrientation : columnOrientation} - } - - ${appendSelectors(selector, '> *')} { - margin: 0; - } - `); - }, - - getOrientation(layout) { - const { - orientation = 'horizontal' - } = layout; - return orientation; - }, - - getAlignments() { - return []; - } - -}); - -function FlexLayoutJustifyContentControl(_ref4) { - let { - layout, - onChange, - isToolbar = false - } = _ref4; - const { - justifyContent = 'left', - orientation = 'horizontal' - } = layout; - - const onJustificationChange = value => { - onChange({ ...layout, - justifyContent: value - }); - }; - - const allowedControls = ['left', 'center', 'right']; - - if (orientation === 'horizontal') { - allowedControls.push('space-between'); - } - - if (isToolbar) { - return Object(external_wp_element_["createElement"])(justify_content_control["a" /* JustifyContentControl */], { - allowedControls: allowedControls, - value: justifyContent, - onChange: onJustificationChange, - popoverProps: { - position: 'bottom right', - isAlternate: true - } - }); - } - - const justificationOptions = [{ - value: 'left', - icon: justify_left["a" /* default */], - label: Object(external_wp_i18n_["__"])('Justify items left') - }, { - value: 'center', - icon: justify_center["a" /* default */], - label: Object(external_wp_i18n_["__"])('Justify items center') - }, { - value: 'right', - icon: justify_right["a" /* default */], - label: Object(external_wp_i18n_["__"])('Justify items right') - }]; - - if (orientation === 'horizontal') { - justificationOptions.push({ - value: 'space-between', - icon: justify_space_between["a" /* default */], - label: Object(external_wp_i18n_["__"])('Space between items') - }); - } - - return Object(external_wp_element_["createElement"])("fieldset", { - className: "block-editor-hooks__flex-layout-justification-controls" - }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_i18n_["__"])('Justification')), Object(external_wp_element_["createElement"])("div", null, justificationOptions.map(_ref5 => { - let { - value, - icon, - label - } = _ref5; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: value, - label: label, - icon: icon, - isPressed: justifyContent === value, - onClick: () => onJustificationChange(value) - }); - }))); -} - -function FlexWrapControl(_ref6) { - let { - layout, - onChange - } = _ref6; - const { - flexWrap = 'wrap' - } = layout; - return Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Allow to wrap to multiple lines'), - onChange: value => { - onChange({ ...layout, - flexWrap: value ? 'wrap' : 'nowrap' - }); - }, - checked: flexWrap === 'wrap' - }); -} - -function OrientationControl(_ref7) { - let { - layout, - onChange - } = _ref7; - const { - orientation = 'horizontal' - } = layout; - return Object(external_wp_element_["createElement"])("fieldset", { - className: "block-editor-hooks__flex-layout-orientation-controls" - }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_i18n_["__"])('Orientation')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - label: 'horizontal', - icon: arrow_right, - isPressed: orientation === 'horizontal', - onClick: () => onChange({ ...layout, - orientation: 'horizontal' - }) - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - label: 'vertical', - icon: arrow_down, - isPressed: orientation === 'vertical', - onClick: () => onChange({ ...layout, - orientation: 'vertical' - }) - })); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js -var build_module_icon = __webpack_require__("iClF"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/position-center.js -var position_center = __webpack_require__("EpZT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js -var stretch_wide = __webpack_require__("beZb"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/flow.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -/* harmony default export */ var flow = ({ - name: 'default', - label: Object(external_wp_i18n_["__"])('Flow'), - inspectorControls: function DefaultLayoutInspectorControls(_ref) { - let { - layout, - onChange - } = _ref; - const { - wideSize, - contentSize - } = layout; - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(use_setting["a" /* default */])('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] - }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-hooks__layout-controls" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-hooks__layout-controls-unit" - }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], { - label: Object(external_wp_i18n_["__"])('Content'), - labelPosition: "top", - __unstableInputWidth: "80px", - value: contentSize || wideSize || '', - onChange: nextWidth => { - nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; - onChange({ ...layout, - contentSize: nextWidth - }); - }, - units: units - }), Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: position_center["a" /* default */] - })), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-hooks__layout-controls-unit" - }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], { - label: Object(external_wp_i18n_["__"])('Wide'), - labelPosition: "top", - __unstableInputWidth: "80px", - value: wideSize || contentSize || '', - onChange: nextWidth => { - nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; - onChange({ ...layout, - wideSize: nextWidth - }); - }, - units: units - }), Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { - icon: stretch_wide["a" /* default */] - }))), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-hooks__layout-controls-reset" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "secondary", - isSmall: true, - disabled: !contentSize && !wideSize, - onClick: () => onChange({ - contentSize: undefined, - wideSize: undefined, - inherit: false - }) - }, Object(external_wp_i18n_["__"])('Reset'))), Object(external_wp_element_["createElement"])("p", { - className: "block-editor-hooks__layout-controls-helptext" - }, Object(external_wp_i18n_["__"])('Customize the width for all elements that are assigned to the center or wide columns.'))); - }, - toolBarControls: function DefaultLayoutToolbarControls() { - return null; - }, - save: function DefaultLayoutStyle(_ref2) { - var _style$spacing$blockG, _style$spacing; - - let { - selector, - layout = {}, - style - } = _ref2; - const { - contentSize, - wideSize - } = layout; - const blockGapSupport = Object(use_setting["a" /* default */])('spacing.blockGap'); - const hasBlockGapStylesSupport = blockGapSupport !== null; - const blockGapValue = (_style$spacing$blockG = style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) !== null && _style$spacing$blockG !== void 0 ? _style$spacing$blockG : 'var( --wp--style--block-gap )'; - let output = !!contentSize || !!wideSize ? ` - ${appendSelectors(selector, '> *')} { - max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize}; - margin-left: auto !important; - margin-right: auto !important; - } - - ${appendSelectors(selector, '> [data-align="wide"]')} { - max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize}; - } - - ${appendSelectors(selector, '> [data-align="full"]')} { - max-width: none; - } - ` : ''; - output += ` - ${appendSelectors(selector, '> [data-align="left"]')} { - float: left; - margin-right: 2em; - } - - ${appendSelectors(selector, '> [data-align="right"]')} { - float: right; - margin-left: 2em; - } - - `; - - if (hasBlockGapStylesSupport) { - output += ` - ${appendSelectors(selector, '> *')} { - margin-top: 0; - margin-bottom: 0; - } - ${appendSelectors(selector, '> * + *')} { - margin-top: ${blockGapValue}; - } - `; - } - - return Object(external_wp_element_["createElement"])("style", null, output); - }, - - getOrientation() { - return 'vertical'; - }, - - getAlignments(layout) { - const alignmentInfo = getAlignmentsInfo(layout); - - if (layout.alignments !== undefined) { - if (!layout.alignments.includes('none')) { - layout.alignments.unshift('none'); - } - - return layout.alignments.map(alignment => ({ - name: alignment, - info: alignmentInfo[alignment] - })); - } - - const { - contentSize, - wideSize - } = layout; - const alignments = [{ - name: 'left' - }, { - name: 'center' - }, { - name: 'right' - }]; - - if (contentSize) { - alignments.unshift({ - name: 'full' - }); - } - - if (wideSize) { - alignments.unshift({ - name: 'wide', - info: alignmentInfo.wide - }); - } - - alignments.unshift({ - name: 'none', - info: alignmentInfo.none - }); - return alignments; - } - -}); -/** - * Helper method to assign contextual info to clarify - * alignment settings. - * - * Besides checking if `contentSize` and `wideSize` have a - * value, we now show this information only if their values - * are not a `css var`. This needs to change when parsing - * css variables land. - * - * @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752 - * - * @param {Object} layout The layout object. - * @return {Object} An object with contextual info per alignment. - */ - -function getAlignmentsInfo(layout) { - const { - contentSize, - wideSize - } = layout; - const alignmentInfo = {}; - const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i; - - if (sizeRegex.test(contentSize)) { - // translators: %s: container size (i.e. 600px etc) - alignmentInfo.none = Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Max %s wide'), contentSize); - } - - if (sizeRegex.test(wideSize)) { - // translators: %s: container size (i.e. 600px etc) - alignmentInfo.wide = Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Max %s wide'), wideSize); - } - - return alignmentInfo; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/index.js -/** - * Internal dependencies - */ - - -const layoutTypes = [flow, flex]; -/** - * Retrieves a layout type by name. - * - * @param {string} name - The name of the layout type. - * @return {Object} Layout type. - */ - -function getLayoutType() { - let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default'; - return layoutTypes.find(layoutType => layoutType.name === name); -} -/** - * Retrieves the available layout types. - * - * @return {Array} Layout types. - */ - -function getLayoutTypes() { - return layoutTypes; -} - - -/***/ }), - -/***/ "PS/H": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InsertionPointOpenRef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return InsertionPoint; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("qrxh"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("BhPs"); -/* harmony import */ var _block_list_use_block_props_use_block_refs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("PKbb"); -/* harmony import */ var _use_popover_scroll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("2z9l"); - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -const InsertionPointOpenRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(); - -function InsertionPointPopover(_ref) { - let { - __unstablePopoverSlot, - __unstableContentRef - } = _ref; - const { - selectBlock - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]); - const openRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(InsertionPointOpenRef); - const ref = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useRef"])(); - const { - orientation, - previousClientId, - nextClientId, - rootClientId, - isInserterShown - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => { - var _getBlockListSettings; - - const { - getBlockOrder, - getBlockListSettings, - getBlockInsertionPoint, - isBlockBeingDragged, - getPreviousBlockClientId, - getNextBlockClientId - } = select(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]); - const insertionPoint = getBlockInsertionPoint(); - const order = getBlockOrder(insertionPoint.rootClientId); - - if (!order.length) { - return {}; - } - - let _previousClientId = order[insertionPoint.index - 1]; - let _nextClientId = order[insertionPoint.index]; - - while (isBlockBeingDragged(_previousClientId)) { - _previousClientId = getPreviousBlockClientId(_previousClientId); - } - - while (isBlockBeingDragged(_nextClientId)) { - _nextClientId = getNextBlockClientId(_nextClientId); - } - - return { - previousClientId: _previousClientId, - nextClientId: _nextClientId, - orientation: ((_getBlockListSettings = getBlockListSettings(insertionPoint.rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical', - rootClientId: insertionPoint.rootClientId, - isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter - }; - }, []); - const previousElement = Object(_block_list_use_block_props_use_block_refs__WEBPACK_IMPORTED_MODULE_8__[/* __unstableUseBlockElement */ "a"])(previousClientId); - const nextElement = Object(_block_list_use_block_props_use_block_refs__WEBPACK_IMPORTED_MODULE_8__[/* __unstableUseBlockElement */ "a"])(nextClientId); - const isVertical = orientation === 'vertical'; - const style = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => { - if (!previousElement && !nextElement) { - return {}; - } - - const previousRect = previousElement ? previousElement.getBoundingClientRect() : null; - const nextRect = nextElement ? nextElement.getBoundingClientRect() : null; - - if (isVertical) { - return { - width: previousElement ? previousElement.offsetWidth : nextElement.offsetWidth, - height: nextRect && previousRect ? nextRect.top - previousRect.bottom : 0 - }; - } - - let width = 0; - - if (previousRect && nextRect) { - width = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["isRTL"])() ? previousRect.left - nextRect.right : nextRect.left - previousRect.right; - } - - return { - width, - height: previousElement ? previousElement.offsetHeight : nextElement.offsetHeight - }; - }, [previousElement, nextElement]); - const getAnchorRect = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(() => { - if (!previousElement && !nextElement) { - return {}; - } - - const { - ownerDocument - } = previousElement || nextElement; - const previousRect = previousElement ? previousElement.getBoundingClientRect() : null; - const nextRect = nextElement ? nextElement.getBoundingClientRect() : null; - - if (isVertical) { - if (Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["isRTL"])()) { - return { - top: previousRect ? previousRect.bottom : nextRect.top, - left: previousRect ? previousRect.right : nextRect.right, - right: previousRect ? previousRect.left : nextRect.left, - bottom: nextRect ? nextRect.top : previousRect.bottom, - ownerDocument - }; - } - - return { - top: previousRect ? previousRect.bottom : nextRect.top, - left: previousRect ? previousRect.left : nextRect.left, - right: previousRect ? previousRect.right : nextRect.right, - bottom: nextRect ? nextRect.top : previousRect.bottom, - ownerDocument - }; - } - - if (Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["isRTL"])()) { - return { - top: previousRect ? previousRect.top : nextRect.top, - left: previousRect ? previousRect.left : nextRect.right, - right: nextRect ? nextRect.right : previousRect.left, - bottom: previousRect ? previousRect.bottom : nextRect.bottom, - ownerDocument - }; - } - - return { - top: previousRect ? previousRect.top : nextRect.top, - left: previousRect ? previousRect.right : nextRect.left, - right: nextRect ? nextRect.left : previousRect.right, - bottom: previousRect ? previousRect.bottom : nextRect.bottom, - ownerDocument - }; - }, [previousElement, nextElement]); - const popoverScrollRef = Object(_use_popover_scroll__WEBPACK_IMPORTED_MODULE_9__[/* usePopoverScroll */ "a"])(__unstableContentRef); - const disableMotion = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useReducedMotion"])(); - const className = classnames__WEBPACK_IMPORTED_MODULE_1___default()('block-editor-block-list__insertion-point', 'is-' + orientation); - - function onClick(event) { - if (event.target === ref.current && nextClientId) { - selectBlock(nextClientId, -1); - } - } - - function onFocus(event) { - // Only handle click on the wrapper specifically, and not an event - // bubbled from the inserter itself. - if (event.target !== ref.current) { - openRef.current = true; - } - } // Only show the in-between inserter between blocks, so when there's a - // previous and a next element. - - - const showInsertionPointInserter = previousElement && nextElement && isInserterShown; // Define animation variants for the line element. - - const horizontalLine = { - start: { - width: 0, - top: '50%', - bottom: '50%', - x: 0 - }, - rest: { - width: 4, - top: 0, - bottom: 0, - x: -2 - }, - hover: { - width: 4, - top: 0, - bottom: 0, - x: -2 - } - }; - const verticalLine = { - start: { - height: 0, - left: '50%', - right: '50%', - y: 0 - }, - rest: { - height: 4, - left: 0, - right: 0, - y: -2 - }, - hover: { - height: 4, - left: 0, - right: 0, - y: -2 - } - }; - const lineVariants = { - // Initial position starts from the center and invisible. - start: { ...(!isVertical ? horizontalLine.start : verticalLine.start), - opacity: 0 - }, - // The line expands to fill the container. If the inserter is visible it - // is delayed so it appears orchestrated. - rest: { ...(!isVertical ? horizontalLine.rest : verticalLine.rest), - opacity: 1, - borderRadius: '2px', - transition: { - delay: showInsertionPointInserter ? 0.4 : 0 - } - }, - hover: { ...(!isVertical ? horizontalLine.hover : verticalLine.hover), - opacity: 1, - borderRadius: '2px', - transition: { - delay: 0.4 - } - } - }; - const inserterVariants = { - start: { - scale: disableMotion ? 1 : 0 - }, - rest: { - scale: 1, - transition: { - delay: 0.2 - } - } - }; - /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ - // While ideally it would be enough to capture the - // bubbling focus event from the Inserter, due to the - // characteristics of click focusing of `button`s in - // Firefox and Safari, it is not reliable. - // - // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Popover"], { - ref: popoverScrollRef, - noArrow: true, - animate: false, - getAnchorRect: getAnchorRect, - focusOnMount: false, - className: "block-editor-block-list__insertion-point-popover" // Render in the old slot if needed for backward compatibility, - // otherwise render in place (not in the the default popover slot). - , - __unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes - // This makes sure the popover doesn't animate from its previous position. - , - key: nextClientId + '--' + rootClientId - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["__unstableMotion"].div, { - layout: !disableMotion, - initial: disableMotion ? 'rest' : 'start', - animate: "rest", - whileHover: "hover", - whileTap: "pressed", - exit: "start", - ref: ref, - tabIndex: -1, - onClick: onClick, - onFocus: onFocus, - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, { - 'is-with-inserter': showInsertionPointInserter - }), - style: style - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["__unstableMotion"].div, { - variants: lineVariants, - className: "block-editor-block-list__insertion-point-indicator" - }), showInsertionPointInserter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["__unstableMotion"].div, { - variants: inserterVariants, - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('block-editor-block-list__insertion-point-inserter') - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { - position: "bottom center", - clientId: nextClientId, - rootClientId: rootClientId, - __experimentalIsQuick: true, - onToggle: isOpen => { - openRef.current = isOpen; - }, - onSelectOrClose: () => { - openRef.current = false; - } - })))); - /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ -} - -function InsertionPoint(_ref2) { - let { - children, - __unstablePopoverSlot, - __unstableContentRef - } = _ref2; - const isVisible = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => { - return select(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]).isBlockInsertionPointVisible(); - }, []); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(InsertionPointOpenRef.Provider, { - value: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useRef"])(false) - }, isVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(InsertionPointPopover, { - __unstablePopoverSlot: __unstablePopoverSlot, - __unstableContentRef: __unstableContentRef - }), children); -} - - -/***/ }), - -/***/ "Q2Xw": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockClassNames; }); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("BhPs"); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -/** - * Returns the class names used for the different states of the block. - * - * @param {string} clientId The block client ID. - * - * @return {string} The class names. - */ - -function useBlockClassNames(clientId) { - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => { - const { - isBlockBeingDragged, - isBlockHighlighted, - isBlockSelected, - isBlockMultiSelected, - getBlockName, - getSettings, - hasSelectedInnerBlock, - isTyping, - __experimentalGetActiveBlockIdByBlockNames: getActiveBlockIdByBlockNames - } = select(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); - const { - __experimentalSpotlightEntityBlocks: spotlightEntityBlocks, - outlineMode - } = getSettings(); - const isDragging = isBlockBeingDragged(clientId); - const isSelected = isBlockSelected(clientId); - const name = getBlockName(clientId); - const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check - - const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep); - const activeEntityBlockId = getActiveBlockIdByBlockNames(spotlightEntityBlocks); - return classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - 'is-selected': isSelected, - 'is-highlighted': isBlockHighlighted(clientId), - 'is-multi-selected': isBlockMultiSelected(clientId), - 'is-reusable': Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["isReusableBlock"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["getBlockType"])(name)), - 'is-dragging': isDragging, - 'has-child-selected': isAncestorOfSelectedBlock, - 'has-active-entity': activeEntityBlockId, - // Determine if there is an active entity area to spotlight. - 'is-active-entity': activeEntityBlockId === clientId, - 'remove-outline': isSelected && outlineMode && isTyping() - }); - }, [clientId]); -} - - -/***/ }), - -/***/ "Q4Sy": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const plus = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" -})); -/* harmony default export */ __webpack_exports__["a"] = (plus); - - -/***/ }), - -/***/ "QP/w": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _use_setting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("v5LD"); - - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - -function FontSizePicker(props) { - const fontSizes = Object(_use_setting__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])('typography.fontSizes'); - const disableCustomFontSizes = !Object(_use_setting__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])('typography.customFontSize'); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["FontSizePicker"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { - fontSizes: fontSizes, - disableCustomFontSizes: disableCustomFontSizes - })); -} - -/* harmony default export */ __webpack_exports__["a"] = (FontSizePicker); - - -/***/ }), - -/***/ "REKd": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ useBlockPreview; }); - -// UNUSED EXPORTS: BlockPreview - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js + 1 modules -var provider = __webpack_require__("/QNa"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js + 4 modules -var block_list = __webpack_require__("VyCT"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/live.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -function LiveBlockPreview(_ref) { - let { - onClick - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - tabIndex: 0, - role: "button", - onClick: onClick, - onKeyPress: onClick - }, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], null, Object(external_wp_element_["createElement"])(block_list["c" /* default */], null))); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/iframe/index.js -var iframe = __webpack_require__("hHnB"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editor-styles/index.js -var editor_styles = __webpack_require__("KyyN"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/auto.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - // This is used to avoid rendering the block list if the sizes change. - -let MemoizedBlockList; -const MAX_HEIGHT = 2000; - -function AutoBlockPreview(_ref) { - let { - viewportWidth, - __experimentalPadding - } = _ref; - const [containerResizeListener, { - width: containerWidth - }] = Object(external_wp_compose_["useResizeObserver"])(); - const [contentResizeListener, { - height: contentHeight - }] = Object(external_wp_compose_["useResizeObserver"])(); - const styles = Object(external_wp_data_["useSelect"])(select => { - return select(store["a" /* store */]).getSettings().styles; - }, []); // Avoid scrollbars for pattern previews. - - const editorStyles = Object(external_wp_element_["useMemo"])(() => { - if (styles) { - return [...styles, { - css: 'body{height:auto;overflow:hidden;}', - __unstableType: 'presets' - }]; - } - - return styles; - }, [styles]); // Initialize on render instead of module top level, to avoid circular dependency issues. - - MemoizedBlockList = MemoizedBlockList || Object(external_wp_compose_["pure"])(block_list["c" /* default */]); - const scale = containerWidth / viewportWidth; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-preview__container" - }, containerResizeListener, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], { - className: "block-editor-block-preview__content", - style: { - transform: `scale(${scale})`, - height: contentHeight * scale, - maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined - } - }, Object(external_wp_element_["createElement"])(iframe["a" /* default */], { - head: Object(external_wp_element_["createElement"])(editor_styles["a" /* default */], { - styles: editorStyles - }), - contentRef: Object(external_wp_compose_["useRefEffect"])(bodyElement => { - const { - ownerDocument: { - documentElement - } - } = bodyElement; - documentElement.classList.add('block-editor-block-preview__content-iframe'); - documentElement.style.position = 'absolute'; - documentElement.style.width = '100%'; - bodyElement.style.padding = __experimentalPadding + 'px'; // necessary for contentResizeListener to work. - - bodyElement.style.position = 'relative'; - }, []), - "aria-hidden": true, - tabIndex: -1, - style: { - position: 'absolute', - width: viewportWidth, - height: contentHeight, - pointerEvents: 'none', - // This is a catch-all max-height for patterns. - // See: https://github.com/WordPress/gutenberg/pull/38175. - maxHeight: MAX_HEIGHT - } - }, contentResizeListener, Object(external_wp_element_["createElement"])(MemoizedBlockList, { - renderAppender: false - })))); -} - -/* harmony default export */ var auto = (AutoBlockPreview); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - - -function BlockPreview(_ref) { - let { - blocks, - __experimentalPadding = 0, - viewportWidth = 1200, - __experimentalLive = false, - __experimentalOnClick - } = _ref; - const originalSettings = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).getSettings(), []); - const settings = Object(external_wp_element_["useMemo"])(() => { - const _settings = { ...originalSettings - }; - _settings.__experimentalBlockPatterns = []; - return _settings; - }, [originalSettings]); - const renderedBlocks = Object(external_wp_element_["useMemo"])(() => Object(external_lodash_["castArray"])(blocks), [blocks]); - - if (!blocks || blocks.length === 0) { - return null; - } - - return Object(external_wp_element_["createElement"])(provider["a" /* default */], { - value: renderedBlocks, - settings: settings - }, __experimentalLive ? Object(external_wp_element_["createElement"])(LiveBlockPreview, { - onClick: __experimentalOnClick - }) : Object(external_wp_element_["createElement"])(auto, { - viewportWidth: viewportWidth, - __experimentalPadding: __experimentalPadding - })); -} -/** - * BlockPreview renders a preview of a block or array of blocks. - * - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md - * - * @param {Object} preview options for how the preview should be shown - * @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed. - * @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700. - * - * @return {WPComponent} The component to be rendered. - */ - -/* harmony default export */ var block_preview = __webpack_exports__["a"] = (Object(external_wp_element_["memo"])(BlockPreview)); -/** - * This hook is used to lightly mark an element as a block preview wrapper - * element. Call this hook and pass the returned props to the element to mark as - * a block preview wrapper, automatically rendering inner blocks as children. If - * you define a ref for the element, it is important to pass the ref to this - * hook, which the hook in turn will pass to the component through the props it - * returns. Optionally, you can also pass any other props through this hook, and - * they will be merged and returned. - * - * @param {Object} options Preview options. - * @param {WPBlock[]} options.blocks Block objects. - * @param {Object} options.props Optional. Props to pass to the element. Must contain - * the ref if one is defined. - * @param {Object} options.__experimentalLayout Layout settings to be used in the preview. - * - */ - -function useBlockPreview(_ref2) { - let { - blocks, - props = {}, - __experimentalLayout - } = _ref2; - const originalSettings = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).getSettings(), []); - const disabledRef = Object(external_wp_compose_["__experimentalUseDisabled"])(); - const ref = Object(external_wp_compose_["useMergeRefs"])([props.ref, disabledRef]); - const settings = Object(external_wp_element_["useMemo"])(() => ({ ...originalSettings, - __experimentalBlockPatterns: [] - }), [originalSettings]); - const renderedBlocks = Object(external_wp_element_["useMemo"])(() => Object(external_lodash_["castArray"])(blocks), [blocks]); - const children = Object(external_wp_element_["createElement"])(provider["a" /* default */], { - value: renderedBlocks, - settings: settings - }, Object(external_wp_element_["createElement"])(block_list["a" /* BlockListItems */], { - renderAppender: false, - __experimentalLayout: __experimentalLayout - })); - return { ...props, - ref, - className: classnames_default()(props.className, 'block-editor-block-preview__live-content', 'components-disabled'), - children: blocks !== null && blocks !== void 0 && blocks.length ? children : null - }; -} - - -/***/ }), - -/***/ "RMJe": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" -})); -/* harmony default export */ __webpack_exports__["a"] = (check); - - -/***/ }), - -/***/ "Rk8H": -/***/ (function(module, exports, __webpack_require__) { - -// Load in dependencies -var computedStyle = __webpack_require__("jTPX"); - -/** - * Calculate the `line-height` of a given node - * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM. - * @returns {Number} `line-height` of the element in pixels - */ -function lineHeight(node) { - // Grab the line-height via style - var lnHeightStr = computedStyle(node, 'line-height'); - var lnHeight = parseFloat(lnHeightStr, 10); - - // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em') - if (lnHeightStr === lnHeight + '') { - // Save the old lineHeight style and update the em unit to the element - var _lnHeightStyle = node.style.lineHeight; - node.style.lineHeight = lnHeightStr + 'em'; - - // Calculate the em based height - lnHeightStr = computedStyle(node, 'line-height'); - lnHeight = parseFloat(lnHeightStr, 10); - - // Revert the lineHeight style - if (_lnHeightStyle) { - node.style.lineHeight = _lnHeightStyle; - } else { - delete node.style.lineHeight; - } - } - - // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt) - // DEV: `em` units are converted to `pt` in IE6 - // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length - if (lnHeightStr.indexOf('pt') !== -1) { - lnHeight *= 4; - lnHeight /= 3; - // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm) - } else if (lnHeightStr.indexOf('mm') !== -1) { - lnHeight *= 96; - lnHeight /= 25.4; - // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm) - } else if (lnHeightStr.indexOf('cm') !== -1) { - lnHeight *= 96; - lnHeight /= 2.54; - // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in) - } else if (lnHeightStr.indexOf('in') !== -1) { - lnHeight *= 96; - // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc) - } else if (lnHeightStr.indexOf('pc') !== -1) { - lnHeight *= 16; - } - - // Continue our computation - lnHeight = Math.round(lnHeight); - - // If the line-height is "normal", calculate by font-size - if (lnHeightStr === 'normal') { - // Create a temporary node - var nodeName = node.nodeName; - var _node = document.createElement(nodeName); - _node.innerHTML = ' '; - - // If we have a text area, reset it to only 1 row - // https://github.com/twolfson/line-height/issues/4 - if (nodeName.toUpperCase() === 'TEXTAREA') { - _node.setAttribute('rows', '1'); - } - - // Set the font-size of the element - var fontSizeStr = computedStyle(node, 'font-size'); - _node.style.fontSize = fontSizeStr; - - // Remove default padding/border which can affect offset height - // https://github.com/twolfson/line-height/issues/4 - // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight - _node.style.padding = '0px'; - _node.style.border = '0px'; - - // Append it to the body - var body = document.body; - body.appendChild(_node); - - // Assume the line height of the element is the height - var height = _node.offsetHeight; - lnHeight = height; - - // Remove our child from the DOM - body.removeChild(_node); - } - - // Return the calculated height - return lnHeight; -} - -// Export lineHeight -module.exports = lineHeight; - - -/***/ }), - -/***/ "RxS6": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["keycodes"]; }()); - -/***/ }), - -/***/ "SVSp": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["shortcode"]; }()); - -/***/ }), - -/***/ "TSYQ": -/***/ (function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see @@ -27548,5106 +347,376 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), -/***/ "TVFh": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ useWritingFlow; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js -var use_block_refs = __webpack_require__("PKbb"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-multi-selection.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function toggleRichText(container, toggle) { - Array.from(container.querySelectorAll('.rich-text')).forEach(node => { - if (toggle) { - node.setAttribute('contenteditable', true); - } else { - node.removeAttribute('contenteditable'); - } - }); -} -/** - * Returns for the deepest node at the start or end of a container node. Ignores - * any text nodes that only contain HTML formatting whitespace. - * - * @param {Element} node Container to search. - * @param {string} type 'start' or 'end'. - */ - - -function getDeepestNode(node, type) { - const child = type === 'start' ? 'firstChild' : 'lastChild'; - const sibling = type === 'start' ? 'nextSibling' : 'previousSibling'; - - while (node[child]) { - node = node[child]; - - while (node.nodeType === node.TEXT_NODE && /^[ \t\n]*$/.test(node.data) && node[sibling]) { - node = node[sibling]; - } - } - - return node; -} - -function selector(select) { - const { - isMultiSelecting, - getMultiSelectedBlockClientIds, - hasMultiSelection, - getSelectedBlockClientId - } = select(store["a" /* store */]); - return { - isMultiSelecting: isMultiSelecting(), - multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(), - hasMultiSelection: hasMultiSelection(), - selectedBlockClientId: getSelectedBlockClientId() - }; -} - -function useMultiSelection() { - const { - isMultiSelecting, - multiSelectedBlockClientIds, - hasMultiSelection, - selectedBlockClientId - } = Object(external_wp_data_["useSelect"])(selector, []); - const selectedRef = Object(use_block_refs["b" /* __unstableUseBlockRef */])(selectedBlockClientId); // These must be in the right DOM order. - - const startRef = Object(use_block_refs["b" /* __unstableUseBlockRef */])(Object(external_lodash_["first"])(multiSelectedBlockClientIds)); - const endRef = Object(use_block_refs["b" /* __unstableUseBlockRef */])(Object(external_lodash_["last"])(multiSelectedBlockClientIds)); - /** - * When the component updates, and there is multi selection, we need to - * select the entire block contents. - */ - - return Object(external_wp_compose_["useRefEffect"])(node => { - const { - ownerDocument - } = node; - const { - defaultView - } = ownerDocument; - - if (!hasMultiSelection || isMultiSelecting) { - if (!selectedBlockClientId || isMultiSelecting) { - return; - } - - const selection = defaultView.getSelection(); - - if (selection.rangeCount && !selection.isCollapsed) { - const blockNode = selectedRef.current; - const { - startContainer, - endContainer - } = selection.getRangeAt(0); - - if (!!blockNode && (!blockNode.contains(startContainer) || !blockNode.contains(endContainer))) { - selection.removeAllRanges(); - } - } - - return; - } - - const { - length - } = multiSelectedBlockClientIds; - - if (length < 2) { - return; - } // The block refs might not be immediately available - // when dragging blocks into another block. - - - if (!startRef.current || !endRef.current) { - return; - } // For some browsers, like Safari, it is important that focus happens - // BEFORE selection. - - - node.focus(); - const selection = defaultView.getSelection(); - const range = ownerDocument.createRange(); // These must be in the right DOM order. - // The most stable way to select the whole block contents is to start - // and end at the deepest points. - - const startNode = getDeepestNode(startRef.current, 'start'); - const endNode = getDeepestNode(endRef.current, 'end'); // While rich text will be disabled with a delay when there is a multi - // selection, we must do it immediately because it's not possible to set - // selection across editable hosts. - - toggleRichText(node, false); - range.setStartBefore(startNode); - range.setEndAfter(endNode); - selection.removeAllRanges(); - selection.addRange(range); - }, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId]); -} - -// EXTERNAL MODULE: external ["wp","dom"] -var external_wp_dom_ = __webpack_require__("1CF3"); - -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-tab-nav.js - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -function isFormElement(element) { - const { - tagName - } = element; - return tagName === 'INPUT' || tagName === 'BUTTON' || tagName === 'SELECT' || tagName === 'TEXTAREA'; -} - -function useTabNav() { - const container = Object(external_wp_element_["useRef"])(); - const focusCaptureBeforeRef = Object(external_wp_element_["useRef"])(); - const focusCaptureAfterRef = Object(external_wp_element_["useRef"])(); - const lastFocus = Object(external_wp_element_["useRef"])(); - const { - hasMultiSelection, - getSelectedBlockClientId, - getBlockCount - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - setNavigationMode - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const isNavigationMode = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).isNavigationMode(), []); // Don't allow tabbing to this element in Navigation mode. - - const focusCaptureTabIndex = !isNavigationMode ? '0' : undefined; // Reference that holds the a flag for enabling or disabling - // capturing on the focus capture elements. - - const noCapture = Object(external_wp_element_["useRef"])(); - - function onFocusCapture(event) { - // Do not capture incoming focus if set by us in WritingFlow. - if (noCapture.current) { - noCapture.current = null; - } else if (hasMultiSelection()) { - container.current.focus(); - } else if (getSelectedBlockClientId()) { - lastFocus.current.focus(); - } else { - setNavigationMode(true); - const isBefore = // eslint-disable-next-line no-bitwise - event.target.compareDocumentPosition(container.current) & event.target.DOCUMENT_POSITION_FOLLOWING; - const action = isBefore ? 'findNext' : 'findPrevious'; - external_wp_dom_["focus"].tabbable[action](event.target).focus(); - } - } - - const before = Object(external_wp_element_["createElement"])("div", { - ref: focusCaptureBeforeRef, - tabIndex: focusCaptureTabIndex, - onFocus: onFocusCapture - }); - const after = Object(external_wp_element_["createElement"])("div", { - ref: focusCaptureAfterRef, - tabIndex: focusCaptureTabIndex, - onFocus: onFocusCapture - }); - const ref = Object(external_wp_compose_["useRefEffect"])(node => { - function onKeyDown(event) { - if (event.defaultPrevented) { - return; - } - - if (event.keyCode === external_wp_keycodes_["ESCAPE"] && !hasMultiSelection()) { - event.preventDefault(); - setNavigationMode(true); - return; - } // In Edit mode, Tab should focus the first tabbable element after - // the content, which is normally the sidebar (with block controls) - // and Shift+Tab should focus the first tabbable element before the - // content, which is normally the block toolbar. - // Arrow keys can be used, and Tab and arrow keys can be used in - // Navigation mode (press Esc), to navigate through blocks. - - - if (event.keyCode !== external_wp_keycodes_["TAB"]) { - return; - } - - const isShift = event.shiftKey; - const direction = isShift ? 'findPrevious' : 'findNext'; - - if (!hasMultiSelection() && !getSelectedBlockClientId()) { - // Preserve the behaviour of entering navigation mode when - // tabbing into the content without a block selection. - // `onFocusCapture` already did this previously, but we need to - // do it again here because after clearing block selection, - // focus land on the writing flow container and pressing Tab - // will no longer send focus through the focus capture element. - if (event.target === node) setNavigationMode(true); - return; - } // Allow tabbing between form elements rendered in a block, - // such as inside a placeholder. Form elements are generally - // meant to be UI rather than part of the content. Ideally - // these are not rendered in the content and perhaps in the - // future they can be rendered in an iframe or shadow DOM. - - - if (isFormElement(event.target) && isFormElement(external_wp_dom_["focus"].tabbable[direction](event.target))) { - return; - } - - const next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef; // Disable focus capturing on the focus capture element, so it - // doesn't refocus this block and so it allows default behaviour - // (moving focus to the next tabbable element). - - noCapture.current = true; // Focusing the focus capture element, which is located above and - // below the editor, should not scroll the page all the way up or - // down. - - next.current.focus({ - preventScroll: true - }); - } - - function onFocusOut(event) { - lastFocus.current = event.target; - const { - ownerDocument - } = node; // If focus disappears due to there being no blocks, move focus to - // the writing flow wrapper. - - if (!event.relatedTarget && ownerDocument.activeElement === ownerDocument.body && getBlockCount() === 0) { - node.focus(); - } - } // When tabbing back to an element in block list, this event handler prevents scrolling if the - // focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph - // when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the - // top or bottom of the document. - // - // Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this - // earlier in the keypress handler, and call focus( { preventScroll: true } ) instead. - // https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters - - - function preventScrollOnTab(event) { - var _event$target; - - if (event.keyCode !== external_wp_keycodes_["TAB"]) { - return; - } - - if (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute('role')) === 'region') { - return; - } - - if (container.current === event.target) { - return; - } - - const isShift = event.shiftKey; - const direction = isShift ? 'findPrevious' : 'findNext'; - const target = external_wp_dom_["focus"].tabbable[direction](event.target); // only do something when the next tabbable is a focus capture div (before/after) - - if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) { - event.preventDefault(); - target.focus({ - preventScroll: true - }); - } - } - - const { - ownerDocument - } = node; - const { - defaultView - } = ownerDocument; - defaultView.addEventListener('keydown', preventScrollOnTab); - node.addEventListener('keydown', onKeyDown); - node.addEventListener('focusout', onFocusOut); - return () => { - defaultView.removeEventListener('keydown', preventScrollOnTab); - node.removeEventListener('keydown', onKeyDown); - node.removeEventListener('focusout', onFocusOut); - }; - }, []); - const mergedRefs = Object(external_wp_compose_["useMergeRefs"])([container, ref]); - return [before, mergedRefs, after]; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/dom.js -var dom = __webpack_require__("OL6h"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-arrow-nav.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -/** - * Returns true if the element should consider edge navigation upon a keyboard - * event of the given directional key code, or false otherwise. - * - * @param {Element} element HTML element to test. - * @param {number} keyCode KeyboardEvent keyCode to test. - * @param {boolean} hasModifier Whether a modifier is pressed. - * - * @return {boolean} Whether element should consider edge navigation. - */ - -function isNavigationCandidate(element, keyCode, hasModifier) { - const isVertical = keyCode === external_wp_keycodes_["UP"] || keyCode === external_wp_keycodes_["DOWN"]; // Currently, all elements support unmodified vertical navigation. - - if (isVertical && !hasModifier) { - return true; - } // Native inputs should not navigate horizontally. - - - const { - tagName - } = element; - return tagName !== 'INPUT' && tagName !== 'TEXTAREA'; -} -/** - * Returns the optimal tab target from the given focused element in the desired - * direction. A preference is made toward text fields, falling back to the block - * focus stop if no other candidates exist for the block. - * - * @param {Element} target Currently focused text field. - * @param {boolean} isReverse True if considering as the first field. - * @param {Element} containerElement Element containing all blocks. - * @param {boolean} onlyVertical Whether to only consider tabbable elements - * that are visually above or under the - * target. - * - * @return {?Element} Optimal tab target, if one exists. - */ - -function getClosestTabbable(target, isReverse, containerElement, onlyVertical) { - // Since the current focus target is not guaranteed to be a text field, find - // all focusables. Tabbability is considered later. - let focusableNodes = external_wp_dom_["focus"].focusable.find(containerElement); - - if (isReverse) { - focusableNodes = Object(external_lodash_["reverse"])(focusableNodes); - } // Consider as candidates those focusables after the current target. It's - // assumed this can only be reached if the target is focusable (on its - // keydown event), so no need to verify it exists in the set. - - - focusableNodes = focusableNodes.slice(focusableNodes.indexOf(target) + 1); - let targetRect; - - if (onlyVertical) { - targetRect = target.getBoundingClientRect(); - } - - function isTabCandidate(node) { - // Not a candidate if the node is not tabbable. - if (!external_wp_dom_["focus"].tabbable.isTabbableIndex(node)) { - return false; - } // Skip focusable elements such as links within content editable nodes. - - - if (node.isContentEditable && node.contentEditable !== 'true') { - return false; - } - - if (onlyVertical) { - const nodeRect = node.getBoundingClientRect(); - - if (nodeRect.left >= targetRect.right || nodeRect.right <= targetRect.left) { - return false; - } - } - - return true; - } - - return Object(external_lodash_["find"])(focusableNodes, isTabCandidate); -} -function useArrowNav() { - const { - getSelectedBlockClientId, - getMultiSelectedBlocksStartClientId, - getMultiSelectedBlocksEndClientId, - getPreviousBlockClientId, - getNextBlockClientId, - getFirstMultiSelectedBlockClientId, - getLastMultiSelectedBlockClientId, - getSettings, - hasMultiSelection - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - multiSelect, - selectBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - return Object(external_wp_compose_["useRefEffect"])(node => { - // Here a DOMRect is stored while moving the caret vertically so - // vertical position of the start position can be restored. This is to - // recreate browser behaviour across blocks. - let verticalRect; - - function onMouseDown() { - verticalRect = null; - } - - function expandSelection(isReverse) { - const selectedBlockClientId = getSelectedBlockClientId(); - const selectionStartClientId = getMultiSelectedBlocksStartClientId(); - const selectionEndClientId = getMultiSelectedBlocksEndClientId(); - const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId); - const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId); - const nextSelectionEndClientId = isReverse ? selectionBeforeEndClientId : selectionAfterEndClientId; - - if (nextSelectionEndClientId) { - if (selectionStartClientId === nextSelectionEndClientId) { - selectBlock(nextSelectionEndClientId); - } else { - multiSelect(selectionStartClientId || selectedBlockClientId, nextSelectionEndClientId); - } - } - } - - function moveSelection(isReverse) { - const selectedFirstClientId = getFirstMultiSelectedBlockClientId(); - const selectedLastClientId = getLastMultiSelectedBlockClientId(); - const focusedBlockClientId = isReverse ? selectedFirstClientId : selectedLastClientId; - - if (focusedBlockClientId) { - selectBlock(focusedBlockClientId); - } - } - /** - * Returns true if the given target field is the last in its block which - * can be considered for tab transition. For example, in a block with - * two text fields, this would return true when reversing from the first - * of the two fields, but false when reversing from the second. - * - * @param {Element} target Currently focused text field. - * @param {boolean} isReverse True if considering as the first field. - * - * @return {boolean} Whether field is at edge for tab transition. - */ - - - function isTabbableEdge(target, isReverse) { - const closestTabbable = getClosestTabbable(target, isReverse, node); - return !closestTabbable || !Object(dom["b" /* isInSameBlock */])(target, closestTabbable); - } - - function onKeyDown(event) { - const { - keyCode, - target - } = event; - const isUp = keyCode === external_wp_keycodes_["UP"]; - const isDown = keyCode === external_wp_keycodes_["DOWN"]; - const isLeft = keyCode === external_wp_keycodes_["LEFT"]; - const isRight = keyCode === external_wp_keycodes_["RIGHT"]; - const isReverse = isUp || isLeft; - const isHorizontal = isLeft || isRight; - const isVertical = isUp || isDown; - const isNav = isHorizontal || isVertical; - const isShift = event.shiftKey; - const hasModifier = isShift || event.ctrlKey || event.altKey || event.metaKey; - const isNavEdge = isVertical ? external_wp_dom_["isVerticalEdge"] : external_wp_dom_["isHorizontalEdge"]; - const { - ownerDocument - } = node; - const { - defaultView - } = ownerDocument; - - if (hasMultiSelection()) { - if (isNav) { - const action = isShift ? expandSelection : moveSelection; - action(isReverse); - event.preventDefault(); - } - - return; - } // When presing any key other than up or down, the initial vertical - // position must ALWAYS be reset. The vertical position is saved so - // it can be restored as well as possible on sebsequent vertical - // arrow key presses. It may not always be possible to restore the - // exact same position (such as at an empty line), so it wouldn't be - // good to compute the position right before any vertical arrow key - // press. - - - if (!isVertical) { - verticalRect = null; - } else if (!verticalRect) { - verticalRect = Object(external_wp_dom_["computeCaretRect"])(defaultView); - } // Abort if navigation has already been handled (e.g. RichText - // inline boundaries). - - - if (event.defaultPrevented) { - return; - } - - if (!isNav) { - return; - } // Abort if our current target is not a candidate for navigation - // (e.g. preserve native input behaviors). - - - if (!isNavigationCandidate(target, keyCode, hasModifier)) { - return; - } // In the case of RTL scripts, right means previous and left means - // next, which is the exact reverse of LTR. - - - const isReverseDir = Object(external_wp_dom_["isRTL"])(target) ? !isReverse : isReverse; - const { - keepCaretInsideBlock - } = getSettings(); - const selectedBlockClientId = getSelectedBlockClientId(); - - if (isShift) { - const selectionEndClientId = getMultiSelectedBlocksEndClientId(); - const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId); - const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId); - - if ( // Ensure that there is a target block. - (isReverse && selectionBeforeEndClientId || !isReverse && selectionAfterEndClientId) && isTabbableEdge(target, isReverse) && isNavEdge(target, isReverse)) { - // Shift key is down, and there is multi selection or we're - // at the end of the current block. - expandSelection(isReverse); - event.preventDefault(); - } - } else if (isVertical && Object(external_wp_dom_["isVerticalEdge"])(target, isReverse) && !keepCaretInsideBlock) { - const closestTabbable = getClosestTabbable(target, isReverse, node, true); - - if (closestTabbable) { - Object(external_wp_dom_["placeCaretAtVerticalEdge"])(closestTabbable, isReverse, verticalRect); - event.preventDefault(); - } - } else if (isHorizontal && defaultView.getSelection().isCollapsed && Object(external_wp_dom_["isHorizontalEdge"])(target, isReverseDir) && !keepCaretInsideBlock) { - const closestTabbable = getClosestTabbable(target, isReverseDir, node); - Object(external_wp_dom_["placeCaretAtHorizontalEdge"])(closestTabbable, isReverse); - event.preventDefault(); - } - } - - node.addEventListener('mousedown', onMouseDown); - node.addEventListener('keydown', onKeyDown); - return () => { - node.removeEventListener('mousedown', onMouseDown); - node.removeEventListener('keydown', onKeyDown); - }; - }, []); -} - -// EXTERNAL MODULE: external ["wp","keyboardShortcuts"] -var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-select-all.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -function useSelectAll() { - const { - getBlockOrder, - getSelectedBlockClientIds, - getBlockRootClientId - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - multiSelect - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const isMatch = Object(external_wp_keyboardShortcuts_["__unstableUseShortcutEventMatch"])(); - return Object(external_wp_compose_["useRefEffect"])(node => { - function onKeyDown(event) { - if (!isMatch('core/block-editor/select-all', event)) { - return; - } - - if (!Object(external_wp_dom_["isEntirelySelected"])(event.target)) { - return; - } - - const selectedClientIds = getSelectedBlockClientIds(); - const [firstSelectedClientId] = selectedClientIds; - const rootClientId = getBlockRootClientId(firstSelectedClientId); - let blockClientIds = getBlockOrder(rootClientId); // If we have selected all sibling nested blocks, try selecting up a - // level. See: https://github.com/WordPress/gutenberg/pull/31859/ - - if (selectedClientIds.length === blockClientIds.length) { - blockClientIds = getBlockOrder(getBlockRootClientId(rootClientId)); - } - - const firstClientId = Object(external_lodash_["first"])(blockClientIds); - const lastClientId = Object(external_lodash_["last"])(blockClientIds); - - if (firstClientId === lastClientId) { - return; - } - - multiSelect(firstClientId, lastClientId); - event.preventDefault(); - } - - node.addEventListener('keydown', onKeyDown); - return () => { - node.removeEventListener('keydown', onKeyDown); - }; - }, []); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - -function useWritingFlow() { - const [before, ref, after] = useTabNav(); - const hasMultiSelection = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).hasMultiSelection(), []); - return [before, Object(external_wp_compose_["useMergeRefs"])([ref, useMultiSelection(), useSelectAll(), useArrowNav(), Object(external_wp_compose_["useRefEffect"])(node => { - node.tabIndex = -1; - - if (!hasMultiSelection) { - return; - } - - node.setAttribute('aria-label', Object(external_wp_i18n_["__"])('Multiple selected blocks')); - return () => { - node.removeAttribute('aria-label'); - }; - }, [hasMultiSelection])]), after]; -} - -function WritingFlow(_ref, forwardedRef) { - let { - children, - ...props - } = _ref; - const [before, ref, after] = useWritingFlow(); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, before, Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, props, { - ref: Object(external_wp_compose_["useMergeRefs"])([ref, forwardedRef]), - className: classnames_default()(props.className, 'block-editor-writing-flow') - }), children), after); -} -/** - * Handles selection and navigation across blocks. This component should be - * wrapped around BlockList. - * - * @param {Object} props Component properties. - * @param {WPElement} props.children Children to be rendered. - */ - - -/* harmony default export */ var writing_flow = __webpack_exports__["a"] = (Object(external_wp_element_["forwardRef"])(WritingFlow)); - - -/***/ }), - -/***/ "Tqx9": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["primitives"]; }()); - -/***/ }), - -/***/ "U1WI": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export BlockSettingsMenu */ -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _block_settings_dropdown__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("1eGn"); - - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -function BlockSettingsMenu(_ref) { - let { - clientIds, - ...props - } = _ref; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["ToolbarGroup"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["ToolbarItem"], null, toggleProps => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_settings_dropdown__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - clientIds: clientIds, - toggleProps: toggleProps - }, props)))); -} -/* harmony default export */ __webpack_exports__["a"] = (BlockSettingsMenu); - - -/***/ }), - -/***/ "VKE3": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const moreVertical = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" -})); -/* harmony default export */ __webpack_exports__["a"] = (moreVertical); - - -/***/ }), - -/***/ "VrEk": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - -const InspectorControlsDefault = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorControls'); -const InspectorControlsAdvanced = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorAdvancedControls'); -const InspectorControlsDimensions = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorControlsDimensions'); -const InspectorControlsTypography = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorControlsTypography'); -const groups = { - default: InspectorControlsDefault, - advanced: InspectorControlsAdvanced, - dimensions: InspectorControlsDimensions, - typography: InspectorControlsTypography -}; -/* harmony default export */ __webpack_exports__["a"] = (groups); - - -/***/ }), - -/***/ "VyCT": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ IntersectionObserver; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ BlockList; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockListItems; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block.js + 6 modules -var block = __webpack_require__("jBNB"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js -var default_block_appender = __webpack_require__("5L8O"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js -var button_block_appender = __webpack_require__("I5Hl"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - -function BlockListAppender(_ref) { - let { - blockClientIds, - rootClientId, - canInsertDefaultBlock, - isLocked, - renderAppender: CustomAppender, - className, - selectedBlockClientId, - tagName: TagName = 'div' - } = _ref; - - if (isLocked || CustomAppender === false) { - return null; - } - - let appender; - - if (CustomAppender) { - // Prefer custom render prop if provided. - appender = Object(external_wp_element_["createElement"])(CustomAppender, null); - } else { - const isDocumentAppender = !rootClientId; - const isParentSelected = selectedBlockClientId === rootClientId; - const isAnotherDefaultAppenderAlreadyDisplayed = selectedBlockClientId && !blockClientIds.includes(selectedBlockClientId); - - if (!isDocumentAppender && !isParentSelected && (!selectedBlockClientId || isAnotherDefaultAppenderAlreadyDisplayed)) { - return null; - } - - if (canInsertDefaultBlock) { - // Render the default block appender when renderAppender has not been - // provided and the context supports use of the default appender. - appender = Object(external_wp_element_["createElement"])(default_block_appender["a" /* default */], { - rootClientId: rootClientId, - lastBlockClientId: Object(external_lodash_["last"])(blockClientIds) - }); - } else { - // Fallback in the case no renderAppender has been provided and the - // default block can't be inserted. - appender = Object(external_wp_element_["createElement"])(button_block_appender["b" /* default */], { - rootClientId: rootClientId, - className: "block-list-appender__toggle" - }); - } - } - - return Object(external_wp_element_["createElement"])(TagName // A `tabIndex` is used on the wrapping `div` element in order to - // force a focus event to occur when an appender `button` element - // is clicked. In some browsers (Firefox, Safari), button clicks do - // not emit a focus event, which could cause this event to propagate - // unexpectedly. The `tabIndex` ensures that the interaction is - // captured as a focus, without also adding an extra tab stop. - // - // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus - , { - tabIndex: -1, - className: classnames_default()('block-list-appender wp-block', className) // The appender exists to let you add the first Paragraph before - // any is inserted. To that end, this appender should visually be - // presented as a block. That means theme CSS should style it as if - // it were an empty paragraph block. That means a `wp-block` class to - // ensure the width is correct, and a [data-block] attribute to ensure - // the correct margin is applied, especially for classic themes which - // have commonly targeted that attribute for margins. - , - "data-block": true - }, appender); -} - -/* harmony default export */ var block_list_appender = (Object(external_wp_data_["withSelect"])((select, _ref2) => { - let { - rootClientId - } = _ref2; - const { - getBlockOrder, - canInsertBlockType, - getTemplateLock, - getSelectedBlockClientId - } = select(store["a" /* store */]); - return { - isLocked: !!getTemplateLock(rootClientId), - blockClientIds: getBlockOrder(rootClientId), - canInsertDefaultBlock: canInsertBlockType(Object(external_wp_blocks_["getDefaultBlockName"])(), rootClientId), - selectedBlockClientId: getSelectedBlockClientId() - }; -})(BlockListAppender)); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/insertion-point.js -var insertion_point = __webpack_require__("PS/H"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-in-between-inserter.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function useInBetweenInserter() { - const openRef = Object(external_wp_element_["useContext"])(insertion_point["a" /* InsertionPointOpenRef */]); - const hasReducedUI = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).getSettings().hasReducedUI, []); - const { - getBlockListSettings, - getBlockRootClientId, - getBlockIndex, - isBlockInsertionPointVisible, - isMultiSelecting, - getSelectedBlockClientIds, - getTemplateLock - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - showInsertionPoint, - hideInsertionPoint - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - return Object(external_wp_compose_["useRefEffect"])(node => { - if (hasReducedUI) { - return; - } - - function onMouseMove(event) { - var _getBlockListSettings, _element$parentElemen; - - if (openRef.current) { - return; - } - - if (isMultiSelecting()) { - return; - } - - if (!event.target.classList.contains('block-editor-block-list__layout')) { - if (isBlockInsertionPointVisible()) { - hideInsertionPoint(); - } - - return; - } - - let rootClientId; - - if (!event.target.classList.contains('is-root-container')) { - const blockElement = !!event.target.getAttribute('data-block') ? event.target : event.target.closest('[data-block]'); - rootClientId = blockElement.getAttribute('data-block'); - } // Don't set the insertion point if the template is locked. - - - if (getTemplateLock(rootClientId)) { - return; - } - - const orientation = ((_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical'; - const rect = event.target.getBoundingClientRect(); - const offsetTop = event.clientY - rect.top; - const offsetLeft = event.clientX - rect.left; - const children = Array.from(event.target.children); - let element = children.find(blockEl => { - return blockEl.classList.contains('wp-block') && orientation === 'vertical' && blockEl.offsetTop > offsetTop || blockEl.classList.contains('wp-block') && orientation === 'horizontal' && blockEl.offsetLeft > offsetLeft; - }); - - if (!element) { - return; - } // The block may be in an alignment wrapper, so check the first direct - // child if the element has no ID. - - - if (!element.id) { - element = element.firstElementChild; - - if (!element) { - return; - } - } // Don't show the insertion point if a parent block has an "overlay" - // See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337 - - - const parentOverlay = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.closest('.block-editor-block-content-overlay.overlay-active'); - - if (parentOverlay) { - return; - } - - const clientId = element.id.slice('block-'.length); - - if (!clientId) { - return; - } // Don't show the inserter when hovering above (conflicts with - // block toolbar) or inside selected block(s). - - - if (getSelectedBlockClientIds().includes(clientId)) { - return; - } - - const elementRect = element.getBoundingClientRect(); - - if (orientation === 'horizontal' && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === 'vertical' && (event.clientX > elementRect.right || event.clientX < elementRect.left)) { - if (isBlockInsertionPointVisible()) { - hideInsertionPoint(); - } - - return; - } - - const index = getBlockIndex(clientId); // Don't show the in-between inserter before the first block in - // the list (preserves the original behaviour). - - if (index === 0) { - if (isBlockInsertionPointVisible()) { - hideInsertionPoint(); - } - - return; - } - - showInsertionPoint(rootClientId, index, { - __unstableWithInserter: true - }); - } - - node.addEventListener('mousemove', onMouseMove); - return () => { - node.removeEventListener('mousemove', onMouseMove); - }; - }, [openRef, getBlockListSettings, getBlockRootClientId, getBlockIndex, isBlockInsertionPointVisible, isMultiSelecting, showInsertionPoint, hideInsertionPoint, getSelectedBlockClientIds]); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/pre-parse-patterns.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -const requestIdleCallback = (() => { - if (typeof window === 'undefined') { - return callback => { - setTimeout(() => callback(Date.now()), 0); - }; - } - - return window.requestIdleCallback || window.requestAnimationFrame; -})(); - -const cancelIdleCallback = (() => { - if (typeof window === 'undefined') { - return clearTimeout; - } - - return window.cancelIdleCallback || window.cancelAnimationFrame; -})(); - -function usePreParsePatterns() { - const patterns = Object(external_wp_data_["useSelect"])(_select => _select(store["a" /* store */]).getSettings().__experimentalBlockPatterns, []); - Object(external_wp_element_["useEffect"])(() => { - if (!(patterns !== null && patterns !== void 0 && patterns.length)) { - return; - } - - let handle; - let index = -1; - - const callback = () => { - index++; - - if (index >= patterns.length) { - return; - } - - Object(external_wp_data_["select"])(store["a" /* store */]).__experimentalGetParsedPattern(patterns[index].name); - - handle = requestIdleCallback(callback); - }; - - handle = requestIdleCallback(callback); - return () => cancelIdleCallback(handle); - }, [patterns]); - return null; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js -var block_list_layout = __webpack_require__("w8sn"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","deprecated"] -var external_wp_deprecated_ = __webpack_require__("NMb1"); -var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-popover.js + 1 modules -var block_popover = __webpack_require__("xCFn"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/back-compat.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function BlockToolsBackCompat(_ref) { - let { - children - } = _ref; - const openRef = Object(external_wp_element_["useContext"])(insertion_point["a" /* InsertionPointOpenRef */]); - const isDisabled = Object(external_wp_element_["useContext"])(external_wp_components_["Disabled"].Context); // If context is set, `BlockTools` is a parent component. - - if (openRef || isDisabled) { - return children; - } - - external_wp_deprecated_default()('wp.components.Popover.Slot name="block-toolbar"', { - alternative: 'wp.blockEditor.BlockTools' - }); - return Object(external_wp_element_["createElement"])(insertion_point["b" /* default */], { - __unstablePopoverSlot: "block-toolbar" - }, Object(external_wp_element_["createElement"])(block_popover["a" /* default */], { - __unstablePopoverSlot: "block-toolbar" - }), children); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-selection-clearer/index.js -var block_selection_clearer = __webpack_require__("zQI6"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js + 7 modules -var inner_blocks = __webpack_require__("p3NJ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js -var context = __webpack_require__("ur0x"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - -const elementContext = Object(external_wp_element_["createContext"])(); -const IntersectionObserver = Object(external_wp_element_["createContext"])(); - -function Root(_ref) { - let { - className, - ...settings - } = _ref; - const [element, setElement] = Object(external_wp_element_["useState"])(); - const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium'); - const { - isOutlineMode, - isFocusMode, - isNavigationMode - } = Object(external_wp_data_["useSelect"])(select => { - const { - getSettings, - isNavigationMode: _isNavigationMode - } = select(store["a" /* store */]); - const { - outlineMode, - focusMode - } = getSettings(); - return { - isOutlineMode: outlineMode, - isFocusMode: focusMode, - isNavigationMode: _isNavigationMode() - }; - }, []); - const innerBlocksProps = Object(inner_blocks["b" /* useInnerBlocksProps */])({ - ref: Object(external_wp_compose_["useMergeRefs"])([Object(block_selection_clearer["b" /* useBlockSelectionClearer */])(), useInBetweenInserter(), setElement]), - className: classnames_default()('is-root-container', className, { - 'is-outline-mode': isOutlineMode, - 'is-focus-mode': isFocusMode && isLargeViewport, - 'is-navigate-mode': isNavigationMode +/***/ 4827: +/***/ (function(module) { + +// This code has been refactored for 140 bytes +// You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js +var computedStyle = function (el, prop, getComputedStyle) { + getComputedStyle = window.getComputedStyle; + + // In one fell swoop + return ( + // If we have getComputedStyle + getComputedStyle ? + // Query it + // TODO: From CSS-Query notes, we might need (node, null) for FF + getComputedStyle(el) : + + // Otherwise, we are in IE and use currentStyle + el.currentStyle + )[ + // Switch to camelCase for CSSOM + // DEV: Grabbed from jQuery + // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 + // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 + prop.replace(/-(\w)/gi, function (word, letter) { + return letter.toUpperCase(); }) - }, settings); - return Object(external_wp_element_["createElement"])(elementContext.Provider, { - value: element - }, Object(external_wp_element_["createElement"])("div", innerBlocksProps)); -} - -function BlockList(settings) { - usePreParsePatterns(); - return Object(external_wp_element_["createElement"])(BlockToolsBackCompat, null, Object(external_wp_element_["createElement"])(context["a" /* BlockEditContextProvider */], { - value: context["b" /* DEFAULT_BLOCK_EDIT_CONTEXT */] - }, Object(external_wp_element_["createElement"])(Root, settings))); -} -BlockList.__unstableElementContext = elementContext; - -function Items(_ref2) { - let { - placeholder, - rootClientId, - renderAppender, - __experimentalAppenderTagName, - __experimentalLayout: layout = block_list_layout["c" /* defaultLayout */] - } = _ref2; - const [intersectingBlocks, setIntersectingBlocks] = Object(external_wp_element_["useState"])(new Set()); - const intersectionObserver = Object(external_wp_element_["useMemo"])(() => { - const { - IntersectionObserver: Observer - } = window; - - if (!Observer) { - return; - } - - return new Observer(entries => { - setIntersectingBlocks(oldIntersectingBlocks => { - const newIntersectingBlocks = new Set(oldIntersectingBlocks); - - for (const entry of entries) { - const clientId = entry.target.getAttribute('data-block'); - const action = entry.isIntersecting ? 'add' : 'delete'; - newIntersectingBlocks[action](clientId); - } - - return newIntersectingBlocks; - }); - }); - }, [setIntersectingBlocks]); - const { - order, - selectedBlocks - } = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockOrder, - getSelectedBlockClientIds - } = select(store["a" /* store */]); - return { - order: getBlockOrder(rootClientId), - selectedBlocks: getSelectedBlockClientIds() - }; - }, [rootClientId]); - return Object(external_wp_element_["createElement"])(block_list_layout["a" /* LayoutProvider */], { - value: layout - }, Object(external_wp_element_["createElement"])(IntersectionObserver.Provider, { - value: intersectionObserver - }, order.map(clientId => Object(external_wp_element_["createElement"])(external_wp_data_["AsyncModeProvider"], { - key: clientId, - value: // Only provide data asynchronously if the block is - // not visible and not selected. - !intersectingBlocks.has(clientId) && !selectedBlocks.includes(clientId) - }, Object(external_wp_element_["createElement"])(block["b" /* default */], { - rootClientId: rootClientId, - clientId: clientId - })))), order.length < 1 && placeholder, Object(external_wp_element_["createElement"])(block_list_appender, { - tagName: __experimentalAppenderTagName, - rootClientId: rootClientId, - renderAppender: renderAppender - })); -} - -function BlockListItems(props) { - // This component needs to always be synchronous as it's the one changing - // the async mode depending on the block selection. - return Object(external_wp_element_["createElement"])(external_wp_data_["AsyncModeProvider"], { - value: false - }, Object(external_wp_element_["createElement"])(Items, props)); -} - - -/***/ }), - -/***/ "WbBG": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - - -/***/ }), - -/***/ "Wg7J": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("gdqT"); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("6ZVF"); -/* harmony import */ var _block_patterns_list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("Fmc1"); -/* harmony import */ var _inserter_menu_extension__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("mlss"); -/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("mdLt"); -/* harmony import */ var _no_results__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("LolH"); -/* harmony import */ var _hooks_use_insertion_point__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("AORF"); -/* harmony import */ var _hooks_use_patterns_state__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("nQUx"); -/* harmony import */ var _hooks_use_block_types_state__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("+G0a"); -/* harmony import */ var _search_items__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("pOGT"); -/* harmony import */ var _inserter_listbox__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("wiT/"); - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - -const INITIAL_INSERTER_RESULTS = 9; -/** - * Shared reference to an empty array for cases where it is important to avoid - * returning a new array reference on every invocation and rerendering the component. - * - * @type {Array} - */ - -const EMPTY_ARRAY = []; - -function InserterSearchResults(_ref) { - let { - filterValue, - onSelect, - onHover, - rootClientId, - clientId, - isAppender, - __experimentalInsertionIndex, - maxBlockPatterns, - maxBlockTypes, - showBlockDirectory = false, - isDraggable = true, - shouldFocusBlock = true - } = _ref; - const debouncedSpeak = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useDebounce"])(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_5__["speak"], 500); - const [destinationRootClientId, onInsertBlocks] = Object(_hooks_use_insertion_point__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])({ - onSelect, - rootClientId, - clientId, - isAppender, - insertionIndex: __experimentalInsertionIndex, - shouldFocusBlock - }); - const [blockTypes, blockTypeCategories, blockTypeCollections, onSelectBlockType] = Object(_hooks_use_block_types_state__WEBPACK_IMPORTED_MODULE_13__[/* default */ "a"])(destinationRootClientId, onInsertBlocks); - const [patterns,, onSelectBlockPattern] = Object(_hooks_use_patterns_state__WEBPACK_IMPORTED_MODULE_12__[/* default */ "a"])(onInsertBlocks, destinationRootClientId); - const filteredBlockTypes = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => { - const results = Object(_search_items__WEBPACK_IMPORTED_MODULE_14__[/* searchBlockItems */ "a"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["orderBy"])(blockTypes, ['frecency'], ['desc']), blockTypeCategories, blockTypeCollections, filterValue); - return maxBlockTypes !== undefined ? results.slice(0, maxBlockTypes) : results; - }, [filterValue, blockTypes, blockTypeCategories, blockTypeCollections, maxBlockTypes]); - const filteredBlockPatterns = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => { - const results = Object(_search_items__WEBPACK_IMPORTED_MODULE_14__[/* searchItems */ "b"])(patterns, filterValue); - return maxBlockPatterns !== undefined ? results.slice(0, maxBlockPatterns) : results; - }, [filterValue, patterns, maxBlockPatterns]); // Announce search results on change - - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => { - if (!filterValue) { - return; - } - - const count = filteredBlockTypes.length + filteredBlockPatterns.length; - const resultsFoundMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])( - /* translators: %d: number of results. */ - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_n"])('%d result found.', '%d results found.', count), count); - debouncedSpeak(resultsFoundMessage); - }, [filterValue, debouncedSpeak]); - const currentShownBlockTypes = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useAsyncList"])(filteredBlockTypes, { - step: INITIAL_INSERTER_RESULTS - }); - const currentShownPatterns = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useAsyncList"])(currentShownBlockTypes.length === filteredBlockTypes.length ? filteredBlockPatterns : EMPTY_ARRAY); - const hasItems = !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(filteredBlockTypes) || !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(filteredBlockPatterns); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter_listbox__WEBPACK_IMPORTED_MODULE_15__[/* default */ "a"], null, !showBlockDirectory && !hasItems && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_no_results__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"], null), !!filteredBlockTypes.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_panel__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"], { - title: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["VisuallyHidden"], null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Blocks')) - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { - items: currentShownBlockTypes, - onSelect: onSelectBlockType, - onHover: onHover, - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Blocks'), - isDraggable: isDraggable - })), !!filteredBlockTypes.length && !!filteredBlockPatterns.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-inserter__quick-inserter-separator" - }), !!filteredBlockPatterns.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_panel__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"], { - title: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["VisuallyHidden"], null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Block Patterns')) - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-inserter__quick-inserter-patterns" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_patterns_list__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], { - shownPatterns: currentShownPatterns, - blockPatterns: filteredBlockPatterns, - onClickPattern: onSelectBlockPattern, - isDraggable: isDraggable - }))), showBlockDirectory && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter_menu_extension__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"].Slot, { - fillProps: { - onSelect: onSelectBlockType, - onHover, - filterValue, - hasItems, - rootClientId: destinationRootClientId - } - }, fills => { - if (fills.length) { - return fills; - } - - if (!hasItems) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_no_results__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"], null); - } - - return null; - })); -} - -/* harmony default export */ __webpack_exports__["a"] = (InserterSearchResults); - - -/***/ }), - -/***/ "Wy3j": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BorderRadiusControl; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/utils.js -/** - * WordPress dependencies - */ - -/** - * Gets the (non-undefined) item with the highest occurrence within an array - * Based in part on: https://stackoverflow.com/a/20762713 - * - * Undefined values are always sorted to the end by `sort`, so this function - * returns the first element, to always prioritize real values over undefined - * values. - * - * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description - * - * @param {Array} inputArray Array of items to check. - * @return {any} The item with the most occurrences. - */ - -function mode(inputArray) { - const arr = [...inputArray]; - return arr.sort((a, b) => inputArray.filter(v => v === b).length - inputArray.filter(v => v === a).length).shift(); -} -/** - * Returns the most common CSS unit in the radius values. - * Falls back to `px` as a default unit. - * - * @param {Object|string} values Radius values. - * @return {string} Most common CSS unit in values. Default: `px`. - */ - -function getAllUnit() { - let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (typeof values === 'string') { - const [, unit] = Object(external_wp_components_["__experimentalParseUnit"])(values); - return unit || 'px'; - } - - const allUnits = Object.values(values).map(value => { - const [, unit] = Object(external_wp_components_["__experimentalParseUnit"])(value); - return unit; - }); - return mode(allUnits) || 'px'; -} -/** - * Gets the 'all' input value and unit from values data. - * - * @param {Object|string} values Radius values. - * @return {string} A value + unit for the 'all' input. - */ - -function getAllValue() { - let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - /** - * Border radius support was originally a single pixel value. - * - * To maintain backwards compatibility treat this case as the all value. - */ - if (typeof values === 'string') { - return values; - } - - const parsedValues = Object.values(values).map(value => Object(external_wp_components_["__experimentalParseUnit"])(value)); - const allValues = parsedValues.map(value => value[0]); - const allUnits = parsedValues.map(value => value[1]); - const value = allValues.every(v => v === allValues[0]) ? allValues[0] : ''; - const unit = mode(allUnits); - const allValue = value === 0 || value ? `${value}${unit}` : null; - return allValue; -} -/** - * Checks to determine if values are mixed. - * - * @param {Object} values Radius values. - * @return {boolean} Whether values are mixed. - */ - -function hasMixedValues() { - let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const allValue = getAllValue(values); - const isMixed = isNaN(parseFloat(allValue)); - return isMixed; -} -/** - * Checks to determine if values are defined. - * - * @param {Object} values Radius values. - * @return {boolean} Whether values are mixed. - */ - -function hasDefinedValues(values) { - if (!values) { - return false; - } // A string value represents a shorthand value. - - - if (typeof values === 'string') { - return true; - } // An object represents longhand border radius values, if any are set - // flag values as being defined. - - - const filteredValues = Object.values(values).filter(value => { - return !!value || value === 0; - }); - return !!filteredValues.length; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/all-input-control.js - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function AllInputControl(_ref) { - let { - onChange, - values, - ...props - } = _ref; - const allValue = getAllValue(values); - const hasValues = hasDefinedValues(values); - const isMixed = hasValues && hasMixedValues(values); - const allPlaceholder = isMixed ? Object(external_wp_i18n_["__"])('Mixed') : null; - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], Object(esm_extends["a" /* default */])({}, props, { - "aria-label": Object(external_wp_i18n_["__"])('Border radius'), - disableUnits: isMixed, - isOnly: true, - value: allValue, - onChange: onChange, - placeholder: allPlaceholder - })); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/input-controls.js - - - -/** - * WordPress dependencies - */ - - -const CORNERS = { - topLeft: Object(external_wp_i18n_["__"])('Top left'), - topRight: Object(external_wp_i18n_["__"])('Top right'), - bottomLeft: Object(external_wp_i18n_["__"])('Bottom left'), - bottomRight: Object(external_wp_i18n_["__"])('Bottom right') -}; -function BoxInputControls(_ref) { - let { - onChange, - values: valuesProp, - ...props - } = _ref; - - const createHandleOnChange = corner => next => { - if (!onChange) { - return; - } - - onChange({ ...values, - [corner]: next ? next : undefined - }); - }; // For shorthand style & backwards compatibility, handle flat string value. - - - const values = typeof valuesProp !== 'string' ? valuesProp : { - topLeft: valuesProp, - topRight: valuesProp, - bottomLeft: valuesProp, - bottomRight: valuesProp - }; // Controls are wrapped in tooltips as visible labels aren't desired here. - - return Object(external_wp_element_["createElement"])("div", { - className: "components-border-radius-control__input-controls-wrapper" - }, Object.entries(CORNERS).map(_ref2 => { - let [key, label] = _ref2; - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], Object(esm_extends["a" /* default */])({}, props, { - key: key, - "aria-label": label, - value: values[key], - onChange: createHandleOnChange(key) - })); - })); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js -var library_link = __webpack_require__("Bpkj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js -var link_off = __webpack_require__("Mp0b"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/linked-button.js - - - -/** - * WordPress dependencies - */ - - - -function LinkedButton(_ref) { - let { - isLinked, - ...props - } = _ref; - const label = isLinked ? Object(external_wp_i18n_["__"])('Unlink Radii') : Object(external_wp_i18n_["__"])('Link Radii'); - return Object(external_wp_element_["createElement"])(external_wp_components_["Tooltip"], { - text: label - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, props, { - className: "component-border-radius-control__linked-button", - isPrimary: isLinked, - isSecondary: !isLinked, - isSmall: true, - icon: isLinked ? library_link["a" /* default */] : link_off["a" /* default */], - iconSize: 16, - "aria-label": label - }))); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js -var use_setting = __webpack_require__("v5LD"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - -const DEFAULT_VALUES = { - topLeft: null, - topRight: null, - bottomLeft: null, - bottomRight: null -}; -const MIN_BORDER_RADIUS_VALUE = 0; -const MAX_BORDER_RADIUS_VALUES = { - px: 100, - em: 20, - rem: 20 -}; -/** - * Control to display border radius options. - * - * @param {Object} props Component props. - * @param {Function} props.onChange Callback to handle onChange. - * @param {Object} props.values Border radius values. - * - * @return {WPElement} Custom border radius control. - */ - -function BorderRadiusControl(_ref) { - let { - onChange, - values - } = _ref; - const [isLinked, setIsLinked] = Object(external_wp_element_["useState"])(!hasDefinedValues(values) || !hasMixedValues(values)); - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(use_setting["a" /* default */])('spacing.units') || ['px', 'em', 'rem'] - }); - const unit = getAllUnit(values); - const unitConfig = units && units.find(item => item.value === unit); - const step = (unitConfig === null || unitConfig === void 0 ? void 0 : unitConfig.step) || 1; - const [allValue] = Object(external_wp_components_["__experimentalParseUnit"])(getAllValue(values)); - - const toggleLinked = () => setIsLinked(!isLinked); - - const handleSliderChange = next => { - onChange(next !== undefined ? `${next}${unit}` : undefined); - }; - - return Object(external_wp_element_["createElement"])("fieldset", { - className: "components-border-radius-control" - }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_i18n_["__"])('Radius')), Object(external_wp_element_["createElement"])("div", { - className: "components-border-radius-control__wrapper" - }, isLinked ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(AllInputControl, { - className: "components-border-radius-control__unit-control", - values: values, - min: MIN_BORDER_RADIUS_VALUE, - onChange: onChange, - unit: unit, - units: units - }), Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], { - className: "components-border-radius-control__range-control", - value: allValue, - min: MIN_BORDER_RADIUS_VALUE, - max: MAX_BORDER_RADIUS_VALUES[unit], - initialPosition: 0, - withInputField: false, - onChange: handleSliderChange, - step: step - })) : Object(external_wp_element_["createElement"])(BoxInputControls, { - min: MIN_BORDER_RADIUS_VALUE, - onChange: onChange, - values: values || DEFAULT_VALUES, - units: units - }), Object(external_wp_element_["createElement"])(LinkedButton, { - onClick: toggleLinked, - isLinked: isLinked - }))); -} - - -/***/ }), - -/***/ "XNw2": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const stretchFullWidth = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (stretchFullWidth); - - -/***/ }), - -/***/ "XgzB": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const chevronUp = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" -})); -/* harmony default export */ __webpack_exports__["a"] = (chevronUp); - - -/***/ }), - -/***/ "Xkls": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _react_spring_web__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("+DUQ"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("1CF3"); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_3__); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Simple reducer used to increment a counter. - * - * @param {number} state Previous counter value. - * @return {number} New state value. - */ - -const counterReducer = state => state + 1; - -const getAbsolutePosition = element => { - return { - top: element.offsetTop, - left: element.offsetLeft - }; -}; -/** - * Hook used to compute the styles required to move a div into a new position. - * - * The way this animation works is the following: - * - It first renders the element as if there was no animation. - * - It takes a snapshot of the position of the block to use it - * as a destination point for the animation. - * - It restores the element to the previous position using a CSS transform - * - It uses the "resetAnimation" flag to reset the animation - * from the beginning in order to animate to the new destination point. - * - * @param {Object} $1 Options - * @param {boolean} $1.isSelected Whether it's the current block or not. - * @param {boolean} $1.adjustScrolling Adjust the scroll position to the current block. - * @param {boolean} $1.enableAnimation Enable/Disable animation. - * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes. - */ - - -function useMovingAnimation(_ref) { - let { - isSelected, - adjustScrolling, - enableAnimation, - triggerAnimationOnChange - } = _ref; - const ref = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(); - const prefersReducedMotion = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["useReducedMotion"])() || !enableAnimation; - const [triggeredAnimation, triggerAnimation] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useReducer"])(counterReducer, 0); - const [finishedAnimation, endAnimation] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useReducer"])(counterReducer, 0); - const [transform, setTransform] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])({ - x: 0, - y: 0 - }); - const previous = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => ref.current ? getAbsolutePosition(ref.current) : null, [triggerAnimationOnChange]); // Calculate the previous position of the block relative to the viewport and - // return a function to maintain that position by scrolling. - - const preserveScrollPosition = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => { - if (!adjustScrolling || !ref.current) { - return () => {}; - } - - const scrollContainer = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_3__["getScrollContainer"])(ref.current); - - if (!scrollContainer) { - return () => {}; - } - - const prevRect = ref.current.getBoundingClientRect(); - return () => { - const blockRect = ref.current.getBoundingClientRect(); - const diff = blockRect.top - prevRect.top; - - if (diff) { - scrollContainer.scrollTop += diff; - } - }; - }, [triggerAnimationOnChange, adjustScrolling]); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useLayoutEffect"])(() => { - if (triggeredAnimation) { - endAnimation(); - } - }, [triggeredAnimation]); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useLayoutEffect"])(() => { - if (!previous) { - return; - } - - if (prefersReducedMotion) { - // if the animation is disabled and the scroll needs to be adjusted, - // just move directly to the final scroll position. - preserveScrollPosition(); - return; - } - - ref.current.style.transform = ''; - const destination = getAbsolutePosition(ref.current); - triggerAnimation(); - setTransform({ - x: Math.round(previous.left - destination.left), - y: Math.round(previous.top - destination.top) - }); - }, [triggerAnimationOnChange]); // Only called when either the x or y value changes. - - function onFrameChange(_ref2) { - let { - x, - y - } = _ref2; - - if (!ref.current) { - return; - } - - const isMoving = x === 0 && y === 0; - ref.current.style.transformOrigin = isMoving ? '' : 'center'; - ref.current.style.transform = isMoving ? '' : `translate3d(${x}px,${y}px,0)`; - ref.current.style.zIndex = !isSelected || isMoving ? '' : '1'; - preserveScrollPosition(); - } // Called for every frame computed by useSpring. - - - function onChange(_ref3) { - let { - value - } = _ref3; - let { - x, - y - } = value; - x = Math.round(x); - y = Math.round(y); - - if (x !== onChange.x || y !== onChange.y) { - onFrameChange({ - x, - y - }); - onChange.x = x; - onChange.y = y; - } - } - - onChange.x = 0; - onChange.y = 0; - Object(_react_spring_web__WEBPACK_IMPORTED_MODULE_0__["useSpring"])({ - from: { - x: transform.x, - y: transform.y - }, - to: { - x: 0, - y: 0 - }, - reset: triggeredAnimation !== finishedAnimation, - config: { - mass: 5, - tension: 2000, - friction: 200 - }, - immediate: prefersReducedMotion, - onChange - }); - return ref; -} - -/* harmony default export */ __webpack_exports__["a"] = (useMovingAnimation); - - -/***/ }), - -/***/ "YLtl": -/***/ (function(module, exports) { - -(function() { module.exports = window["lodash"]; }()); - -/***/ }), - -/***/ "YZt4": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockDefaultClassName; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * Returns the default class name if the block is a light block and it supports - * `className`. - * - * @param {string} clientId The block client ID. - * - * @return {string} The class name, e.g. `wp-block-paragraph`. - */ - -function useBlockDefaultClassName(clientId) { - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(select => { - const name = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]).getBlockName(clientId); - const blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockType"])(name); - const hasLightBlockWrapper = (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) > 1; - - if (!hasLightBlockWrapper) { - return; - } - - return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockDefaultClassName"])(name); - }, [clientId]); -} - - -/***/ }), - -/***/ "Z23Y": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["warning"]; }()); - -/***/ }), - -/***/ "ZAjO": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/draggable-chip.js -var draggable_chip = __webpack_require__("q3tz"); - -// EXTERNAL MODULE: external ["wp","dom"] -var external_wp_dom_ = __webpack_require__("1CF3"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js -/** - * WordPress dependencies - */ - - -const SCROLL_INACTIVE_DISTANCE_PX = 50; -const SCROLL_INTERVAL_MS = 25; -const PIXELS_PER_SECOND_PER_PERCENTAGE = 1000; -const VELOCITY_MULTIPLIER = PIXELS_PER_SECOND_PER_PERCENTAGE * (SCROLL_INTERVAL_MS / 1000); -/** - * React hook that scrolls the scroll container when a block is being dragged. - * - * @return {Function[]} `startScrolling`, `scrollOnDragOver`, `stopScrolling` - * functions to be called in `onDragStart`, `onDragOver` - * and `onDragEnd` events respectively. - */ - -function useScrollWhenDragging() { - const dragStartY = Object(external_wp_element_["useRef"])(null); - const velocityY = Object(external_wp_element_["useRef"])(null); - const scrollParentY = Object(external_wp_element_["useRef"])(null); - const scrollEditorInterval = Object(external_wp_element_["useRef"])(null); // Clear interval when unmounting. - - Object(external_wp_element_["useEffect"])(() => () => { - if (scrollEditorInterval.current) { - clearInterval(scrollEditorInterval.current); - scrollEditorInterval.current = null; - } - }, []); - const startScrolling = Object(external_wp_element_["useCallback"])(event => { - dragStartY.current = event.clientY; // Find nearest parent(s) to scroll. - - scrollParentY.current = Object(external_wp_dom_["getScrollContainer"])(event.target); - scrollEditorInterval.current = setInterval(() => { - if (scrollParentY.current && velocityY.current) { - const newTop = scrollParentY.current.scrollTop + velocityY.current; // Setting `behavior: 'smooth'` as a scroll property seems to hurt performance. - // Better to use a small scroll interval. - - scrollParentY.current.scroll({ - top: newTop - }); - } - }, SCROLL_INTERVAL_MS); - }, []); - const scrollOnDragOver = Object(external_wp_element_["useCallback"])(event => { - if (!scrollParentY.current) { - return; - } - - const scrollParentHeight = scrollParentY.current.offsetHeight; - const offsetDragStartPosition = dragStartY.current - scrollParentY.current.offsetTop; - const offsetDragPosition = event.clientY - scrollParentY.current.offsetTop; - - if (event.clientY > offsetDragStartPosition) { - // User is dragging downwards. - const moveableDistance = Math.max(scrollParentHeight - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); - const dragDistance = Math.max(offsetDragPosition - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); - const distancePercentage = dragDistance / moveableDistance; - velocityY.current = VELOCITY_MULTIPLIER * distancePercentage; - } else if (event.clientY < offsetDragStartPosition) { - // User is dragging upwards. - const moveableDistance = Math.max(offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); - const dragDistance = Math.max(offsetDragStartPosition - offsetDragPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); - const distancePercentage = dragDistance / moveableDistance; - velocityY.current = -VELOCITY_MULTIPLIER * distancePercentage; - } else { - velocityY.current = 0; - } - }, []); - - const stopScrolling = () => { - dragStartY.current = null; - scrollParentY.current = null; - - if (scrollEditorInterval.current) { - clearInterval(scrollEditorInterval.current); - scrollEditorInterval.current = null; - } - }; - - return [startScrolling, scrollOnDragOver, stopScrolling]; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - -const BlockDraggable = _ref => { - let { - children, - clientIds, - cloneClassname, - onDragStart, - onDragEnd - } = _ref; - const { - srcRootClientId, - isDraggable, - icon - } = Object(external_wp_data_["useSelect"])(select => { - var _getBlockType; - - const { - getBlockRootClientId, - getTemplateLock, - getBlockName - } = select(store["a" /* store */]); - const rootClientId = getBlockRootClientId(clientIds[0]); - const templateLock = rootClientId ? getTemplateLock(rootClientId) : null; - const blockName = getBlockName(clientIds[0]); - return { - srcRootClientId: rootClientId, - isDraggable: 'all' !== templateLock, - icon: (_getBlockType = Object(external_wp_blocks_["getBlockType"])(blockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon - }; - }, [clientIds]); - const isDragging = Object(external_wp_element_["useRef"])(false); - const [startScrolling, scrollOnDragOver, stopScrolling] = useScrollWhenDragging(); - const { - startDraggingBlocks, - stopDraggingBlocks - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); // Stop dragging blocks if the block draggable is unmounted - - Object(external_wp_element_["useEffect"])(() => { - return () => { - if (isDragging.current) { - stopDraggingBlocks(); - } - }; - }, []); - - if (!isDraggable) { - return children({ - isDraggable: false - }); - } - - const transferData = { - type: 'block', - srcClientIds: clientIds, - srcRootClientId - }; - return Object(external_wp_element_["createElement"])(external_wp_components_["Draggable"], { - cloneClassname: cloneClassname, - __experimentalTransferDataType: "wp-blocks", - transferData: transferData, - onDragStart: event => { - startDraggingBlocks(clientIds); - isDragging.current = true; - startScrolling(event); - - if (onDragStart) { - onDragStart(); - } - }, - onDragOver: scrollOnDragOver, - onDragEnd: () => { - stopDraggingBlocks(); - isDragging.current = false; - stopScrolling(); - - if (onDragEnd) { - onDragEnd(); - } - }, - __experimentalDragComponent: Object(external_wp_element_["createElement"])(draggable_chip["a" /* default */], { - count: clientIds.length, - icon: icon - }) - }, _ref2 => { - let { - onDraggableStart, - onDraggableEnd - } = _ref2; - return children({ - draggable: true, - onDragStart: onDraggableStart, - onDragEnd: onDraggableEnd - }); - }); + ]; }; -/* harmony default export */ var block_draggable = __webpack_exports__["a"] = (BlockDraggable); +module.exports = computedStyle; /***/ }), -/***/ "Zzu2": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-horizontal.js - - -/** - * WordPress dependencies - */ - -const moreHorizontal = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" -})); -/* harmony default export */ var more_horizontal = (moreHorizontal); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/warning/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -function Warning(_ref) { - let { - className, - actions, - children, - secondaryActions - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - className: classnames_default()(className, 'block-editor-warning') - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-warning__contents" - }, Object(external_wp_element_["createElement"])("p", { - className: "block-editor-warning__message" - }, children), (external_wp_element_["Children"].count(actions) > 0 || secondaryActions) && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-warning__actions" - }, external_wp_element_["Children"].count(actions) > 0 && external_wp_element_["Children"].map(actions, (action, i) => Object(external_wp_element_["createElement"])("span", { - key: i, - className: "block-editor-warning__action" - }, action)), secondaryActions && Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { - className: "block-editor-warning__secondary", - icon: more_horizontal, - label: Object(external_wp_i18n_["__"])('More options'), - popoverProps: { - position: 'bottom left', - className: 'block-editor-warning__dropdown' - }, - noIcons: true - }, () => Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, secondaryActions.map((item, pos) => Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: item.onClick, - key: pos - }, item.title))))))); -} -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md - */ - - -/* harmony default export */ var warning = __webpack_exports__["a"] = (Warning); - - -/***/ }), - -/***/ "abaT": -/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony default export */ __webpack_exports__["a"] = (function(e,f){var a={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 d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u { - if (definedColor) { - const colorObj = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(colors, { - slug: definedColor - }); - - if (colorObj) { - return colorObj; - } - } - - return { - color: customColor - }; -}; -/** - * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined. - * - * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. - * @param {?string} colorValue A string containing the color value. - * - * @return {?Object} Color object included in the colors array whose color property equals colorValue. - * Returns undefined if no color object matches this requirement. - */ - -const getColorObjectByColorValue = (colors, colorValue) => { - return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(colors, { - color: colorValue - }); -}; -/** - * Returns a class based on the context a color is being used and its slug. - * - * @param {string} colorContextName Context/place where color is being used e.g: background, text etc... - * @param {string} colorSlug Slug of the color. - * - * @return {?string} String with the class corresponding to the color in the provided context. - * Returns undefined if either colorContextName or colorSlug are not provided. - */ - -function getColorClassName(colorContextName, colorSlug) { - if (!colorContextName || !colorSlug) { - return undefined; - } - - return `has-${Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(colorSlug)}-${colorContextName}`; -} -/** - * Given an array of color objects and a color value returns the color value of the most readable color in the array. - * - * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. - * @param {?string} colorValue A string containing the color value. - * - * @return {string} String with the color value of the most readable color. - */ - -function getMostReadableColor(colors, colorValue) { - const colordColor = Object(colord__WEBPACK_IMPORTED_MODULE_1__[/* colord */ "a"])(colorValue); - return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["maxBy"])(colors, _ref => { - let { - color - } = _ref; - return colordColor.contrast(color); - }).color; -} - - -/***/ }), - -/***/ "beZb": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const stretchWide = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (stretchWide); - - -/***/ }), - -/***/ "btIw": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "-2 -2 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z" -})); -/* harmony default export */ __webpack_exports__["a"] = (keyboardReturn); - - -/***/ }), - -/***/ "c1Zz": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlockSupportToolsPanel; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("BhPs"); -/* harmony import */ var _hooks_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("715p"); - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function BlockSupportToolsPanel(_ref) { - let { - children, - group, - label - } = _ref; - const { - attributes, - clientIds, - panelId - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => { - const { - getBlockAttributes, - getMultiSelectedBlockClientIds, - getSelectedBlockClientId, - hasMultiSelection - } = select(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); // When we currently have a multi-selection, the value returned from - // `getSelectedBlockClientId()` is `null`. When a `null` value is used - // for the `panelId`, a `ToolsPanel` will still allow panel items to - // register themselves despite their panelIds not matching. - - const selectedBlockClientId = getSelectedBlockClientId(); - - if (hasMultiSelection()) { - const selectedBlockClientIds = getMultiSelectedBlockClientIds(); - const selectedBlockAttributes = selectedBlockClientIds.reduce((blockAttributes, blockId) => { - blockAttributes[blockId] = getBlockAttributes(blockId); - return blockAttributes; - }, {}); - return { - panelId: selectedBlockClientId, - clientIds: selectedBlockClientIds, - attributes: selectedBlockAttributes - }; - } - - return { - panelId: selectedBlockClientId, - clientIds: [selectedBlockClientId], - attributes: { - [selectedBlockClientId]: getBlockAttributes(selectedBlockClientId) - } - }; - }, []); - const { - updateBlockAttributes - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_3__[/* store */ "a"]); - - const resetAll = function () { - let resetFilters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - const newAttributes = {}; - clientIds.forEach(clientId => { - const { - style - } = attributes[clientId]; - let newBlockAttributes = { - style - }; - resetFilters.forEach(resetFilter => { - newBlockAttributes = { ...newBlockAttributes, - ...resetFilter(newBlockAttributes) - }; - }); // Enforce a cleaned style object. - - newBlockAttributes = { ...newBlockAttributes, - style: Object(_hooks_utils__WEBPACK_IMPORTED_MODULE_4__[/* cleanEmptyObject */ "a"])(newBlockAttributes.style) - }; - newAttributes[clientId] = newBlockAttributes; - }); - updateBlockAttributes(clientIds, newAttributes, true); - }; - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["__experimentalToolsPanel"], { - className: `${group}-block-support-panel`, - label: label, - resetAll: resetAll, - key: panelId, - panelId: panelId, - hasInnerWrapper: true, - shouldRenderPlaceholderItems: true // Required to maintain fills ordering. - - }, children); -} - - -/***/ }), - -/***/ "cDcd": -/***/ (function(module, exports) { - -(function() { module.exports = window["React"]; }()); - -/***/ }), - -/***/ "cDhi": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlockRefs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return BlockRefsProvider; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); - - -/** - * WordPress dependencies - */ - -const BlockRefs = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(); -function BlockRefsProvider(_ref) { - let { - children - } = _ref; - const value = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => ({ - refs: new Map(), - callbacks: new Map() - }), []); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BlockRefs.Provider, { - value: value - }, children); -} - - -/***/ }), - -/***/ "cGtP": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const search = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z" -})); -/* harmony default export */ __webpack_exports__["a"] = (search); - - -/***/ }), - -/***/ "cjQ8": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const arrowLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z" -})); -/* harmony default export */ __webpack_exports__["a"] = (arrowLeft); - - -/***/ }), - -/***/ "dchM": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColorGradientSettingsDropdown; }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("hMaJ"); - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function ColorGradientSettingsDropdown(_ref) { - let { - colors, - gradients, - disableCustomColors, - disableCustomGradients, - __experimentalHasMultipleOrigins, - __experimentalIsRenderedInSidebar, - enableAlpha, - settings - } = _ref; - let dropdownPosition; - - if (__experimentalIsRenderedInSidebar) { - dropdownPosition = 'bottom left'; - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["__experimentalItemGroup"], { - isBordered: true, - isSeparated: true, - className: "block-editor-panel-color-gradient-settings__item-group" - }, settings.map((setting, index) => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Dropdown"], { - key: index, - position: dropdownPosition, - className: "block-editor-panel-color-gradient-settings__dropdown", - contentClassName: "block-editor-panel-color-gradient-settings__dropdown-content", - renderToggle: _ref2 => { - var _setting$gradientValu; - - let { - isOpen, - onToggle - } = _ref2; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["__experimentalItem"], { - onClick: onToggle, - className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('block-editor-panel-color-gradient-settings__item', { - 'is-open': isOpen - }) - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["__experimentalHStack"], { - justify: "flex-start" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["ColorIndicator"], { - className: "block-editor-panel-color-gradient-settings__color-indicator", - colorValue: (_setting$gradientValu = setting.gradientValue) !== null && _setting$gradientValu !== void 0 ? _setting$gradientValu : setting.colorValue - }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["FlexItem"], null, setting.label))); - }, - renderContent: () => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_control__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - showTitle: false, - colors, - gradients, - disableCustomColors, - disableCustomGradients, - __experimentalHasMultipleOrigins, - __experimentalIsRenderedInSidebar, - enableAlpha - }, setting)) - }))); -} - - -/***/ }), - -/***/ "dfZa": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export Animated */ -/* unused harmony export AnimatedArray */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimatedObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return AnimatedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return AnimatedValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return createHost; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getAnimated; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getAnimatedType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getPayload; }); -/* unused harmony export isAnimated */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return setAnimated; }); -/* harmony import */ var _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("nEW0"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("cDcd"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); - - - - -const $node = Symbol.for('Animated:node'); -const isAnimated = value => !!value && value[$node] === value; -const getAnimated = owner => owner && owner[$node]; -const setAnimated = (owner, node) => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* defineHidden */ "h"])(owner, $node, node); -const getPayload = owner => owner && owner[$node] && owner[$node].getPayload(); -class Animated { - constructor() { - this.payload = void 0; - setAnimated(this, this); - } - - getPayload() { - return this.payload || []; - } - -} - -class AnimatedValue extends Animated { - constructor(_value) { - super(); - this.done = true; - this.elapsedTime = void 0; - this.lastPosition = void 0; - this.lastVelocity = void 0; - this.v0 = void 0; - this.durationProgress = 0; - this._value = _value; - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].num(this._value)) { - this.lastPosition = this._value; - } - } - - static create(value) { - return new AnimatedValue(value); - } - - getPayload() { - return [this]; - } - - getValue() { - return this._value; - } - - setValue(value, step) { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].num(value)) { - this.lastPosition = value; - - if (step) { - value = Math.round(value / step) * step; - - if (this.done) { - this.lastPosition = value; - } - } - } - - if (this._value === value) { - return false; - } - - this._value = value; - return true; - } - - reset() { - const { - done - } = this; - this.done = false; - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].num(this._value)) { - this.elapsedTime = 0; - this.durationProgress = 0; - this.lastPosition = this._value; - if (done) this.lastVelocity = null; - this.v0 = null; - } - } - -} - -class AnimatedString extends AnimatedValue { - constructor(value) { - super(0); - this._string = null; - this._toString = void 0; - this._toString = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* createInterpolator */ "f"])({ - output: [value, value] - }); - } - - static create(value) { - return new AnimatedString(value); - } - - getValue() { - let value = this._string; - return value == null ? this._string = this._toString(this._value) : value; - } - - setValue(value) { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].str(value)) { - if (value == this._string) { - return false; - } - - this._string = value; - this._value = 1; - } else if (super.setValue(value)) { - this._string = null; - } else { - return false; - } - - return true; - } - - reset(goal) { - if (goal) { - this._toString = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* createInterpolator */ "f"])({ - output: [this.getValue(), goal] - }); - } - - this._value = 0; - super.reset(); - } - -} - -const TreeContext = { - dependencies: null -}; - -class AnimatedObject extends Animated { - constructor(source) { - super(); - this.source = source; - this.setValue(source); - } - - getValue(animated) { - const values = {}; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(this.source, (source, key) => { - if (isAnimated(source)) { - values[key] = source.getValue(animated); - } else if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(source)) { - values[key] = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(source); - } else if (!animated) { - values[key] = source; - } - }); - return values; - } - - setValue(source) { - this.source = source; - this.payload = this._makePayload(source); - } - - reset() { - if (this.payload) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(this.payload, node => node.reset()); - } - } - - _makePayload(source) { - if (source) { - const payload = new Set(); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(source, this._addToPayload, payload); - return Array.from(payload); - } - } - - _addToPayload(source) { - if (TreeContext.dependencies && Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(source)) { - TreeContext.dependencies.add(source); - } - - const payload = getPayload(source); - - if (payload) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(payload, node => this.add(node)); - } - } - -} - -class AnimatedArray extends AnimatedObject { - constructor(source) { - super(source); - } - - static create(source) { - return new AnimatedArray(source); - } - - getValue() { - return this.source.map(node => node.getValue()); - } - - setValue(source) { - const payload = this.getPayload(); - - if (source.length == payload.length) { - return payload.map((node, i) => node.setValue(source[i])).some(Boolean); - } - - super.setValue(source.map(makeAnimated)); - return true; - } - -} - -function makeAnimated(value) { - const nodeType = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isAnimatedString */ "t"])(value) ? AnimatedString : AnimatedValue; - return nodeType.create(value); -} - -function getAnimatedType(value) { - const parentNode = getAnimated(value); - return parentNode ? parentNode.constructor : _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(value) ? AnimatedArray : Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isAnimatedString */ "t"])(value) ? AnimatedString : AnimatedValue; -} - -function _extends() { - _extends = Object.assign || 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 target; - }; - - return _extends.apply(this, arguments); -} - -const withAnimated = (Component, host) => { - const hasInstance = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(Component) || Component.prototype && Component.prototype.isReactComponent; - return Object(react__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])((givenProps, givenRef) => { - const instanceRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); - const ref = hasInstance && Object(react__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(value => { - instanceRef.current = updateRef(givenRef, value); - }, [givenRef]); - const [props, deps] = getAnimatedState(givenProps, host); - const forceUpdate = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useForceUpdate */ "z"])(); - - const callback = () => { - const instance = instanceRef.current; - - if (hasInstance && !instance) { - return; - } - - const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false; - - if (didUpdate === false) { - forceUpdate(); - } - }; - - const observer = new PropsObserver(callback, deps); - const observerRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => { - const lastObserver = observerRef.current; - observerRef.current = observer; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(deps, dep => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* addFluidObserver */ "c"])(dep, observer)); - - if (lastObserver) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(lastObserver.deps, dep => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* removeFluidObserver */ "x"])(dep, lastObserver)); - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].cancel(lastObserver.update); - } - }); - Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(callback, []); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useOnce */ "C"])(() => () => { - const observer = observerRef.current; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(observer.deps, dep => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* removeFluidObserver */ "x"])(dep, observer)); - }); - const usedProps = host.getComponentProps(props.getValue()); - return react__WEBPACK_IMPORTED_MODULE_1__["createElement"](Component, _extends({}, usedProps, { - ref: ref - })); - }); -}; - -class PropsObserver { - constructor(update, deps) { - this.update = update; - this.deps = deps; - } - - eventObserved(event) { - if (event.type == 'change') { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].write(this.update); - } - } - -} - -function getAnimatedState(props, host) { - const dependencies = new Set(); - TreeContext.dependencies = dependencies; - if (props.style) props = _extends({}, props, { - style: host.createAnimatedStyle(props.style) - }); - props = new AnimatedObject(props); - TreeContext.dependencies = null; - return [props, dependencies]; -} - -function updateRef(ref, value) { - if (ref) { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(ref)) ref(value);else ref.current = value; - } - - return value; -} - -const cacheKey = Symbol.for('AnimatedComponent'); -const createHost = (components, { - applyAnimatedValues: _applyAnimatedValues = () => false, - createAnimatedStyle: _createAnimatedStyle = style => new AnimatedObject(style), - getComponentProps: _getComponentProps = props => props -} = {}) => { - const hostConfig = { - applyAnimatedValues: _applyAnimatedValues, - createAnimatedStyle: _createAnimatedStyle, - getComponentProps: _getComponentProps - }; - - const animated = Component => { - const displayName = getDisplayName(Component) || 'Anonymous'; - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].str(Component)) { - Component = animated[Component] || (animated[Component] = withAnimated(Component, hostConfig)); - } else { - Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig)); - } - - Component.displayName = `Animated(${displayName})`; - return Component; - }; - - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(components, (Component, key) => { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(components)) { - key = getDisplayName(Component); - } - - animated[key] = animated(Component); - }); - return { - animated - }; -}; - -const getDisplayName = arg => _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].str(arg) ? arg : arg && _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].str(arg.displayName) ? arg.displayName : _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(arg) && arg.name || null; - - - - -/***/ }), - -/***/ "eGrx": -/***/ (function(module, exports) { - -var traverse = module.exports = function (obj) { - return new Traverse(obj); -}; - -function Traverse (obj) { - this.value = obj; -} - -Traverse.prototype.get = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!node || !hasOwnProperty.call(node, key)) { - node = undefined; - break; - } - node = node[key]; - } - return node; -}; - -Traverse.prototype.has = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!node || !hasOwnProperty.call(node, key)) { - return false; - } - node = node[key]; - } - return true; -}; - -Traverse.prototype.set = function (ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i ++) { - var key = ps[i]; - if (!hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; -}; - -Traverse.prototype.map = function (cb) { - return walk(this.value, cb, true); -}; - -Traverse.prototype.forEach = function (cb) { - this.value = walk(this.value, cb, false); - return this.value; -}; - -Traverse.prototype.reduce = function (cb, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function (x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; -}; - -Traverse.prototype.paths = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.path); - }); - return acc; -}; - -Traverse.prototype.nodes = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.node); - }); - return acc; -}; - -Traverse.prototype.clone = function () { - var parents = [], nodes = []; - - return (function clone (src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - - if (typeof src === 'object' && src !== null) { - var dst = copy(src); - - parents.push(src); - nodes.push(dst); - - forEach(objectKeys(src), function (key) { - dst[key] = clone(src[key]); - }); - - parents.pop(); - nodes.pop(); - return dst; - } - else { - return src; - } - })(this.value); -}; - -function walk (root, cb, immutable) { - var path = []; - var parents = []; - var alive = true; - - return (function walker (node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - - var keepGoing = true; - - var state = { - node : node, - node_ : node_, - path : [].concat(path), - parent : parents[parents.length - 1], - parents : parents, - key : path.slice(-1)[0], - isRoot : path.length === 0, - level : path.length, - circular : null, - update : function (x, stopHere) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - if (stopHere) keepGoing = false; - }, - 'delete' : function (stopHere) { - delete state.parent.node[state.key]; - if (stopHere) keepGoing = false; - }, - remove : function (stopHere) { - if (isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } - else { - delete state.parent.node[state.key]; - } - if (stopHere) keepGoing = false; - }, - keys : null, - before : function (f) { modifiers.before = f }, - after : function (f) { modifiers.after = f }, - pre : function (f) { modifiers.pre = f }, - post : function (f) { modifiers.post = f }, - stop : function () { alive = false }, - block : function () { keepGoing = false } - }; - - if (!alive) return state; - - function updateState() { - if (typeof state.node === 'object' && state.node !== null) { - if (!state.keys || state.node_ !== state.node) { - state.keys = objectKeys(state.node) - } - - state.isLeaf = state.keys.length == 0; - - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } - else { - state.isLeaf = true; - state.keys = null; - } - - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - } - - updateState(); - - // use return values to update if defined - var ret = cb.call(state, state.node); - if (ret !== undefined && state.update) state.update(ret); - - if (modifiers.before) modifiers.before.call(state, state.node); - - if (!keepGoing) return state; - - if (typeof state.node == 'object' - && state.node !== null && !state.circular) { - parents.push(state); - - updateState(); - - forEach(state.keys, function (key, i) { - path.push(key); - - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - - var child = walker(state.node[key]); - if (immutable && hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - - child.isLast = i == state.keys.length - 1; - child.isFirst = i == 0; - - if (modifiers.post) modifiers.post.call(state, child); - - path.pop(); - }); - parents.pop(); - } - - if (modifiers.after) modifiers.after.call(state, state.node); - - return state; - })(root).node; -} - -function copy (src) { - if (typeof src === 'object' && src !== null) { - var dst; - - if (isArray(src)) { - dst = []; - } - else if (isDate(src)) { - dst = new Date(src.getTime ? src.getTime() : src); - } - else if (isRegExp(src)) { - dst = new RegExp(src); - } - else if (isError(src)) { - dst = { message: src.message }; - } - else if (isBoolean(src)) { - dst = new Boolean(src); - } - else if (isNumber(src)) { - dst = new Number(src); - } - else if (isString(src)) { - dst = new String(src); - } - else if (Object.create && Object.getPrototypeOf) { - dst = Object.create(Object.getPrototypeOf(src)); - } - else if (src.constructor === Object) { - dst = {}; - } - else { - var proto = - (src.constructor && src.constructor.prototype) - || src.__proto__ - || {} - ; - var T = function () {}; - T.prototype = proto; - dst = new T; - } - - forEach(objectKeys(src), function (key) { - dst[key] = src[key]; - }); - return dst; - } - else return src; -} - -var objectKeys = Object.keys || function keys (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -function toS (obj) { return Object.prototype.toString.call(obj) } -function isDate (obj) { return toS(obj) === '[object Date]' } -function isRegExp (obj) { return toS(obj) === '[object RegExp]' } -function isError (obj) { return toS(obj) === '[object Error]' } -function isBoolean (obj) { return toS(obj) === '[object Boolean]' } -function isNumber (obj) { return toS(obj) === '[object Number]' } -function isString (obj) { return toS(obj) === '[object String]' } - -var isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -forEach(objectKeys(Traverse.prototype), function (key) { - traverse[key] = function (obj) { - var args = [].slice.call(arguments, 1); - var t = new Traverse(obj); - return t[key].apply(t, args); - }; -}); - -var hasOwnProperty = Object.hasOwnProperty || function (obj, key) { - return key in obj; -}; - - -/***/ }), - -/***/ "ez49": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule isEventSupported - */ - - - -var ExecutionEnvironment = __webpack_require__("o97j"); - -var useHasFeature; -if (ExecutionEnvironment.canUseDOM) { - useHasFeature = - document.implementation && - document.implementation.hasFeature && - // always returns true in newer browsers as per the standard. - // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature - document.implementation.hasFeature('', '') !== true; -} - -/** - * Checks if an event is supported in the current execution environment. - * - * NOTE: This will not work correctly for non-generic events such as `change`, - * `reset`, `load`, `error`, and `select`. - * - * Borrows from Modernizr. - * - * @param {string} eventNameSuffix Event name, e.g. "click". - * @param {?boolean} capture Check if the capture phase is supported. - * @return {boolean} True if the event is supported. - * @internal - * @license Modernizr 3.0.0pre (Custom Build) | MIT - */ -function isEventSupported(eventNameSuffix, capture) { - if (!ExecutionEnvironment.canUseDOM || - capture && !('addEventListener' in document)) { - return false; - } - - var eventName = 'on' + eventNameSuffix; - var isSupported = eventName in document; - - if (!isSupported) { - var element = document.createElement('div'); - element.setAttribute(eventName, 'return;'); - isSupported = typeof element[eventName] === 'function'; - } - - if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { - // This is the only way to test support for the `wheel` event in IE9+. - isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); - } - - return isSupported; -} - -module.exports = isEventSupported; - - -/***/ }), - -/***/ "f8JO": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlockTitle; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _use_block_display_information__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("wC17"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("BhPs"); -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -/** - * Renders the block's configured title as a string, or empty if the title - * cannot be determined. - * - * @example - * - * ```jsx - * - * ``` - * - * @param {Object} props - * @param {string} props.clientId Client ID of block. - * - * @return {?string} Block title. - */ - -function BlockTitle(_ref) { - let { - clientId - } = _ref; - const { - attributes, - name, - reusableBlockTitle - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => { - if (!clientId) { - return {}; - } - - const { - getBlockName, - getBlockAttributes, - __experimentalGetReusableBlockTitle - } = select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - const blockName = getBlockName(clientId); - - if (!blockName) { - return {}; - } - - const isReusable = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["isReusableBlock"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["getBlockType"])(blockName)); - return { - attributes: getBlockAttributes(clientId), - name: blockName, - reusableBlockTitle: isReusable && __experimentalGetReusableBlockTitle(getBlockAttributes(clientId).ref) - }; - }, [clientId]); - const blockInformation = Object(_use_block_display_information__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(clientId); - if (!name || !blockInformation) return null; - const blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["getBlockType"])(name); - const blockLabel = blockType ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["__experimentalGetBlockLabel"])(blockType, attributes) : null; - const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current - // label context. If the label is defined we prioritize it over possible - // possible block variation title match. - - if (label && label !== blockType.title) { - return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["truncate"])(label, { - length: 35 - }); - } - - return blockInformation.title; -} - - -/***/ }), - -/***/ "fHnH": -/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export Colord */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return w; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return k; }); -/* unused harmony export getFormat */ -/* unused harmony export random */ -var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^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,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({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(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; - - -/***/ }), - -/***/ "fOYa": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockFormatControls; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/groups.js -/** - * WordPress dependencies - */ - -const BlockControlsDefault = Object(external_wp_components_["createSlotFill"])('BlockControls'); -const BlockControlsBlock = Object(external_wp_components_["createSlotFill"])('BlockControlsBlock'); -const BlockControlsInline = Object(external_wp_components_["createSlotFill"])('BlockFormatControls'); -const BlockControlsOther = Object(external_wp_components_["createSlotFill"])('BlockControlsOther'); -const BlockControlsParent = Object(external_wp_components_["createSlotFill"])('BlockControlsParent'); -const groups = { - default: BlockControlsDefault, - block: BlockControlsBlock, - inline: BlockControlsInline, - other: BlockControlsOther, - parent: BlockControlsParent -}; -/* harmony default export */ var block_controls_groups = (groups); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js -var context = __webpack_require__("ur0x"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-display-block-controls/index.js -var use_display_block_controls = __webpack_require__("HgtZ"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/hook.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -function useBlockControlsFill(group, shareWithChildBlocks) { - const isDisplayed = Object(use_display_block_controls["a" /* default */])(); - const { - clientId - } = Object(context["c" /* useBlockEditContext */])(); - const isParentDisplayed = Object(external_wp_data_["useSelect"])(select => { - const { - getBlockName, - hasSelectedInnerBlock - } = select(store["a" /* store */]); - const { - hasBlockSupport - } = select(external_wp_blocks_["store"]); - return shareWithChildBlocks && hasBlockSupport(getBlockName(clientId), '__experimentalExposeControlsToChildren', false) && hasSelectedInnerBlock(clientId); - }, [shareWithChildBlocks, clientId]); - - if (isDisplayed) { - var _groups$group; - - return (_groups$group = block_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Fill; - } - - if (isParentDisplayed) { - return block_controls_groups.parent.Fill; - } - - return null; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/fill.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function BlockControlsFill(_ref) { - let { - group = 'default', - controls, - children, - __experimentalShareWithChildBlocks = false - } = _ref; - const Fill = useBlockControlsFill(group, __experimentalShareWithChildBlocks); - - if (!Fill) { - return null; - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalStyleProvider"], { - document: document - }, Object(external_wp_element_["createElement"])(Fill, null, fillProps => { - // Children passed to BlockControlsFill will not have access to any - // React Context whose Provider is part of the BlockControlsSlot tree. - // So we re-create the Provider in this subtree. - const value = !Object(external_lodash_["isEmpty"])(fillProps) ? fillProps : null; - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolbarContext"].Provider, { - value: value - }, group === 'default' && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], { - controls: controls - }), children); - })); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/slot.js - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function BlockControlsSlot(_ref) { - let { - group = 'default', - ...props - } = _ref; - const accessibleToolbarState = Object(external_wp_element_["useContext"])(external_wp_components_["__experimentalToolbarContext"]); - const Slot = block_controls_groups[group].Slot; - const slot = Object(external_wp_components_["__experimentalUseSlot"])(Slot.__unstableName); - const hasFills = Boolean(slot.fills && slot.fills.length); - - if (!hasFills) { - return null; - } - - if (group === 'default') { - return Object(external_wp_element_["createElement"])(Slot, Object(esm_extends["a" /* default */])({}, props, { - bubblesVirtually: true, - fillProps: accessibleToolbarState - })); - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(Slot, Object(esm_extends["a" /* default */])({}, props, { - bubblesVirtually: true, - fillProps: accessibleToolbarState - }))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js - - - -/** - * Internal dependencies - */ - - -const BlockControls = BlockControlsFill; -BlockControls.Slot = BlockControlsSlot; // This is just here for backward compatibility - -const BlockFormatControls = props => { - return Object(external_wp_element_["createElement"])(BlockControlsFill, Object(esm_extends["a" /* default */])({ - group: "inline" - }, props)); -}; - -BlockFormatControls.Slot = props => { - return Object(external_wp_element_["createElement"])(BlockControlsSlot, Object(esm_extends["a" /* default */])({ - group: "inline" - }, props)); -}; - -/* harmony default export */ var block_controls = __webpack_exports__["b"] = (BlockControls); - - -/***/ }), - -/***/ "fPbg": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const alignLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z" -})); -/* harmony default export */ __webpack_exports__["a"] = (alignLeft); - - -/***/ }), - -/***/ "faye": -/***/ (function(module, exports) { - -(function() { module.exports = window["ReactDOM"]; }()); - -/***/ }), - -/***/ "felP": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useEventHandlers; }); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1CF3"); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("RxS6"); -/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("BhPs"); -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -/** - * Adds block behaviour: - * - Removes the block on BACKSPACE. - * - Inserts a default block on ENTER. - * - Disables dragging of block contents. - * - * @param {string} clientId Block client ID. - */ - -function useEventHandlers(clientId) { - const isSelected = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]).isBlockSelected(clientId), [clientId]); - const { - getBlockRootClientId, - getBlockIndex - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - const { - insertDefaultBlock, - removeBlock - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["useRefEffect"])(node => { - if (!isSelected) { - return; - } - /** - * Interprets keydown event intent to remove or insert after block if - * key event occurs on wrapper node. This can occur when the block has - * no text fields of its own, particularly after initial insertion, to - * allow for easy deletion and continuous writing flow to add additional - * content. - * - * @param {KeyboardEvent} event Keydown event. - */ - - - function onKeyDown(event) { - const { - keyCode, - target - } = event; - - if (keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["ENTER"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["BACKSPACE"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["DELETE"]) { - return; - } - - if (target !== node || Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_0__["isTextField"])(target)) { - return; - } - - event.preventDefault(); - - if (keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["ENTER"]) { - insertDefaultBlock({}, getBlockRootClientId(clientId), getBlockIndex(clientId) + 1); - } else { - removeBlock(clientId); - } - } - /** - * Prevents default dragging behavior within a block. To do: we must - * handle this in the future and clean up the drag target. - * - * @param {DragEvent} event Drag event. - */ - - - function onDragStart(event) { - event.preventDefault(); - } - - node.addEventListener('keydown', onKeyDown); - node.addEventListener('dragstart', onDragStart); - return () => { - node.removeEventListener('keydown', onKeyDown); - node.removeEventListener('dragstart', onDragStart); - }; - }, [clientId, isSelected, getBlockRootClientId, getBlockIndex, insertDefaultBlock, removeBlock]); -} - - -/***/ }), - -/***/ "g56x": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["hooks"]; }()); - -/***/ }), - -/***/ "gdqT": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["a11y"]; }()); - -/***/ }), - -/***/ "hF7m": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["keyboardShortcuts"]; }()); - -/***/ }), - -/***/ "hHnB": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _block_selection_clearer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("zQI6"); -/* harmony import */ var _writing_flow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("TVFh"); - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -const BODY_CLASS_NAME = 'editor-styles-wrapper'; -const BLOCK_PREFIX = 'wp-block'; -/** - * Clones stylesheets targetting the editor canvas to the given document. A - * stylesheet is considered targetting the editor a canvas if it contains the - * `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors. - * - * Ideally, this hook should be removed in the future and styles should be added - * explicitly as editor styles. - * - * @param {Document} doc The document to append cloned stylesheets to. - */ - -function styleSheetsCompat(doc) { - // Search the document for stylesheets targetting the editor canvas. - Array.from(document.styleSheets).forEach(styleSheet => { - try { - // May fail for external styles. - // eslint-disable-next-line no-unused-expressions - styleSheet.cssRules; - } catch (e) { - return; - } - - const { - ownerNode, - cssRules - } = styleSheet; - - if (!cssRules) { - return; - } // Generally, ignore inline styles. We add inline styles belonging to a - // stylesheet later, which may or may not match the selectors. - - - if (ownerNode.tagName !== 'LINK') { - return; - } // Don't try to add the reset styles, which were removed as a dependency - // from `edit-blocks` for the iframe since we don't need to reset admin - // styles. - - - if (ownerNode.id === 'wp-reset-editor-styles-css') { - return; - } - - const isMatch = Array.from(cssRules).find(_ref => { - let { - selectorText - } = _ref; - return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`)); - }); - - if (isMatch && !doc.getElementById(ownerNode.id)) { - // Display warning once we have a way to add style dependencies to the editor. - // See: https://github.com/WordPress/gutenberg/pull/37466. - doc.head.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet. - - const inlineCssId = ownerNode.id.replace('-css', '-inline-css'); - const inlineCssElement = document.getElementById(inlineCssId); - - if (inlineCssElement) { - doc.head.appendChild(inlineCssElement.cloneNode(true)); - } - } - }); -} -/** - * Bubbles some event types (keydown, keypress, and dragover) to parent document - * document to ensure that the keyboard shortcuts and drag and drop work. - * - * Ideally, we should remove event bubbling in the future. Keyboard shortcuts - * should be context dependent, e.g. actions on blocks like Cmd+A should not - * work globally outside the block editor. - * - * @param {Document} doc Document to attach listeners to. - */ - - -function bubbleEvents(doc) { - const { - defaultView - } = doc; - const { - frameElement - } = defaultView; - - function bubbleEvent(event) { - const prototype = Object.getPrototypeOf(event); - const constructorName = prototype.constructor.name; - const Constructor = window[constructorName]; - const init = {}; - - for (const key in event) { - init[key] = event[key]; - } - - if (event instanceof defaultView.MouseEvent) { - const rect = frameElement.getBoundingClientRect(); - init.clientX += rect.left; - init.clientY += rect.top; - } - - const newEvent = new Constructor(event.type, init); - const cancelled = !frameElement.dispatchEvent(newEvent); - - if (cancelled) { - event.preventDefault(); - } - } - - const eventTypes = ['dragover']; - - for (const name of eventTypes) { - doc.addEventListener(name, bubbleEvent); - } -} - -function useParsedAssets(html) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => { - const doc = document.implementation.createHTMLDocument(''); - doc.body.innerHTML = html; - return Array.from(doc.body.children); - }, [html]); -} - -async function loadScript(head, _ref2) { - let { - id, - src - } = _ref2; - return new Promise((resolve, reject) => { - const script = head.ownerDocument.createElement('script'); - script.id = id; - - if (src) { - script.src = src; - - script.onload = () => resolve(); - - script.onerror = () => reject(); - } else { - resolve(); - } - - head.appendChild(script); - }); -} - -function Iframe(_ref3, ref) { - var _window$__editorAsset, _window$__editorAsset2; - - let { - contentRef, - children, - head, - tabIndex = 0, - ...props - } = _ref3; - const [, forceRender] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useReducer"])(() => ({})); - const [iframeDocument, setIframeDocument] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(); - const [bodyClasses, setBodyClasses] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])([]); - const styles = useParsedAssets((_window$__editorAsset = window.__editorAssets) === null || _window$__editorAsset === void 0 ? void 0 : _window$__editorAsset.styles); - const scripts = useParsedAssets((_window$__editorAsset2 = window.__editorAssets) === null || _window$__editorAsset2 === void 0 ? void 0 : _window$__editorAsset2.scripts); - const clearerRef = Object(_block_selection_clearer__WEBPACK_IMPORTED_MODULE_6__[/* useBlockSelectionClearer */ "b"])(); - const [before, writingFlowRef, after] = Object(_writing_flow__WEBPACK_IMPORTED_MODULE_7__[/* useWritingFlow */ "b"])(); - const setRef = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useRefEffect"])(node => { - function setDocumentIfReady() { - const { - contentDocument, - ownerDocument - } = node; - const { - readyState, - documentElement - } = contentDocument; - - if (readyState !== 'interactive' && readyState !== 'complete') { - return false; - } - - bubbleEvents(contentDocument); - setIframeDocument(contentDocument); - clearerRef(documentElement); // Ideally ALL classes that are added through get_body_class should - // be added in the editor too, which we'll somehow have to get from - // the server in the future (which will run the PHP filters). - - setBodyClasses(Array.from(ownerDocument.body.classList).filter(name => name.startsWith('admin-color-') || name === 'wp-embed-responsive')); - contentDocument.dir = ownerDocument.dir; - documentElement.removeChild(contentDocument.head); - documentElement.removeChild(contentDocument.body); - return true; - } - - if (setDocumentIfReady()) { - return; - } // Document is not immediately loaded in Firefox. - - - node.addEventListener('load', () => { - setDocumentIfReady(); - }); - }, []); - const headRef = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useRefEffect"])(element => { - scripts.reduce((promise, script) => promise.then(() => loadScript(element, script)), Promise.resolve()).finally(() => { - // When script are loaded, re-render blocks to allow them - // to initialise. - forceRender(); - }); - }, []); - const bodyRef = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useMergeRefs"])([contentRef, clearerRef, writingFlowRef]); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - if (iframeDocument) { - styleSheetsCompat(iframeDocument); - } - }, [iframeDocument]); - head = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("style", null, 'body{margin:0}'), styles.map(_ref4 => { - let { - tagName, - href, - id, - rel, - media, - textContent - } = _ref4; - const TagName = tagName.toLowerCase(); - - if (TagName === 'style') { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(TagName, { - id, - key: id - }, textContent); - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(TagName, { - href, - id, - rel, - media, - key: id - }); - }), head); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, tabIndex >= 0 && before, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("iframe", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { - ref: Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useMergeRefs"])([ref, setRef]), - tabIndex: tabIndex, - title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Editor canvas') - }), iframeDocument && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createPortal"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("head", { - ref: headRef - }, head), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("body", { - ref: bodyRef, - className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(BODY_CLASS_NAME, ...bodyClasses) - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["__experimentalStyleProvider"], { - document: iframeDocument - }, children))), iframeDocument.documentElement)), tabIndex >= 0 && after); -} - -/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(Iframe)); - - -/***/ }), - -/***/ "hMaJ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _use_setting__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("v5LD"); - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients']; - -function ColorGradientControlInner(_ref) { - let { - colors, - gradients, - disableCustomColors, - disableCustomGradients, - __experimentalHasMultipleOrigins, - __experimentalIsRenderedInSidebar, - className, - label, - onColorChange, - onGradientChange, - colorValue, - gradientValue, - clearable, - showTitle = true, - enableAlpha - } = _ref; - const canChooseAColor = onColorChange && (!Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"])(colors) || !disableCustomColors); - const canChooseAGradient = onGradientChange && (!Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"])(gradients) || !disableCustomGradients); - const [currentTab, setCurrentTab] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(gradientValue ? 'gradient' : !!canChooseAColor && 'color'); - - if (!canChooseAColor && !canChooseAGradient) { - return null; - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["BaseControl"], { - className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('block-editor-color-gradient-control', className) - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("fieldset", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["__experimentalVStack"], { - spacing: 1 - }, showTitle && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("legend", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { - className: "block-editor-color-gradient-control__color-indicator" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["BaseControl"].VisualLabel, null, label))), canChooseAColor && canChooseAGradient && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["__experimentalToggleGroupControl"], { - value: currentTab, - onChange: setCurrentTab, - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Select color type'), - hideLabelFromVision: true, - isBlock: true - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["__experimentalToggleGroupControlOption"], { - value: "color", - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Solid') - }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["__experimentalToggleGroupControlOption"], { - value: "gradient", - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Gradient') - })), (currentTab === 'color' || !canChooseAGradient) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ColorPalette"], { - value: colorValue, - onChange: canChooseAGradient ? newColor => { - onColorChange(newColor); - onGradientChange(); - } : onColorChange, - colors, - disableCustomColors, - __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins, - __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, - clearable: clearable, - enableAlpha: enableAlpha - }), (currentTab === 'gradient' || !canChooseAColor) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["GradientPicker"], { - value: gradientValue, - onChange: canChooseAColor ? newGradient => { - onGradientChange(newGradient); - onColorChange(); - } : onGradientChange, - gradients, - disableCustomGradients, - __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins, - __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, - clearable: clearable - })))); -} - -function ColorGradientControlSelect(props) { - const colorGradientSettings = {}; - colorGradientSettings.colors = Object(_use_setting__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])('color.palette'); - colorGradientSettings.gradients = Object(_use_setting__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])('color.gradients'); - colorGradientSettings.disableCustomColors = !Object(_use_setting__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])('color.custom'); - colorGradientSettings.disableCustomGradients = !Object(_use_setting__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])('color.customGradient'); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ColorGradientControlInner, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, colorGradientSettings, props)); -} - -function ColorGradientControl(props) { - if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["every"])(colorsAndGradientKeys, key => props.hasOwnProperty(key))) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ColorGradientControlInner, props); - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ColorGradientControlSelect, props); -} - -/* harmony default export */ __webpack_exports__["a"] = (ColorGradientControl); - - -/***/ }), - -/***/ "hw9B": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMultiSelection; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("OL6h"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - -function toggleRichText(container, toggle) { - Array.from(container.closest('.is-root-container').querySelectorAll('.rich-text')).forEach(node => { - if (toggle) { - node.setAttribute('contenteditable', true); - } else { - node.removeAttribute('contenteditable'); - } - }); -} -/** - * Sets a multi-selection based on the native selection across blocks. - * - * @param {string} clientId Block client ID. - */ - - -function useMultiSelection(clientId) { - const { - startMultiSelect, - stopMultiSelect, - multiSelect, - selectBlock - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - const { - isSelectionEnabled, - isBlockSelected, - getBlockParents, - getBlockSelectionStart, - hasMultiSelection - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["useRefEffect"])(node => { - const { - ownerDocument - } = node; - const { - defaultView - } = ownerDocument; - let anchorElement; - let rafId; - - function onSelectionChange(_ref) { - let { - isSelectionEnd - } = _ref; - const selection = defaultView.getSelection(); // If no selection is found, end multi selection and enable all rich - // text areas. - - if (!selection.rangeCount || selection.isCollapsed) { - toggleRichText(node, true); - return; - } - - const endClientId = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__[/* getBlockClientId */ "a"])(selection.focusNode); - const isSingularSelection = clientId === endClientId; - - if (isSingularSelection) { - selectBlock(clientId); // If the selection is complete (on mouse up), and no - // multiple blocks have been selected, set focus back to the - // anchor element. if the anchor element contains the - // selection. Additionally, rich text elements that were - // previously disabled can now be enabled again. - - if (isSelectionEnd) { - toggleRichText(node, true); - - if (selection.rangeCount) { - const { - commonAncestorContainer - } = selection.getRangeAt(0); - - if (anchorElement.contains(commonAncestorContainer)) { - anchorElement.focus(); - } - } - } - } else { - const startPath = [...getBlockParents(clientId), clientId]; - const endPath = [...getBlockParents(endClientId), endClientId]; - const depth = Math.min(startPath.length, endPath.length) - 1; - multiSelect(startPath[depth], endPath[depth]); - } - } - - function onSelectionEnd() { - ownerDocument.removeEventListener('selectionchange', onSelectionChange); // Equivalent to attaching the listener once. - - defaultView.removeEventListener('mouseup', onSelectionEnd); // The browser selection won't have updated yet at this point, - // so wait until the next animation frame to get the browser - // selection. - - rafId = defaultView.requestAnimationFrame(() => { - onSelectionChange({ - isSelectionEnd: true - }); - stopMultiSelect(); - }); - } - - function onMouseLeave(_ref2) { - let { - buttons - } = _ref2; - - // The primary button must be pressed to initiate selection. - // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons - if (buttons !== 1) { - return; - } - - if (!isSelectionEnabled() || !isBlockSelected(clientId)) { - return; - } - - anchorElement = ownerDocument.activeElement; - startMultiSelect(); // `onSelectionStart` is called after `mousedown` and - // `mouseleave` (from a block). The selection ends when - // `mouseup` happens anywhere in the window. - - ownerDocument.addEventListener('selectionchange', onSelectionChange); - defaultView.addEventListener('mouseup', onSelectionEnd); // Removing the contenteditable attributes within the block - // editor is essential for selection to work across editable - // areas. The edible hosts are removed, allowing selection to be - // extended outside the DOM element. `startMultiSelect` sets a - // flag in the store so the rich text components are updated, - // but the rerender may happen very slowly, especially in Safari - // for the blocks that are asynchonously rendered. To ensure the - // browser instantly removes the selection boundaries, we remove - // the contenteditable attributes manually. - - toggleRichText(node, false); - } - - function onMouseDown(event) { - // The main button. - // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button - if (!isSelectionEnabled() || event.button !== 0) { - return; - } - - if (event.shiftKey) { - const blockSelectionStart = getBlockSelectionStart(); // By checking `blockSelectionStart` to be set, we handle the - // case where we select a single block. We also have to check - // the selectionEnd (clientId) not to be included in the - // `blockSelectionStart`'s parents because the click event is - // propagated. - - const startParents = getBlockParents(blockSelectionStart); - - if (blockSelectionStart && blockSelectionStart !== clientId && !(startParents !== null && startParents !== void 0 && startParents.includes(clientId))) { - const startPath = [...startParents, blockSelectionStart]; - const endPath = [...getBlockParents(clientId), clientId]; - const depth = Math.min(startPath.length, endPath.length) - 1; - const start = startPath[depth]; - const end = endPath[depth]; // Handle the case of having selected a parent block and - // then sfift+click on a child. - - if (start !== end) { - toggleRichText(node, false); - multiSelect(start, end); - event.preventDefault(); - } - } - } else if (hasMultiSelection()) { - // Allow user to escape out of a multi-selection to a - // singular selection of a block via click. This is handled - // here since focus handling excludes blocks when there is - // multiselection, as focus can be incurred by starting a - // multiselection (focus moved to first block's multi- - // controls). - selectBlock(clientId); - } - } - - node.addEventListener('mousedown', onMouseDown); - node.addEventListener('mouseleave', onMouseLeave); - return () => { - node.removeEventListener('mousedown', onMouseDown); - node.removeEventListener('mouseleave', onMouseLeave); - ownerDocument.removeEventListener('selectionchange', onSelectionChange); - defaultView.removeEventListener('mouseup', onSelectionEnd); - defaultView.cancelAnimationFrame(rafId); - }; - }, [clientId, startMultiSelect, stopMultiSelect, multiSelect, selectBlock, isSelectionEnabled, isBlockSelected, getBlockParents]); -} - - -/***/ }), - -/***/ "iA5R": -/***/ (function(module, exports, __webpack_require__) { +/***/ 1198: +/***/ (function(__unused_webpack_module, exports) { "use strict"; /*istanbul ignore start*/ -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = Diff; + +/*istanbul ignore end*/ +function Diff() {} + +Diff.prototype = { + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + diff: function diff(oldString, newString) { + /*istanbul ignore start*/ + var + /*istanbul ignore end*/ + options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var callback = options.callback; + + if (typeof options === 'function') { + callback = options; + options = {}; + } + + this.options = options; + var self = this; + + function done(value) { + if (callback) { + setTimeout(function () { + callback(undefined, value); + }, 0); + return true; + } else { + return value; + } + } // Allow subclasses to massage the input prior to running + + + oldString = this.castInput(oldString); + newString = this.castInput(newString); + oldString = this.removeEmpty(this.tokenize(oldString)); + newString = this.removeEmpty(this.tokenize(newString)); + var newLen = newString.length, + oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + var bestPath = [{ + newPos: -1, + components: [] + }]; // Seed editLength = 0, i.e. the content starts with the same values + + var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); + + if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + // Identity per the equality and tokenizer + return done([{ + value: this.join(newString), + count: newString.length + }]); + } // Main worker method. checks all permutations of a given edit length for acceptance. + + + function execEditLength() { + for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { + var basePath = + /*istanbul ignore start*/ + void 0 + /*istanbul ignore end*/ + ; + + var addPath = bestPath[diagonalPath - 1], + removePath = bestPath[diagonalPath + 1], + _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; + + if (addPath) { + // No one else is going to attempt to use this value, clear it + bestPath[diagonalPath - 1] = undefined; + } + + var canAdd = addPath && addPath.newPos + 1 < newLen, + canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; + + if (!canAdd && !canRemove) { + // If this path is a terminal then prune + bestPath[diagonalPath] = undefined; + continue; + } // Select the diagonal that we want to branch from. We select the prior + // path whose position in the new string is the farthest from the origin + // and does not pass the bounds of the diff graph + + + if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { + basePath = clonePath(removePath); + self.pushComponent(basePath.components, undefined, true); + } else { + basePath = addPath; // No need to clone, we've pulled it from the list + + basePath.newPos++; + self.pushComponent(basePath.components, true, undefined); + } + + _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done + + if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { + return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); + } else { + // Otherwise track this path as a potential candidate and continue. + bestPath[diagonalPath] = basePath; + } + } + + editLength++; + } // Performs the length of edit iteration. Is a bit fugly as this has to support the + // sync and async mode which is never fun. Loops over execEditLength until a value + // is produced. + + + if (callback) { + (function exec() { + setTimeout(function () { + // This should not happen, but we want to be safe. + + /* istanbul ignore next */ + if (editLength > maxEditLength) { + return callback(); + } + + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength) { + var ret = execEditLength(); + + if (ret) { + return ret; + } + } + } + }, + + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + pushComponent: function pushComponent(components, added, removed) { + var last = components[components.length - 1]; + + if (last && last.added === added && last.removed === removed) { + // We need to clone here as the component clone operation is just + // as shallow array clone + components[components.length - 1] = { + count: last.count + 1, + added: added, + removed: removed + }; + } else { + components.push({ + count: 1, + added: added, + removed: removed + }); + } + }, + + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { + var newLen = newString.length, + oldLen = oldString.length, + newPos = basePath.newPos, + oldPos = newPos - diagonalPath, + commonCount = 0; + + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { + newPos++; + oldPos++; + commonCount++; + } + + if (commonCount) { + basePath.components.push({ + count: commonCount + }); + } + + basePath.newPos = newPos; + return oldPos; + }, + + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + equals: function equals(left, right) { + if (this.options.comparator) { + return this.options.comparator(left, right); + } else { + return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + removeEmpty: function removeEmpty(array) { + var ret = []; + + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + + return ret; + }, + + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + castInput: function castInput(value) { + return value; + }, + + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + tokenize: function tokenize(value) { + return value.split(''); + }, + + /*istanbul ignore start*/ + + /*istanbul ignore end*/ + join: function join(chars) { + return chars.join(''); + } +}; + +function buildValues(diff, components, newString, oldString, useLongestToken) { + var componentPos = 0, + componentLen = components.length, + newPos = 0, + oldPos = 0; + + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function (value, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value.length ? oldValue : value; + }); + component.value = diff.join(value); + } else { + component.value = diff.join(newString.slice(newPos, newPos + component.count)); + } + + newPos += component.count; // Common case + + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; // Reverse add and remove so removes are output first to match common convention + // The diffing algorithm is tied to add then remove output and this is the simplest + // route to get the desired output with minimal overhead. + + if (componentPos && components[componentPos - 1].added) { + var tmp = components[componentPos - 1]; + components[componentPos - 1] = components[componentPos]; + components[componentPos] = tmp; + } + } + } // Special case handle for when one terminal is ignored (i.e. whitespace). + // For this case we merge the terminal into the prior string and drop the change. + // This is only available for string mode. + + + var lastComponent = components[componentLen - 1]; + + if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { + components[componentLen - 2].value += lastComponent.value; + components.pop(); + } + + return components; +} + +function clonePath(path) { + return { + newPos: path.newPos, + components: path.components.slice(0) + }; +} + + +/***/ }), + +/***/ 1973: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +var __webpack_unused_export__; +/*istanbul ignore start*/ + + +__webpack_unused_export__ = ({ value: true }); -exports.diffChars = diffChars; -exports.characterDiff = void 0; +exports.Kx = diffChars; +__webpack_unused_export__ = void 0; /*istanbul ignore end*/ var /*istanbul ignore start*/ -_base = _interopRequireDefault(__webpack_require__("smQA")) +_base = _interopRequireDefault(__webpack_require__(1198)) /*istanbul ignore end*/ ; @@ -32665,7 +734,7 @@ default (); /*istanbul ignore start*/ -exports.characterDiff = characterDiff; +__webpack_unused_export__ = characterDiff; /*istanbul ignore end*/ function diffChars(oldStr, newStr, options) { @@ -32675,105 +744,154 @@ function diffChars(oldStr, newStr, options) { /***/ }), -/***/ "iClF": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 1345: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/** - * 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 - * - * @return {JSX.Element} Icon component - */ +var util = __webpack_require__(5022); -function Icon(_ref) { - let { - icon, - size = 24, - ...props - } = _ref; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, { - width: size, - height: size, - ...props - }); +function scrollIntoView(elem, container, config) { + config = config || {}; + // document 归一化到 window + if (container.nodeType === 9) { + container = util.getWindow(container); + } + + var allowHorizontalScroll = config.allowHorizontalScroll; + var onlyScrollIfNeeded = config.onlyScrollIfNeeded; + var alignWithTop = config.alignWithTop; + var alignWithLeft = config.alignWithLeft; + var offsetTop = config.offsetTop || 0; + var offsetLeft = config.offsetLeft || 0; + var offsetBottom = config.offsetBottom || 0; + var offsetRight = config.offsetRight || 0; + + allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; + + var isWin = util.isWindow(container); + var elemOffset = util.offset(elem); + var eh = util.outerHeight(elem); + var ew = util.outerWidth(elem); + var containerOffset = undefined; + var ch = undefined; + var cw = undefined; + var containerScroll = undefined; + var diffTop = undefined; + var diffBottom = undefined; + var win = undefined; + var winScroll = undefined; + var ww = undefined; + var wh = undefined; + + if (isWin) { + win = container; + wh = util.height(win); + ww = util.width(win); + winScroll = { + left: util.scrollLeft(win), + top: util.scrollTop(win) + }; + // elem 相对 container 可视视窗的距离 + diffTop = { + left: elemOffset.left - winScroll.left - offsetLeft, + top: elemOffset.top - winScroll.top - offsetTop + }; + diffBottom = { + left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight, + top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom + }; + containerScroll = winScroll; + } else { + containerOffset = util.offset(container); + ch = container.clientHeight; + cw = container.clientWidth; + containerScroll = { + left: container.scrollLeft, + top: container.scrollTop + }; + // elem 相对 container 可视视窗的距离 + // 注意边框, offset 是边框到根节点 + diffTop = { + left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft, + top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop + }; + diffBottom = { + left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight, + top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom + }; + } + + if (diffTop.top < 0 || diffBottom.top > 0) { + // 强制向上 + if (alignWithTop === true) { + util.scrollTop(container, containerScroll.top + diffTop.top); + } else if (alignWithTop === false) { + util.scrollTop(container, containerScroll.top + diffBottom.top); + } else { + // 自动调整 + if (diffTop.top < 0) { + util.scrollTop(container, containerScroll.top + diffTop.top); + } else { + util.scrollTop(container, containerScroll.top + diffBottom.top); + } + } + } else { + if (!onlyScrollIfNeeded) { + alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; + if (alignWithTop) { + util.scrollTop(container, containerScroll.top + diffTop.top); + } else { + util.scrollTop(container, containerScroll.top + diffBottom.top); + } + } + } + + if (allowHorizontalScroll) { + if (diffTop.left < 0 || diffBottom.left > 0) { + // 强制向上 + if (alignWithLeft === true) { + util.scrollLeft(container, containerScroll.left + diffTop.left); + } else if (alignWithLeft === false) { + util.scrollLeft(container, containerScroll.left + diffBottom.left); + } else { + // 自动调整 + if (diffTop.left < 0) { + util.scrollLeft(container, containerScroll.left + diffTop.left); + } else { + util.scrollLeft(container, containerScroll.left + diffBottom.left); + } + } + } else { + if (!onlyScrollIfNeeded) { + alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; + if (alignWithLeft) { + util.scrollLeft(container, containerScroll.left + diffTop.left); + } else { + util.scrollLeft(container, containerScroll.left + diffBottom.left); + } + } + } + } } -/* harmony default export */ __webpack_exports__["a"] = (Icon); - +module.exports = scrollIntoView; /***/ }), -/***/ "j6zP": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 5425: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _block_draggable_draggable_chip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("q3tz"); -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - -const InserterDraggableBlocks = _ref => { - let { - isEnabled, - blocks, - icon, - children - } = _ref; - const transferData = { - type: 'inserter', - blocks - }; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Draggable"], { - __experimentalTransferDataType: "wp-blocks", - transferData: transferData, - __experimentalDragComponent: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_draggable_draggable_chip__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], { - count: blocks.length, - icon: icon - }) - }, _ref2 => { - let { - onDraggableStart, - onDraggableEnd - } = _ref2; - return children({ - draggable: isEnabled, - onDragStart: isEnabled ? onDraggableStart : undefined, - onDragEnd: isEnabled ? onDraggableEnd : undefined - }); - }); -}; - -/* harmony default export */ __webpack_exports__["a"] = (InserterDraggableBlocks); - +module.exports = __webpack_require__(1345); /***/ }), -/***/ "jB5C": -/***/ (function(module, exports, __webpack_require__) { +/***/ 5022: +/***/ (function(module) { "use strict"; @@ -33218,759 +1336,205 @@ module.exports = _extends({ /***/ }), -/***/ "jBNB": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 8575: +/***/ (function(module) { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + + +/***/ }), + +/***/ 9894: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Load in dependencies +var computedStyle = __webpack_require__(4827); + +/** + * Calculate the `line-height` of a given node + * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM. + * @returns {Number} `line-height` of the element in pixels + */ +function lineHeight(node) { + // Grab the line-height via style + var lnHeightStr = computedStyle(node, 'line-height'); + var lnHeight = parseFloat(lnHeightStr, 10); + + // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em') + if (lnHeightStr === lnHeight + '') { + // Save the old lineHeight style and update the em unit to the element + var _lnHeightStyle = node.style.lineHeight; + node.style.lineHeight = lnHeightStr + 'em'; + + // Calculate the em based height + lnHeightStr = computedStyle(node, 'line-height'); + lnHeight = parseFloat(lnHeightStr, 10); + + // Revert the lineHeight style + if (_lnHeightStyle) { + node.style.lineHeight = _lnHeightStyle; + } else { + delete node.style.lineHeight; + } + } + + // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt) + // DEV: `em` units are converted to `pt` in IE6 + // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length + if (lnHeightStr.indexOf('pt') !== -1) { + lnHeight *= 4; + lnHeight /= 3; + // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm) + } else if (lnHeightStr.indexOf('mm') !== -1) { + lnHeight *= 96; + lnHeight /= 25.4; + // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm) + } else if (lnHeightStr.indexOf('cm') !== -1) { + lnHeight *= 96; + lnHeight /= 2.54; + // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in) + } else if (lnHeightStr.indexOf('in') !== -1) { + lnHeight *= 96; + // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc) + } else if (lnHeightStr.indexOf('pc') !== -1) { + lnHeight *= 16; + } + + // Continue our computation + lnHeight = Math.round(lnHeight); + + // If the line-height is "normal", calculate by font-size + if (lnHeightStr === 'normal') { + // Create a temporary node + var nodeName = node.nodeName; + var _node = document.createElement(nodeName); + _node.innerHTML = ' '; + + // If we have a text area, reset it to only 1 row + // https://github.com/twolfson/line-height/issues/4 + if (nodeName.toUpperCase() === 'TEXTAREA') { + _node.setAttribute('rows', '1'); + } + + // Set the font-size of the element + var fontSizeStr = computedStyle(node, 'font-size'); + _node.style.fontSize = fontSizeStr; + + // Remove default padding/border which can affect offset height + // https://github.com/twolfson/line-height/issues/4 + // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight + _node.style.padding = '0px'; + _node.style.border = '0px'; + + // Append it to the body + var body = document.body; + body.appendChild(_node); + + // Assume the line height of the element is the height + var height = _node.offsetHeight; + lnHeight = height; + + // Remove our child from the DOM + body.removeChild(_node); + } + + // Return the calculated height + return lnHeight; +} + +// Export lineHeight +module.exports = lineHeight; + + +/***/ }), + +/***/ 7970: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +module.exports = __webpack_require__(195); + + +/***/ }), + +/***/ 3110: +/***/ (function(module) { "use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockListBlockContext; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","dom"] -var external_wp_dom_ = __webpack_require__("1CF3"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js + 1 modules -var block_edit = __webpack_require__("JRTi"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/warning/index.js + 1 modules -var warning = __webpack_require__("Zzu2"); - -// EXTERNAL MODULE: ./node_modules/diff/lib/diff/character.js -var character = __webpack_require__("iA5R"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-compare/block-view.js - - /** - * WordPress dependencies + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ExecutionEnvironment */ +/*jslint evil: true */ -function BlockView(_ref) { - let { - title, - rawContent, - renderedContent, - action, - actionText, - className - } = _ref; - return Object(external_wp_element_["createElement"])("div", { - className: className - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-compare__content" - }, Object(external_wp_element_["createElement"])("h2", { - className: "block-editor-block-compare__heading" - }, title), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-compare__html" - }, rawContent), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-compare__preview edit-post-visual-editor" - }, Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, Object(external_wp_dom_["safeHTML"])(renderedContent)))), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-compare__action" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "secondary", - tabIndex: "0", - onClick: action - }, actionText))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-compare/index.js +var canUseDOM = !!( + typeof window !== 'undefined' && + window.document && + window.document.createElement +); /** - * External dependencies + * Simple, lightweight module assisting with the detection and context of + * Worker. Helps avoid circular dependencies and allows code to reason about + * whether or not they are in a Worker, even if they never include the main + * `ReactWorker` dependency. */ +var ExecutionEnvironment = { - // diff doesn't tree-shake correctly, so we import from the individual -// module here, to avoid including too much of the library + canUseDOM: canUseDOM, + canUseWorkers: typeof Worker !== 'undefined', -/** - * WordPress dependencies - */ + canUseEventListeners: + canUseDOM && !!(window.addEventListener || window.attachEvent), + canUseViewport: canUseDOM && !!window.screen, + isInWorker: !canUseDOM // For now, this is true - might change in the future. -/** - * Internal dependencies - */ - - - -function BlockCompare(_ref) { - let { - block, - onKeep, - onConvert, - convertor, - convertButtonText - } = _ref; - - function getDifference(originalContent, newContent) { - const difference = Object(character["diffChars"])(originalContent, newContent); - return difference.map((item, pos) => { - const classes = classnames_default()({ - 'block-editor-block-compare__added': item.added, - 'block-editor-block-compare__removed': item.removed - }); - return Object(external_wp_element_["createElement"])("span", { - key: pos, - className: classes - }, item.value); - }); - } - - function getConvertedContent(convertedBlock) { - // The convertor may return an array of items or a single item - const newBlocks = Object(external_lodash_["castArray"])(convertedBlock); // Get converted block details - - const newContent = newBlocks.map(item => Object(external_wp_blocks_["getSaveContent"])(item.name, item.attributes, item.innerBlocks)); - return newContent.join(''); - } - - const converted = getConvertedContent(convertor(block)); - const difference = getDifference(block.originalContent, converted); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-compare__wrapper" - }, Object(external_wp_element_["createElement"])(BlockView, { - title: Object(external_wp_i18n_["__"])('Current'), - className: "block-editor-block-compare__current", - action: onKeep, - actionText: Object(external_wp_i18n_["__"])('Convert to HTML'), - rawContent: block.originalContent, - renderedContent: block.originalContent - }), Object(external_wp_element_["createElement"])(BlockView, { - title: Object(external_wp_i18n_["__"])('After Conversion'), - className: "block-editor-block-compare__converted", - action: onConvert, - actionText: convertButtonText, - rawContent: difference, - renderedContent: converted - })); -} - -/* harmony default export */ var block_compare = (BlockCompare); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-invalid-warning.js - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -function BlockInvalidWarning(_ref) { - let { - convertToHTML, - convertToBlocks, - convertToClassic, - attemptBlockRecovery, - block - } = _ref; - const hasHTMLBlock = !!Object(external_wp_blocks_["getBlockType"])('core/html'); - const [compare, setCompare] = Object(external_wp_element_["useState"])(false); - const onCompare = Object(external_wp_element_["useCallback"])(() => setCompare(true), []); - const onCompareClose = Object(external_wp_element_["useCallback"])(() => setCompare(false), []); // We memo the array here to prevent the children components from being updated unexpectedly - - const hiddenActions = Object(external_wp_element_["useMemo"])(() => [{ - // translators: Button to fix block content - title: Object(external_wp_i18n_["_x"])('Resolve', 'imperative verb'), - onClick: onCompare - }, hasHTMLBlock && { - title: Object(external_wp_i18n_["__"])('Convert to HTML'), - onClick: convertToHTML - }, { - title: Object(external_wp_i18n_["__"])('Convert to Classic Block'), - onClick: convertToClassic - }].filter(Boolean), [onCompare, convertToHTML, convertToClassic]); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(warning["a" /* default */], { - actions: [Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: "recover", - onClick: attemptBlockRecovery, - variant: "primary" - }, Object(external_wp_i18n_["__"])('Attempt Block Recovery'))], - secondaryActions: hiddenActions - }, Object(external_wp_i18n_["__"])('This block contains unexpected or invalid content.')), compare && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], { - title: // translators: Dialog title to fix block content - Object(external_wp_i18n_["__"])('Resolve Block'), - onRequestClose: onCompareClose, - className: "block-editor-block-compare" - }, Object(external_wp_element_["createElement"])(block_compare, { - block: block, - onKeep: convertToHTML, - onConvert: convertToBlocks, - convertor: blockToBlocks, - convertButtonText: Object(external_wp_i18n_["__"])('Convert to Blocks') - }))); -} - -const blockToClassic = block => Object(external_wp_blocks_["createBlock"])('core/freeform', { - content: block.originalContent -}); - -const blockToHTML = block => Object(external_wp_blocks_["createBlock"])('core/html', { - content: block.originalContent -}); - -const blockToBlocks = block => Object(external_wp_blocks_["rawHandler"])({ - HTML: block.originalContent -}); - -const recoverBlock = _ref2 => { - let { - name, - attributes, - innerBlocks - } = _ref2; - return Object(external_wp_blocks_["createBlock"])(name, attributes, innerBlocks); }; -/* harmony default export */ var block_invalid_warning = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, _ref3) => { - let { - clientId - } = _ref3; - return { - block: select(store["a" /* store */]).getBlock(clientId) - }; -}), Object(external_wp_data_["withDispatch"])((dispatch, _ref4) => { - let { - block - } = _ref4; - const { - replaceBlock - } = dispatch(store["a" /* store */]); - return { - convertToClassic() { - replaceBlock(block.clientId, blockToClassic(block)); - }, - - convertToHTML() { - replaceBlock(block.clientId, blockToHTML(block)); - }, - - convertToBlocks() { - replaceBlock(block.clientId, blockToBlocks(block)); - }, - - attemptBlockRecovery() { - replaceBlock(block.clientId, recoverBlock(block)); - } - - }; -})])(BlockInvalidWarning)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-warning.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -const block_crash_warning_warning = Object(external_wp_element_["createElement"])(warning["a" /* default */], { - className: "block-editor-block-list__block-crash-warning" -}, Object(external_wp_i18n_["__"])('This block has encountered an error and cannot be previewed.')); -/* harmony default export */ var block_crash_warning = (() => block_crash_warning_warning); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-boundary.js -/** - * WordPress dependencies - */ - - -class block_crash_boundary_BlockCrashBoundary extends external_wp_element_["Component"] { - constructor() { - super(...arguments); - this.state = { - hasError: false - }; - } - - componentDidCatch() { - this.setState({ - hasError: true - }); - } - - render() { - if (this.state.hasError) { - return this.props.fallback; - } - - return this.props.children; - } - -} - -/* harmony default export */ var block_crash_boundary = (block_crash_boundary_BlockCrashBoundary); - -// EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js -var lib = __webpack_require__("O6Fj"); -var lib_default = /*#__PURE__*/__webpack_require__.n(lib); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-html.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - -function BlockHTML(_ref) { - let { - clientId - } = _ref; - const [html, setHtml] = Object(external_wp_element_["useState"])(''); - const block = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).getBlock(clientId), [clientId]); - const { - updateBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - - const onChange = () => { - const blockType = Object(external_wp_blocks_["getBlockType"])(block.name); - - if (!blockType) { - return; - } - - const attributes = Object(external_wp_blocks_["getBlockAttributes"])(blockType, html, block.attributes); // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error - - const content = html ? html : Object(external_wp_blocks_["getSaveContent"])(blockType, attributes); - const isValid = html ? Object(external_wp_blocks_["isValidBlockContent"])(blockType, attributes, content) : true; - updateBlock(clientId, { - attributes, - originalContent: content, - isValid - }); // Ensure the state is updated if we reset so it displays the default content - - if (!html) { - setHtml({ - content - }); - } - }; - - Object(external_wp_element_["useEffect"])(() => { - setHtml(Object(external_wp_blocks_["getBlockContent"])(block)); - }, [block]); - return Object(external_wp_element_["createElement"])(lib_default.a, { - className: "block-editor-block-list__block-html-textarea", - value: html, - onBlur: onChange, - onChange: event => setHtml(event.target.value) - }); -} - -/* harmony default export */ var block_html = (BlockHTML); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/index.js -var use_block_props = __webpack_require__("nlh6"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - -const BlockListBlockContext = Object(external_wp_element_["createContext"])(); -/** - * Merges wrapper props with special handling for classNames and styles. - * - * @param {Object} propsA - * @param {Object} propsB - * - * @return {Object} Merged props. - */ - -function mergeWrapperProps(propsA, propsB) { - const newProps = { ...propsA, - ...propsB - }; - - if (propsA && propsB && propsA.className && propsB.className) { - newProps.className = classnames_default()(propsA.className, propsB.className); - } - - if (propsA && propsB && propsA.style && propsB.style) { - newProps.style = { ...propsA.style, - ...propsB.style - }; - } - - return newProps; -} - -function Block(_ref) { - let { - children, - isHtml, - ...props - } = _ref; - return Object(external_wp_element_["createElement"])("div", Object(use_block_props["a" /* useBlockProps */])(props, { - __unstableIsHtml: isHtml - }), children); -} - -function BlockListBlock(_ref2) { - let { - mode, - isLocked, - canRemove, - clientId, - isSelected, - isSelectionEnabled, - className, - name, - isValid, - attributes, - wrapperProps, - setAttributes, - onReplace, - onInsertBlocksAfter, - onMerge, - toggleSelection - } = _ref2; - const { - removeBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const onRemove = Object(external_wp_element_["useCallback"])(() => removeBlock(clientId), [clientId]); // We wrap the BlockEdit component in a div that hides it when editing in - // HTML mode. This allows us to render all of the ancillary pieces - // (InspectorControls, etc.) which are inside `BlockEdit` but not - // `BlockHTML`, even in HTML mode. - - let blockEdit = Object(external_wp_element_["createElement"])(block_edit["a" /* default */], { - name: name, - isSelected: isSelected, - attributes: attributes, - setAttributes: setAttributes, - insertBlocksAfter: isLocked ? undefined : onInsertBlocksAfter, - onReplace: canRemove ? onReplace : undefined, - onRemove: canRemove ? onRemove : undefined, - mergeBlocks: canRemove ? onMerge : undefined, - clientId: clientId, - isSelectionEnabled: isSelectionEnabled, - toggleSelection: toggleSelection - }); - const blockType = Object(external_wp_blocks_["getBlockType"])(name); // Determine whether the block has props to apply to the wrapper. - - if (blockType !== null && blockType !== void 0 && blockType.getEditWrapperProps) { - wrapperProps = mergeWrapperProps(wrapperProps, blockType.getEditWrapperProps(attributes)); - } - - const isAligned = wrapperProps && !!wrapperProps['data-align']; // For aligned blocks, provide a wrapper element so the block can be - // positioned relative to the block column. - - if (isAligned) { - blockEdit = Object(external_wp_element_["createElement"])("div", { - className: "wp-block", - "data-align": wrapperProps['data-align'] - }, blockEdit); - } - - let block; - - if (!isValid) { - const saveContent = Object(external_wp_blocks_["getSaveContent"])(blockType, attributes); - block = Object(external_wp_element_["createElement"])(Block, { - className: "has-warning" - }, Object(external_wp_element_["createElement"])(block_invalid_warning, { - clientId: clientId - }), Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, Object(external_wp_dom_["safeHTML"])(saveContent))); - } else if (mode === 'html') { - // Render blockEdit so the inspector controls don't disappear. - // See #8969. - block = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { - style: { - display: 'none' - } - }, blockEdit), Object(external_wp_element_["createElement"])(Block, { - isHtml: true - }, Object(external_wp_element_["createElement"])(block_html, { - clientId: clientId - }))); - } else if ((blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) > 1) { - block = blockEdit; - } else { - block = Object(external_wp_element_["createElement"])(Block, wrapperProps, blockEdit); - } - - const value = { - clientId, - className, - wrapperProps: Object(external_lodash_["omit"])(wrapperProps, ['data-align']), - isAligned - }; - const memoizedValue = Object(external_wp_element_["useMemo"])(() => value, Object.values(value)); - return Object(external_wp_element_["createElement"])(BlockListBlockContext.Provider, { - value: memoizedValue - }, Object(external_wp_element_["createElement"])(block_crash_boundary, { - fallback: Object(external_wp_element_["createElement"])(Block, { - className: "has-warning" - }, Object(external_wp_element_["createElement"])(block_crash_warning, null)) - }, block)); -} - -const applyWithSelect = Object(external_wp_data_["withSelect"])((select, _ref3) => { - let { - clientId, - rootClientId - } = _ref3; - const { - isBlockSelected, - getBlockMode, - isSelectionEnabled, - getTemplateLock, - __unstableGetBlockWithoutInnerBlocks, - canRemoveBlock, - canMoveBlock - } = select(store["a" /* store */]); - - const block = __unstableGetBlockWithoutInnerBlocks(clientId); - - const isSelected = isBlockSelected(clientId); - const templateLock = getTemplateLock(rootClientId); - const canRemove = canRemoveBlock(clientId, rootClientId); - const canMove = canMoveBlock(clientId, rootClientId); // The fallback to `{}` is a temporary fix. - // This function should never be called when a block is not present in - // the state. It happens now because the order in withSelect rendering - // is not correct. - - const { - name, - attributes, - isValid - } = block || {}; // Do not add new properties here, use `useSelect` instead to avoid - // leaking new props to the public API (editor.BlockListBlock filter). - - return { - mode: getBlockMode(clientId), - isSelectionEnabled: isSelectionEnabled(), - isLocked: !!templateLock, - canRemove, - canMove, - // Users of the editor.BlockListBlock filter used to be able to - // access the block prop. - // Ideally these blocks would rely on the clientId prop only. - // This is kept for backward compatibility reasons. - block, - name, - attributes, - isValid, - isSelected - }; -}); -const applyWithDispatch = Object(external_wp_data_["withDispatch"])((dispatch, ownProps, _ref4) => { - let { - select - } = _ref4; - const { - updateBlockAttributes, - insertBlocks, - mergeBlocks, - replaceBlocks, - toggleSelection, - __unstableMarkLastChangeAsPersistent - } = dispatch(store["a" /* store */]); // Do not add new properties here, use `useDispatch` instead to avoid - // leaking new props to the public API (editor.BlockListBlock filter). - - return { - setAttributes(newAttributes) { - const { - getMultiSelectedBlockClientIds - } = select(store["a" /* store */]); - const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(); - const { - clientId - } = ownProps; - const clientIds = multiSelectedBlockClientIds.length ? multiSelectedBlockClientIds : [clientId]; - updateBlockAttributes(clientIds, newAttributes); - }, - - onInsertBlocks(blocks, index) { - const { - rootClientId - } = ownProps; - insertBlocks(blocks, index, rootClientId); - }, - - onInsertBlocksAfter(blocks) { - const { - clientId, - rootClientId - } = ownProps; - const { - getBlockIndex - } = select(store["a" /* store */]); - const index = getBlockIndex(clientId); - insertBlocks(blocks, index + 1, rootClientId); - }, - - onMerge(forward) { - const { - clientId - } = ownProps; - const { - getPreviousBlockClientId, - getNextBlockClientId - } = select(store["a" /* store */]); - - if (forward) { - const nextBlockClientId = getNextBlockClientId(clientId); - - if (nextBlockClientId) { - mergeBlocks(clientId, nextBlockClientId); - } - } else { - const previousBlockClientId = getPreviousBlockClientId(clientId); - - if (previousBlockClientId) { - mergeBlocks(previousBlockClientId, clientId); - } - } - }, - - onReplace(blocks, indexToSelect, initialPosition) { - if (blocks.length && !Object(external_wp_blocks_["isUnmodifiedDefaultBlock"])(blocks[blocks.length - 1])) { - __unstableMarkLastChangeAsPersistent(); - } - - replaceBlocks([ownProps.clientId], blocks, indexToSelect, initialPosition); - }, - - toggleSelection(selectionEnabled) { - toggleSelection(selectionEnabled); - } - - }; -}); -/* harmony default export */ var block_list_block = __webpack_exports__["b"] = (Object(external_wp_compose_["compose"])(external_wp_compose_["pure"], applyWithSelect, applyWithDispatch, // block is sometimes not mounted at the right time, causing it be undefined -// see issue for more info -// https://github.com/WordPress/gutenberg/issues/17013 -Object(external_wp_compose_["ifCondition"])(_ref5 => { - let { - block - } = _ref5; - return !!block; -}), Object(external_wp_components_["withFilters"])('editor.BlockListBlock'))(BlockListBlock)); +module.exports = ExecutionEnvironment; /***/ }), -/***/ "jTPX": -/***/ (function(module, exports) { - -// This code has been refactored for 140 bytes -// You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js -var computedStyle = function (el, prop, getComputedStyle) { - getComputedStyle = window.getComputedStyle; - - // In one fell swoop - return ( - // If we have getComputedStyle - getComputedStyle ? - // Query it - // TODO: From CSS-Query notes, we might need (node, null) for FF - getComputedStyle(el) : - - // Otherwise, we are in IE and use currentStyle - el.currentStyle - )[ - // Switch to camelCase for CSSOM - // DEV: Grabbed from jQuery - // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 - // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 - prop.replace(/-(\w)/gi, function (word, letter) { - return letter.toUpperCase(); - }) - ]; -}; - -module.exports = computedStyle; - - -/***/ }), - -/***/ "jrfk": -/***/ (function(module, exports) { +/***/ 3812: +/***/ (function(module) { /** * Copyright 2004-present Facebook. All Rights Reserved. @@ -34258,305 +1822,1256 @@ module.exports = UserAgent_DEPRECATED; /***/ }), -/***/ "jwne": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 7939: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InspectorControlsSlot; }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Z23Y"); -/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _block_support_tools_panel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("c1Zz"); -/* harmony import */ var _block_support_slot_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("asom"); -/* harmony import */ var _groups__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("VrEk"); - - - /** - * WordPress dependencies - */ - - -/** - * Internal dependencies + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isEventSupported */ +var ExecutionEnvironment = __webpack_require__(3110); -function InspectorControlsSlot(_ref) { - var _groups$group; - - let { - __experimentalGroup: group = 'default', - bubblesVirtually = true, - label, - ...props - } = _ref; - const Slot = (_groups$group = _groups__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"][group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Slot; - const slot = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__experimentalUseSlot"])(Slot === null || Slot === void 0 ? void 0 : Slot.__unstableName); - - if (!Slot || !slot) { - typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default()(`Unknown InspectorControl group "${group}" provided.`) : void 0; - return null; - } - - const hasFills = Boolean(slot.fills && slot.fills.length); - - if (!hasFills) { - return null; - } - - if (label) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_support_tools_panel__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], { - group: group, - label: label - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_support_slot_container__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { - bubblesVirtually: bubblesVirtually, - Slot: Slot - }))); - } - - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Slot, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { - bubblesVirtually: bubblesVirtually - })); +var useHasFeature; +if (ExecutionEnvironment.canUseDOM) { + useHasFeature = + document.implementation && + document.implementation.hasFeature && + // always returns true in newer browsers as per the standard. + // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature + document.implementation.hasFeature('', '') !== true; } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) +/** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @param {?boolean} capture Check if the capture phase is supported. + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ +function isEventSupported(eventNameSuffix, capture) { + if (!ExecutionEnvironment.canUseDOM || + capture && !('addEventListener' in document)) { + return false; + } + + var eventName = 'on' + eventNameSuffix; + var isSupported = eventName in document; + + if (!isSupported) { + var element = document.createElement('div'); + element.setAttribute(eventName, 'return;'); + isSupported = typeof element[eventName] === 'function'; + } + + if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { + // This is the only way to test support for the `wheel` event in IE9+. + isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); + } + + return isSupported; +} + +module.exports = isEventSupported; + /***/ }), -/***/ "kBLm": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 195: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsHovered; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); /** - * WordPress dependencies - */ - - -/** - * Internal dependencies + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule normalizeWheel + * @typechecks */ -function listener(event) { - if (event.defaultPrevented) { - return; +var UserAgent_DEPRECATED = __webpack_require__(3812); + +var isEventSupported = __webpack_require__(7939); + + +// Reasonable defaults +var PIXEL_STEP = 10; +var LINE_HEIGHT = 40; +var PAGE_HEIGHT = 800; + +/** + * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is + * complicated, thus this doc is long and (hopefully) detailed enough to answer + * your questions. + * + * If you need to react to the mouse wheel in a predictable way, this code is + * like your bestest friend. * hugs * + * + * As of today, there are 4 DOM event types you can listen to: + * + * 'wheel' -- Chrome(31+), FF(17+), IE(9+) + * 'mousewheel' -- Chrome, IE(6+), Opera, Safari + * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! + * 'DOMMouseScroll' -- FF(0.9.7+) since 2003 + * + * So what to do? The is the best: + * + * normalizeWheel.getEventType(); + * + * In your event callback, use this code to get sane interpretation of the + * deltas. This code will return an object with properties: + * + * spinX -- normalized spin speed (use for zoom) - x plane + * spinY -- " - y plane + * pixelX -- normalized distance (to pixels) - x plane + * pixelY -- " - y plane + * + * Wheel values are provided by the browser assuming you are using the wheel to + * scroll a web page by a number of lines or pixels (or pages). Values can vary + * significantly on different platforms and browsers, forgetting that you can + * scroll at different speeds. Some devices (like trackpads) emit more events + * at smaller increments with fine granularity, and some emit massive jumps with + * linear speed or acceleration. + * + * This code does its best to normalize the deltas for you: + * + * - spin is trying to normalize how far the wheel was spun (or trackpad + * dragged). This is super useful for zoom support where you want to + * throw away the chunky scroll steps on the PC and make those equal to + * the slow and smooth tiny steps on the Mac. Key data: This code tries to + * resolve a single slow step on a wheel to 1. + * + * - pixel is normalizing the desired scroll delta in pixel units. You'll + * get the crazy differences between browsers, but at least it'll be in + * pixels! + * + * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This + * should translate to positive value zooming IN, negative zooming OUT. + * This matches the newer 'wheel' event. + * + * Why are there spinX, spinY (or pixels)? + * + * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn + * with a mouse. It results in side-scrolling in the browser by default. + * + * - spinY is what you expect -- it's the classic axis of a mouse wheel. + * + * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and + * probably is by browsers in conjunction with fancy 3D controllers .. but + * you know. + * + * Implementation info: + * + * Examples of 'wheel' event if you scroll slowly (down) by one step with an + * average mouse: + * + * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) + * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) + * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) + * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) + * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) + * + * On the trackpad: + * + * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) + * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) + * + * On other/older browsers.. it's more complicated as there can be multiple and + * also missing delta values. + * + * The 'wheel' event is more standard: + * + * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents + * + * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and + * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain + * backward compatibility with older events. Those other values help us + * better normalize spin speed. Example of what the browsers provide: + * + * | event.wheelDelta | event.detail + * ------------------+------------------+-------------- + * Safari v5/OS X | -120 | 0 + * Safari v5/Win7 | -120 | 0 + * Chrome v17/OS X | -120 | 0 + * Chrome v17/Win7 | -120 | 0 + * IE9/Win7 | -120 | undefined + * Firefox v4/OS X | undefined | 1 + * Firefox v4/Win7 | undefined | 3 + * + */ +function normalizeWheel(/*object*/ event) /*object*/ { + var sX = 0, sY = 0, // spinX, spinY + pX = 0, pY = 0; // pixelX, pixelY + + // Legacy + if ('detail' in event) { sY = event.detail; } + if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; } + if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; } + if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; } + + // side scrolling on FF with DOMMouseScroll + if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) { + sX = sY; + sY = 0; } - const action = event.type === 'mouseover' ? 'add' : 'remove'; - event.preventDefault(); - event.currentTarget.classList[action]('is-hovered'); -} -/** - * Adds `is-hovered` class when the block is hovered and in navigation or - * outline mode. - */ + pX = sX * PIXEL_STEP; + pY = sY * PIXEL_STEP; + if ('deltaY' in event) { pY = event.deltaY; } + if ('deltaX' in event) { pX = event.deltaX; } -function useIsHovered() { - const isEnabled = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(select => { - const { - isNavigationMode, - getSettings - } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); - return isNavigationMode() || getSettings().outlineMode; - }, []); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["useRefEffect"])(node => { - if (isEnabled) { - node.addEventListener('mouseout', listener); - node.addEventListener('mouseover', listener); - return () => { - node.removeEventListener('mouseout', listener); - node.removeEventListener('mouseover', listener); // Remove class in case it lingers. - - node.classList.remove('is-hovered'); - }; + if ((pX || pY) && event.deltaMode) { + if (event.deltaMode == 1) { // delta in LINE units + pX *= LINE_HEIGHT; + pY *= LINE_HEIGHT; + } else { // delta in PAGE units + pX *= PAGE_HEIGHT; + pY *= PAGE_HEIGHT; } - }, [isEnabled]); + } + + // Fall-back if spin cannot be determined + if (pX && !sX) { sX = (pX < 1) ? -1 : 1; } + if (pY && !sY) { sY = (pY < 1) ? -1 : 1; } + + return { spinX : sX, + spinY : sY, + pixelX : pX, + pixelY : pY }; +} + + +/** + * The best combination if you prefer spinX + spinY normalization. It favors + * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with + * 'wheel' event, making spin speed determination impossible. + */ +normalizeWheel.getEventType = function() /*string*/ { + return (UserAgent_DEPRECATED.firefox()) + ? 'DOMMouseScroll' + : (isEventSupported('wheel')) + ? 'wheel' + : 'mousewheel'; +}; + +module.exports = normalizeWheel; + + +/***/ }), + +/***/ 5372: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = __webpack_require__(9567); + +function emptyFunction() {} +function emptyFunctionWithReset() {} +emptyFunctionWithReset.resetWarningCache = emptyFunction; + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + var err = 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' + ); + err.name = 'Invariant Violation'; + throw err; + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bigint: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + elementType: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim, + + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction + }; + + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), + +/***/ 2652: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if (false) { var throwOnDirectAccess, ReactIs; } else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(5372)(); } /***/ }), -/***/ "kVRd": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 9567: +/***/ (function(module) { "use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), + +/***/ 5438: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || Object.assign || function(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; +}; +var __rest = (this && this.__rest) || function (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) + t[p[i]] = s[p[i]]; + return t; +}; +exports.__esModule = true; +var React = __webpack_require__(9196); +var PropTypes = __webpack_require__(2652); +var autosize = __webpack_require__(6411); +var _getLineHeight = __webpack_require__(9894); +var getLineHeight = _getLineHeight; +var RESIZED = "autosize:resized"; +/** + * A light replacement for built-in textarea component + * which automaticaly adjusts its height to match the content + */ +var TextareaAutosizeClass = /** @class */ (function (_super) { + __extends(TextareaAutosizeClass, _super); + function TextareaAutosizeClass() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.state = { + lineHeight: null + }; + _this.textarea = null; + _this.onResize = function (e) { + if (_this.props.onResize) { + _this.props.onResize(e); + } + }; + _this.updateLineHeight = function () { + if (_this.textarea) { + _this.setState({ + lineHeight: getLineHeight(_this.textarea) + }); + } + }; + _this.onChange = function (e) { + var onChange = _this.props.onChange; + _this.currentValue = e.currentTarget.value; + onChange && onChange(e); + }; + return _this; + } + TextareaAutosizeClass.prototype.componentDidMount = function () { + var _this = this; + var _a = this.props, maxRows = _a.maxRows, async = _a.async; + if (typeof maxRows === "number") { + this.updateLineHeight(); + } + if (typeof maxRows === "number" || async) { + /* + the defer is needed to: + - force "autosize" to activate the scrollbar when this.props.maxRows is passed + - support StyledComponents (see #71) + */ + setTimeout(function () { return _this.textarea && autosize(_this.textarea); }); + } + else { + this.textarea && autosize(this.textarea); + } + if (this.textarea) { + this.textarea.addEventListener(RESIZED, this.onResize); + } + }; + TextareaAutosizeClass.prototype.componentWillUnmount = function () { + if (this.textarea) { + this.textarea.removeEventListener(RESIZED, this.onResize); + autosize.destroy(this.textarea); + } + }; + TextareaAutosizeClass.prototype.render = function () { + var _this = this; + var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; + var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; + return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) { + _this.textarea = element; + if (typeof _this.props.innerRef === 'function') { + _this.props.innerRef(element); + } + else if (_this.props.innerRef) { + _this.props.innerRef.current = element; + } + } }), children)); + }; + TextareaAutosizeClass.prototype.componentDidUpdate = function () { + this.textarea && autosize.update(this.textarea); + }; + TextareaAutosizeClass.defaultProps = { + rows: 1, + async: false + }; + TextareaAutosizeClass.propTypes = { + rows: PropTypes.number, + maxRows: PropTypes.number, + onResize: PropTypes.func, + innerRef: PropTypes.any, + async: PropTypes.bool + }; + return TextareaAutosizeClass; +}(React.Component)); +exports.TextareaAutosize = React.forwardRef(function (props, ref) { + return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref })); +}); + + +/***/ }), + +/***/ 773: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = true; +var TextareaAutosize_1 = __webpack_require__(5438); +exports.Z = TextareaAutosize_1.TextareaAutosize; + + +/***/ }), + +/***/ 3124: +/***/ (function(module) { + +var traverse = module.exports = function (obj) { + return new Traverse(obj); +}; + +function Traverse (obj) { + this.value = obj; +} + +Traverse.prototype.get = function (ps) { + var node = this.value; + for (var i = 0; i < ps.length; i ++) { + var key = ps[i]; + if (!node || !hasOwnProperty.call(node, key)) { + node = undefined; + break; + } + node = node[key]; + } + return node; +}; + +Traverse.prototype.has = function (ps) { + var node = this.value; + for (var i = 0; i < ps.length; i ++) { + var key = ps[i]; + if (!node || !hasOwnProperty.call(node, key)) { + return false; + } + node = node[key]; + } + return true; +}; + +Traverse.prototype.set = function (ps, value) { + var node = this.value; + for (var i = 0; i < ps.length - 1; i ++) { + var key = ps[i]; + if (!hasOwnProperty.call(node, key)) node[key] = {}; + node = node[key]; + } + node[ps[i]] = value; + return value; +}; + +Traverse.prototype.map = function (cb) { + return walk(this.value, cb, true); +}; + +Traverse.prototype.forEach = function (cb) { + this.value = walk(this.value, cb, false); + return this.value; +}; + +Traverse.prototype.reduce = function (cb, init) { + var skip = arguments.length === 1; + var acc = skip ? this.value : init; + this.forEach(function (x) { + if (!this.isRoot || !skip) { + acc = cb.call(this, acc, x); + } + }); + return acc; +}; + +Traverse.prototype.paths = function () { + var acc = []; + this.forEach(function (x) { + acc.push(this.path); + }); + return acc; +}; + +Traverse.prototype.nodes = function () { + var acc = []; + this.forEach(function (x) { + acc.push(this.node); + }); + return acc; +}; + +Traverse.prototype.clone = function () { + var parents = [], nodes = []; + + return (function clone (src) { + for (var i = 0; i < parents.length; i++) { + if (parents[i] === src) { + return nodes[i]; + } + } + + if (typeof src === 'object' && src !== null) { + var dst = copy(src); + + parents.push(src); + nodes.push(dst); + + forEach(objectKeys(src), function (key) { + dst[key] = clone(src[key]); + }); + + parents.pop(); + nodes.pop(); + return dst; + } + else { + return src; + } + })(this.value); +}; + +function walk (root, cb, immutable) { + var path = []; + var parents = []; + var alive = true; + + return (function walker (node_) { + var node = immutable ? copy(node_) : node_; + var modifiers = {}; + + var keepGoing = true; + + var state = { + node : node, + node_ : node_, + path : [].concat(path), + parent : parents[parents.length - 1], + parents : parents, + key : path.slice(-1)[0], + isRoot : path.length === 0, + level : path.length, + circular : null, + update : function (x, stopHere) { + if (!state.isRoot) { + state.parent.node[state.key] = x; + } + state.node = x; + if (stopHere) keepGoing = false; + }, + 'delete' : function (stopHere) { + delete state.parent.node[state.key]; + if (stopHere) keepGoing = false; + }, + remove : function (stopHere) { + if (isArray(state.parent.node)) { + state.parent.node.splice(state.key, 1); + } + else { + delete state.parent.node[state.key]; + } + if (stopHere) keepGoing = false; + }, + keys : null, + before : function (f) { modifiers.before = f }, + after : function (f) { modifiers.after = f }, + pre : function (f) { modifiers.pre = f }, + post : function (f) { modifiers.post = f }, + stop : function () { alive = false }, + block : function () { keepGoing = false } + }; + + if (!alive) return state; + + function updateState() { + if (typeof state.node === 'object' && state.node !== null) { + if (!state.keys || state.node_ !== state.node) { + state.keys = objectKeys(state.node) + } + + state.isLeaf = state.keys.length == 0; + + for (var i = 0; i < parents.length; i++) { + if (parents[i].node_ === node_) { + state.circular = parents[i]; + break; + } + } + } + else { + state.isLeaf = true; + state.keys = null; + } + + state.notLeaf = !state.isLeaf; + state.notRoot = !state.isRoot; + } + + updateState(); + + // use return values to update if defined + var ret = cb.call(state, state.node); + if (ret !== undefined && state.update) state.update(ret); + + if (modifiers.before) modifiers.before.call(state, state.node); + + if (!keepGoing) return state; + + if (typeof state.node == 'object' + && state.node !== null && !state.circular) { + parents.push(state); + + updateState(); + + forEach(state.keys, function (key, i) { + path.push(key); + + if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); + + var child = walker(state.node[key]); + if (immutable && hasOwnProperty.call(state.node, key)) { + state.node[key] = child.node; + } + + child.isLast = i == state.keys.length - 1; + child.isFirst = i == 0; + + if (modifiers.post) modifiers.post.call(state, child); + + path.pop(); + }); + parents.pop(); + } + + if (modifiers.after) modifiers.after.call(state, state.node); + + return state; + })(root).node; +} + +function copy (src) { + if (typeof src === 'object' && src !== null) { + var dst; + + if (isArray(src)) { + dst = []; + } + else if (isDate(src)) { + dst = new Date(src.getTime ? src.getTime() : src); + } + else if (isRegExp(src)) { + dst = new RegExp(src); + } + else if (isError(src)) { + dst = { message: src.message }; + } + else if (isBoolean(src)) { + dst = new Boolean(src); + } + else if (isNumber(src)) { + dst = new Number(src); + } + else if (isString(src)) { + dst = new String(src); + } + else if (Object.create && Object.getPrototypeOf) { + dst = Object.create(Object.getPrototypeOf(src)); + } + else if (src.constructor === Object) { + dst = {}; + } + else { + var proto = + (src.constructor && src.constructor.prototype) + || src.__proto__ + || {} + ; + var T = function () {}; + T.prototype = proto; + dst = new T; + } + + forEach(objectKeys(src), function (key) { + dst[key] = src[key]; + }); + return dst; + } + else return src; +} + +var objectKeys = Object.keys || function keys (obj) { + var res = []; + for (var key in obj) res.push(key) + return res; +}; + +function toS (obj) { return Object.prototype.toString.call(obj) } +function isDate (obj) { return toS(obj) === '[object Date]' } +function isRegExp (obj) { return toS(obj) === '[object RegExp]' } +function isError (obj) { return toS(obj) === '[object Error]' } +function isBoolean (obj) { return toS(obj) === '[object Boolean]' } +function isNumber (obj) { return toS(obj) === '[object Number]' } +function isString (obj) { return toS(obj) === '[object String]' } + +var isArray = Array.isArray || function isArray (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +var forEach = function (xs, fn) { + if (xs.forEach) return xs.forEach(fn) + else for (var i = 0; i < xs.length; i++) { + fn(xs[i], i, xs); + } +}; + +forEach(objectKeys(Traverse.prototype), function (key) { + traverse[key] = function (obj) { + var args = [].slice.call(arguments, 1); + var t = new Traverse(obj); + return t[key].apply(t, args); + }; +}); + +var hasOwnProperty = Object.hasOwnProperty || function (obj, key) { + return key in obj; +}; + + +/***/ }), + +/***/ 9196: +/***/ (function(module) { + +"use strict"; +module.exports = window["React"]; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // 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].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +!function() { +"use strict"; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); // EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ TextDecorationControl; }); +__webpack_require__.d(__webpack_exports__, { + "AlignmentControl": function() { return /* reexport */ AlignmentControl; }, + "AlignmentToolbar": function() { return /* reexport */ AlignmentToolbar; }, + "Autocomplete": function() { return /* reexport */ autocomplete; }, + "BlockAlignmentControl": function() { return /* reexport */ BlockAlignmentControl; }, + "BlockAlignmentToolbar": function() { return /* reexport */ BlockAlignmentToolbar; }, + "BlockBreadcrumb": function() { return /* reexport */ block_breadcrumb; }, + "BlockColorsStyleSelector": function() { return /* reexport */ color_style_selector; }, + "BlockContextProvider": function() { return /* reexport */ BlockContextProvider; }, + "BlockControls": function() { return /* reexport */ block_controls; }, + "BlockEdit": function() { return /* reexport */ BlockEdit; }, + "BlockEditorKeyboardShortcuts": function() { return /* reexport */ keyboard_shortcuts; }, + "BlockEditorProvider": function() { return /* reexport */ provider; }, + "BlockFormatControls": function() { return /* reexport */ BlockFormatControls; }, + "BlockIcon": function() { return /* reexport */ block_icon; }, + "BlockInspector": function() { return /* reexport */ block_inspector; }, + "BlockList": function() { return /* reexport */ BlockList; }, + "BlockMover": function() { return /* reexport */ block_mover; }, + "BlockNavigationDropdown": function() { return /* reexport */ dropdown; }, + "BlockPreview": function() { return /* reexport */ block_preview; }, + "BlockSelectionClearer": function() { return /* reexport */ BlockSelectionClearer; }, + "BlockSettingsMenu": function() { return /* reexport */ block_settings_menu; }, + "BlockSettingsMenuControls": function() { return /* reexport */ block_settings_menu_controls; }, + "BlockTitle": function() { return /* reexport */ BlockTitle; }, + "BlockToolbar": function() { return /* reexport */ BlockToolbar; }, + "BlockTools": function() { return /* reexport */ BlockTools; }, + "BlockVerticalAlignmentControl": function() { return /* reexport */ BlockVerticalAlignmentControl; }, + "BlockVerticalAlignmentToolbar": function() { return /* reexport */ BlockVerticalAlignmentToolbar; }, + "ButtonBlockAppender": function() { return /* reexport */ button_block_appender; }, + "ButtonBlockerAppender": function() { return /* reexport */ ButtonBlockerAppender; }, + "ColorPalette": function() { return /* reexport */ color_palette; }, + "ColorPaletteControl": function() { return /* reexport */ ColorPaletteControl; }, + "ContrastChecker": function() { return /* reexport */ contrast_checker; }, + "CopyHandler": function() { return /* reexport */ copy_handler; }, + "DefaultBlockAppender": function() { return /* reexport */ default_block_appender; }, + "FontSizePicker": function() { return /* reexport */ font_size_picker; }, + "InnerBlocks": function() { return /* reexport */ inner_blocks; }, + "Inserter": function() { return /* reexport */ inserter; }, + "InspectorAdvancedControls": function() { return /* reexport */ InspectorAdvancedControls; }, + "InspectorControls": function() { return /* reexport */ inspector_controls; }, + "JustifyContentControl": function() { return /* reexport */ JustifyContentControl; }, + "JustifyToolbar": function() { return /* reexport */ JustifyToolbar; }, + "LineHeightControl": function() { return /* reexport */ LineHeightControl; }, + "MediaPlaceholder": function() { return /* reexport */ media_placeholder; }, + "MediaReplaceFlow": function() { return /* reexport */ media_replace_flow; }, + "MediaUpload": function() { return /* reexport */ media_upload; }, + "MediaUploadCheck": function() { return /* reexport */ media_upload_check; }, + "MultiSelectScrollIntoView": function() { return /* reexport */ MultiSelectScrollIntoView; }, + "NavigableToolbar": function() { return /* reexport */ navigable_toolbar; }, + "ObserveTyping": function() { return /* reexport */ observe_typing; }, + "PanelColorSettings": function() { return /* reexport */ panel_color_settings; }, + "PlainText": function() { return /* reexport */ plain_text; }, + "PreserveScrollInReorder": function() { return /* reexport */ PreserveScrollInReorder; }, + "RichText": function() { return /* reexport */ rich_text; }, + "RichTextShortcut": function() { return /* reexport */ RichTextShortcut; }, + "RichTextToolbarButton": function() { return /* reexport */ RichTextToolbarButton; }, + "SETTINGS_DEFAULTS": function() { return /* reexport */ SETTINGS_DEFAULTS; }, + "SkipToSelectedBlock": function() { return /* reexport */ skip_to_selected_block; }, + "ToolSelector": function() { return /* reexport */ tool_selector; }, + "Typewriter": function() { return /* reexport */ typewriter; }, + "URLInput": function() { return /* reexport */ url_input; }, + "URLInputButton": function() { return /* reexport */ url_input_button; }, + "URLPopover": function() { return /* reexport */ url_popover; }, + "Warning": function() { return /* reexport */ warning; }, + "WritingFlow": function() { return /* reexport */ writing_flow; }, + "__experimentalBlockAlignmentMatrixControl": function() { return /* reexport */ block_alignment_matrix_control; }, + "__experimentalBlockContentOverlay": function() { return /* reexport */ BlockContentOverlay; }, + "__experimentalBlockFullHeightAligmentControl": function() { return /* reexport */ block_full_height_alignment_control; }, + "__experimentalBlockPatternSetup": function() { return /* reexport */ block_pattern_setup; }, + "__experimentalBlockVariationPicker": function() { return /* reexport */ block_variation_picker; }, + "__experimentalBlockVariationTransforms": function() { return /* reexport */ block_variation_transforms; }, + "__experimentalBorderRadiusControl": function() { return /* reexport */ BorderRadiusControl; }, + "__experimentalBorderStyleControl": function() { return /* reexport */ BorderStyleControl; }, + "__experimentalColorGradientControl": function() { return /* reexport */ control; }, + "__experimentalColorGradientSettingsDropdown": function() { return /* reexport */ ColorGradientSettingsDropdown; }, + "__experimentalDuotoneControl": function() { return /* reexport */ duotone_control; }, + "__experimentalFontAppearanceControl": function() { return /* reexport */ FontAppearanceControl; }, + "__experimentalFontFamilyControl": function() { return /* reexport */ FontFamilyControl; }, + "__experimentalGetBorderClassesAndStyles": function() { return /* reexport */ getBorderClassesAndStyles; }, + "__experimentalGetColorClassesAndStyles": function() { return /* reexport */ getColorClassesAndStyles; }, + "__experimentalGetGradientClass": function() { return /* reexport */ __experimentalGetGradientClass; }, + "__experimentalGetGradientObjectByGradientValue": function() { return /* reexport */ __experimentalGetGradientObjectByGradientValue; }, + "__experimentalGetMatchingVariation": function() { return /* reexport */ __experimentalGetMatchingVariation; }, + "__experimentalGetSpacingClassesAndStyles": function() { return /* reexport */ getSpacingClassesAndStyles; }, + "__experimentalImageEditingProvider": function() { return /* reexport */ ImageEditingProvider; }, + "__experimentalImageEditor": function() { return /* reexport */ ImageEditor; }, + "__experimentalImageSizeControl": function() { return /* reexport */ ImageSizeControl; }, + "__experimentalImageURLInputUI": function() { return /* reexport */ ImageURLInputUI; }, + "__experimentalLayoutStyle": function() { return /* reexport */ LayoutStyle; }, + "__experimentalLetterSpacingControl": function() { return /* reexport */ LetterSpacingControl; }, + "__experimentalLibrary": function() { return /* reexport */ library; }, + "__experimentalLinkControl": function() { return /* reexport */ link_control; }, + "__experimentalLinkControlSearchInput": function() { return /* reexport */ search_input; }, + "__experimentalLinkControlSearchItem": function() { return /* reexport */ search_item; }, + "__experimentalLinkControlSearchResults": function() { return /* reexport */ LinkControlSearchResults; }, + "__experimentalListView": function() { return /* reexport */ components_list_view; }, + "__experimentalPanelColorGradientSettings": function() { return /* reexport */ panel_color_gradient_settings; }, + "__experimentalPreviewOptions": function() { return /* reexport */ PreviewOptions; }, + "__experimentalResponsiveBlockControl": function() { return /* reexport */ responsive_block_control; }, + "__experimentalTextDecorationControl": function() { return /* reexport */ TextDecorationControl; }, + "__experimentalTextTransformControl": function() { return /* reexport */ TextTransformControl; }, + "__experimentalUnitControl": function() { return /* reexport */ UnitControl; }, + "__experimentalUseBlockPreview": function() { return /* reexport */ useBlockPreview; }, + "__experimentalUseBorderProps": function() { return /* reexport */ useBorderProps; }, + "__experimentalUseColorProps": function() { return /* reexport */ useColorProps; }, + "__experimentalUseCustomSides": function() { return /* reexport */ useCustomSides; }, + "__experimentalUseGradient": function() { return /* reexport */ __experimentalUseGradient; }, + "__experimentalUseNoRecursiveRenders": function() { return /* reexport */ useNoRecursiveRenders; }, + "__experimentalUseResizeCanvas": function() { return /* reexport */ useResizeCanvas; }, + "__unstableBlockSettingsMenuFirstItem": function() { return /* reexport */ block_settings_menu_first_item; }, + "__unstableEditorStyles": function() { return /* reexport */ EditorStyles; }, + "__unstableIframe": function() { return /* reexport */ iframe; }, + "__unstableInserterMenuExtension": function() { return /* reexport */ inserter_menu_extension; }, + "__unstableRichTextInputEvent": function() { return /* reexport */ __unstableRichTextInputEvent; }, + "__unstableUseBlockSelectionClearer": function() { return /* reexport */ useBlockSelectionClearer; }, + "__unstableUseCanvasClickRedirect": function() { return /* reexport */ useCanvasClickRedirect; }, + "__unstableUseClipboardHandler": function() { return /* reexport */ useClipboardHandler; }, + "__unstableUseMouseMoveTypingReset": function() { return /* reexport */ useMouseMoveTypingReset; }, + "__unstableUseTypewriter": function() { return /* reexport */ useTypewriter; }, + "__unstableUseTypingObserver": function() { return /* reexport */ useTypingObserver; }, + "createCustomColorsHOC": function() { return /* reexport */ createCustomColorsHOC; }, + "getColorClassName": function() { return /* reexport */ getColorClassName; }, + "getColorObjectByAttributeValues": function() { return /* reexport */ getColorObjectByAttributeValues; }, + "getColorObjectByColorValue": function() { return /* reexport */ getColorObjectByColorValue; }, + "getFontSize": function() { return /* reexport */ getFontSize; }, + "getFontSizeClass": function() { return /* reexport */ getFontSizeClass; }, + "getFontSizeObjectByValue": function() { return /* reexport */ getFontSizeObjectByValue; }, + "getGradientSlugByValue": function() { return /* reexport */ getGradientSlugByValue; }, + "getGradientValueBySlug": function() { return /* reexport */ getGradientValueBySlug; }, + "getPxFromCssUnit": function() { return /* reexport */ parse_css_unit_to_px; }, + "store": function() { return /* reexport */ store; }, + "storeConfig": function() { return /* reexport */ storeConfig; }, + "transformStyles": function() { return /* reexport */ transform_styles; }, + "useBlockDisplayInformation": function() { return /* reexport */ useBlockDisplayInformation; }, + "useBlockEditContext": function() { return /* reexport */ useBlockEditContext; }, + "useBlockProps": function() { return /* reexport */ useBlockProps; }, + "useCachedTruthy": function() { return /* reexport */ useCachedTruthy; }, + "useInnerBlocksProps": function() { return /* reexport */ useInnerBlocksProps; }, + "useSetting": function() { return /* reexport */ useSetting; }, + "validateThemeColors": function() { return /* reexport */ validateThemeColors; }, + "validateThemeGradients": function() { return /* reexport */ validateThemeGradients; }, + "withColorContext": function() { return /* reexport */ with_color_context; }, + "withColors": function() { return /* reexport */ withColors; }, + "withFontSizes": function() { return /* reexport */ with_font_sizes; } +}); -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-underline.js - - -/** - * WordPress dependencies - */ - -const formatUnderline = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z" -})); -/* harmony default export */ var format_underline = (formatUnderline); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js -var format_strikethrough = __webpack_require__("Crq9"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js +var selectors_namespaceObject = {}; +__webpack_require__.r(selectors_namespaceObject); +__webpack_require__.d(selectors_namespaceObject, { + "__experimentalGetActiveBlockIdByBlockNames": function() { return __experimentalGetActiveBlockIdByBlockNames; }, + "__experimentalGetAllowedBlocks": function() { return __experimentalGetAllowedBlocks; }, + "__experimentalGetAllowedPatterns": function() { return __experimentalGetAllowedPatterns; }, + "__experimentalGetBlockListSettingsForBlocks": function() { return __experimentalGetBlockListSettingsForBlocks; }, + "__experimentalGetDirectInsertBlock": function() { return __experimentalGetDirectInsertBlock; }, + "__experimentalGetLastBlockAttributeChanges": function() { return __experimentalGetLastBlockAttributeChanges; }, + "__experimentalGetParsedPattern": function() { return __experimentalGetParsedPattern; }, + "__experimentalGetPatternTransformItems": function() { return __experimentalGetPatternTransformItems; }, + "__experimentalGetPatternsByBlockTypes": function() { return __experimentalGetPatternsByBlockTypes; }, + "__experimentalGetReusableBlockTitle": function() { return __experimentalGetReusableBlockTitle; }, + "__unstableGetBlockWithoutInnerBlocks": function() { return __unstableGetBlockWithoutInnerBlocks; }, + "__unstableGetClientIdWithClientIdsTree": function() { return __unstableGetClientIdWithClientIdsTree; }, + "__unstableGetClientIdsTree": function() { return __unstableGetClientIdsTree; }, + "__unstableIsLastBlockChangeIgnored": function() { return __unstableIsLastBlockChangeIgnored; }, + "areInnerBlocksControlled": function() { return areInnerBlocksControlled; }, + "canInsertBlockType": function() { return canInsertBlockType; }, + "canInsertBlocks": function() { return canInsertBlocks; }, + "canMoveBlock": function() { return canMoveBlock; }, + "canMoveBlocks": function() { return canMoveBlocks; }, + "canRemoveBlock": function() { return canRemoveBlock; }, + "canRemoveBlocks": function() { return canRemoveBlocks; }, + "didAutomaticChange": function() { return didAutomaticChange; }, + "getAdjacentBlockClientId": function() { return getAdjacentBlockClientId; }, + "getBlock": function() { return getBlock; }, + "getBlockAttributes": function() { return getBlockAttributes; }, + "getBlockCount": function() { return getBlockCount; }, + "getBlockHierarchyRootClientId": function() { return getBlockHierarchyRootClientId; }, + "getBlockIndex": function() { return getBlockIndex; }, + "getBlockInsertionPoint": function() { return getBlockInsertionPoint; }, + "getBlockListSettings": function() { return getBlockListSettings; }, + "getBlockMode": function() { return getBlockMode; }, + "getBlockName": function() { return getBlockName; }, + "getBlockOrder": function() { return getBlockOrder; }, + "getBlockParents": function() { return getBlockParents; }, + "getBlockParentsByBlockName": function() { return getBlockParentsByBlockName; }, + "getBlockRootClientId": function() { return getBlockRootClientId; }, + "getBlockSelectionEnd": function() { return getBlockSelectionEnd; }, + "getBlockSelectionStart": function() { return getBlockSelectionStart; }, + "getBlockTransformItems": function() { return getBlockTransformItems; }, + "getBlocks": function() { return getBlocks; }, + "getBlocksByClientId": function() { return getBlocksByClientId; }, + "getClientIdsOfDescendants": function() { return getClientIdsOfDescendants; }, + "getClientIdsWithDescendants": function() { return getClientIdsWithDescendants; }, + "getDraggedBlockClientIds": function() { return getDraggedBlockClientIds; }, + "getFirstMultiSelectedBlockClientId": function() { return getFirstMultiSelectedBlockClientId; }, + "getGlobalBlockCount": function() { return getGlobalBlockCount; }, + "getInserterItems": function() { return getInserterItems; }, + "getLastMultiSelectedBlockClientId": function() { return getLastMultiSelectedBlockClientId; }, + "getLowestCommonAncestorWithSelectedBlock": function() { return getLowestCommonAncestorWithSelectedBlock; }, + "getMultiSelectedBlockClientIds": function() { return getMultiSelectedBlockClientIds; }, + "getMultiSelectedBlocks": function() { return getMultiSelectedBlocks; }, + "getMultiSelectedBlocksEndClientId": function() { return getMultiSelectedBlocksEndClientId; }, + "getMultiSelectedBlocksStartClientId": function() { return getMultiSelectedBlocksStartClientId; }, + "getNextBlockClientId": function() { return getNextBlockClientId; }, + "getPreviousBlockClientId": function() { return getPreviousBlockClientId; }, + "getSelectedBlock": function() { return getSelectedBlock; }, + "getSelectedBlockClientId": function() { return getSelectedBlockClientId; }, + "getSelectedBlockClientIds": function() { return getSelectedBlockClientIds; }, + "getSelectedBlockCount": function() { return getSelectedBlockCount; }, + "getSelectedBlocksInitialCaretPosition": function() { return getSelectedBlocksInitialCaretPosition; }, + "getSelectionEnd": function() { return getSelectionEnd; }, + "getSelectionStart": function() { return getSelectionStart; }, + "getSettings": function() { return getSettings; }, + "getTemplate": function() { return getTemplate; }, + "getTemplateLock": function() { return getTemplateLock; }, + "hasBlockMovingClientId": function() { return selectors_hasBlockMovingClientId; }, + "hasInserterItems": function() { return hasInserterItems; }, + "hasMultiSelection": function() { return hasMultiSelection; }, + "hasSelectedBlock": function() { return hasSelectedBlock; }, + "hasSelectedInnerBlock": function() { return hasSelectedInnerBlock; }, + "isAncestorBeingDragged": function() { return isAncestorBeingDragged; }, + "isAncestorMultiSelected": function() { return isAncestorMultiSelected; }, + "isBlockBeingDragged": function() { return isBlockBeingDragged; }, + "isBlockHighlighted": function() { return isBlockHighlighted; }, + "isBlockInsertionPointVisible": function() { return isBlockInsertionPointVisible; }, + "isBlockMultiSelected": function() { return isBlockMultiSelected; }, + "isBlockSelected": function() { return isBlockSelected; }, + "isBlockValid": function() { return isBlockValid; }, + "isBlockWithinSelection": function() { return isBlockWithinSelection; }, + "isCaretWithinFormattedText": function() { return selectors_isCaretWithinFormattedText; }, + "isDraggingBlocks": function() { return isDraggingBlocks; }, + "isFirstMultiSelectedBlock": function() { return isFirstMultiSelectedBlock; }, + "isLastBlockChangePersistent": function() { return isLastBlockChangePersistent; }, + "isMultiSelecting": function() { return selectors_isMultiSelecting; }, + "isNavigationMode": function() { return selectors_isNavigationMode; }, + "isSelectionEnabled": function() { return selectors_isSelectionEnabled; }, + "isTyping": function() { return selectors_isTyping; }, + "isValidTemplate": function() { return isValidTemplate; }, + "wasBlockJustInserted": function() { return wasBlockJustInserted; } +}); +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/actions.js +var actions_namespaceObject = {}; +__webpack_require__.r(actions_namespaceObject); +__webpack_require__.d(actions_namespaceObject, { + "__unstableMarkAutomaticChange": function() { return __unstableMarkAutomaticChange; }, + "__unstableMarkLastChangeAsPersistent": function() { return __unstableMarkLastChangeAsPersistent; }, + "__unstableMarkNextChangeAsNotPersistent": function() { return __unstableMarkNextChangeAsNotPersistent; }, + "__unstableSaveReusableBlock": function() { return __unstableSaveReusableBlock; }, + "clearSelectedBlock": function() { return clearSelectedBlock; }, + "duplicateBlocks": function() { return duplicateBlocks; }, + "enterFormattedText": function() { return enterFormattedText; }, + "exitFormattedText": function() { return exitFormattedText; }, + "flashBlock": function() { return flashBlock; }, + "hideInsertionPoint": function() { return hideInsertionPoint; }, + "insertAfterBlock": function() { return insertAfterBlock; }, + "insertBeforeBlock": function() { return insertBeforeBlock; }, + "insertBlock": function() { return insertBlock; }, + "insertBlocks": function() { return insertBlocks; }, + "insertDefaultBlock": function() { return insertDefaultBlock; }, + "mergeBlocks": function() { return mergeBlocks; }, + "moveBlockToPosition": function() { return moveBlockToPosition; }, + "moveBlocksDown": function() { return moveBlocksDown; }, + "moveBlocksToPosition": function() { return moveBlocksToPosition; }, + "moveBlocksUp": function() { return moveBlocksUp; }, + "multiSelect": function() { return multiSelect; }, + "receiveBlocks": function() { return receiveBlocks; }, + "removeBlock": function() { return removeBlock; }, + "removeBlocks": function() { return removeBlocks; }, + "replaceBlock": function() { return replaceBlock; }, + "replaceBlocks": function() { return replaceBlocks; }, + "replaceInnerBlocks": function() { return replaceInnerBlocks; }, + "resetBlocks": function() { return resetBlocks; }, + "resetSelection": function() { return resetSelection; }, + "selectBlock": function() { return selectBlock; }, + "selectNextBlock": function() { return selectNextBlock; }, + "selectPreviousBlock": function() { return selectPreviousBlock; }, + "selectionChange": function() { return selectionChange; }, + "setBlockMovingClientId": function() { return setBlockMovingClientId; }, + "setHasControlledInnerBlocks": function() { return setHasControlledInnerBlocks; }, + "setNavigationMode": function() { return setNavigationMode; }, + "setTemplateValidity": function() { return setTemplateValidity; }, + "showInsertionPoint": function() { return showInsertionPoint; }, + "startDraggingBlocks": function() { return startDraggingBlocks; }, + "startMultiSelect": function() { return startMultiSelect; }, + "startTyping": function() { return startTyping; }, + "stopDraggingBlocks": function() { return stopDraggingBlocks; }, + "stopMultiSelect": function() { return stopMultiSelect; }, + "stopTyping": function() { return stopTyping; }, + "synchronizeTemplate": function() { return synchronizeTemplate; }, + "toggleBlockHighlight": function() { return toggleBlockHighlight; }, + "toggleBlockMode": function() { return toggleBlockMode; }, + "toggleSelection": function() { return toggleSelection; }, + "updateBlock": function() { return updateBlock; }, + "updateBlockAttributes": function() { return updateBlockAttributes; }, + "updateBlockListSettings": function() { return updateBlockListSettings; }, + "updateSettings": function() { return updateSettings; }, + "validateBlocksToTemplate": function() { return validateBlocksToTemplate; } +}); +;// CONCATENATED MODULE: external ["wp","blocks"] +var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; +;// CONCATENATED MODULE: external ["wp","hooks"] +var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/compat.js /** * WordPress dependencies */ -const TEXT_DECORATIONS = [{ - name: Object(external_wp_i18n_["__"])('Underline'), - value: 'underline', - icon: format_underline -}, { - name: Object(external_wp_i18n_["__"])('Strikethrough'), - value: 'line-through', - icon: format_strikethrough["a" /* default */] -}]; -/** - * Control to facilitate text decoration selections. - * - * @param {Object} props Component props. - * @param {string} props.value Currently selected text decoration. - * @param {Function} props.onChange Handles change in text decoration selection. - * - * @return {WPElement} Text decoration control. - */ +function migrateLightBlockWrapper(settings) { + const { + apiVersion = 1 + } = settings; -function TextDecorationControl(_ref) { - let { - value, - onChange - } = _ref; - return Object(external_wp_element_["createElement"])("fieldset", { - className: "block-editor-text-decoration-control" - }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_i18n_["__"])('Decoration')), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-text-decoration-control__buttons" - }, TEXT_DECORATIONS.map(textDecoration => { - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: textDecoration.value, - icon: textDecoration.icon, - isSmall: true, - isPressed: textDecoration.value === value, - onClick: () => onChange(textDecoration.value === value ? undefined : textDecoration.value), - "aria-label": textDecoration.name - }); - }))); + if (apiVersion < 2 && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'lightBlockWrapper', false)) { + settings.apiVersion = 2; + } + + return settings; } +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/compat/migrateLightBlockWrapper', migrateLightBlockWrapper); -/***/ }), - -/***/ "kWXm": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const justifyLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M9 9v6h11V9H9zM4 20h1.5V4H4v16z" -})); -/* harmony default export */ __webpack_exports__["a"] = (justifyLeft); - - -/***/ }), - -/***/ "kaUp": -/***/ (function(module, exports) { - - - -/***/ }), - -/***/ "kmrn": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export BailSignal */ -/* unused harmony export Controller */ -/* unused harmony export FrameValue */ -/* unused harmony export Interpolation */ -/* unused harmony export Spring */ -/* unused harmony export SpringContext */ -/* unused harmony export SpringRef */ -/* unused harmony export SpringValue */ -/* unused harmony export Trail */ -/* unused harmony export Transition */ -/* unused harmony export config */ -/* unused harmony export easings */ -/* unused harmony export inferTo */ -/* unused harmony export interpolate */ -/* unused harmony export to */ -/* unused harmony export update */ -/* unused harmony export useChain */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useSpring", function() { return useSpring; }); -/* unused harmony export useSpringRef */ -/* unused harmony export useSprings */ -/* unused harmony export useTrail */ -/* unused harmony export useTransition */ -/* harmony import */ var _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("nEW0"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Globals", function() { return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__["b"]; }); - -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("cDcd"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("dfZa"); -/* harmony import */ var _react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("kaUp"); -/* harmony import */ var _react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("v8Ku"); -/* harmony import */ var _react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4__); - - - - - - - - +;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { @@ -34574,2579 +3089,41 @@ function _extends() { return _extends.apply(this, arguments); } +;// CONCATENATED MODULE: external ["wp","element"] +var external_wp_element_namespaceObject = window["wp"]["element"]; +// EXTERNAL MODULE: ./node_modules/classnames/index.js +var classnames = __webpack_require__(4403); +var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); +;// CONCATENATED MODULE: external "lodash" +var external_lodash_namespaceObject = window["lodash"]; +;// CONCATENATED MODULE: external ["wp","compose"] +var external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// CONCATENATED MODULE: external ["wp","components"] +var external_wp_components_namespaceObject = window["wp"]["components"]; +;// CONCATENATED MODULE: external ["wp","data"] +var external_wp_data_namespaceObject = window["wp"]["data"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/groups.js +/** + * WordPress dependencies + */ -function callProp(value, ...args) { - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(value) ? value(...args) : value; -} -const matchProp = (value, key) => value === true || !!(key && value && (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(value) ? value(key) : Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(value).includes(key))); -const resolveProp = (prop, key) => _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(prop) ? key && prop[key] : prop; -const getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : undefined; - -const noopTransform = value => value; - -const getDefaultProps = (props, transform = noopTransform) => { - let keys = DEFAULT_PROPS; - - if (props.default && props.default !== true) { - props = props.default; - keys = Object.keys(props); - } - - const defaults = {}; - - for (const key of keys) { - const value = transform(props[key], key); - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(value)) { - defaults[key] = value; - } - } - - return defaults; -}; -const DEFAULT_PROPS = ['config', 'onProps', 'onStart', 'onChange', 'onPause', 'onResume', 'onRest']; -const RESERVED_PROPS = { - 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 +const BlockControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControls'); +const BlockControlsBlock = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControlsBlock'); +const BlockControlsInline = (0,external_wp_components_namespaceObject.createSlotFill)('BlockFormatControls'); +const BlockControlsOther = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControlsOther'); +const BlockControlsParent = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControlsParent'); +const groups = { + default: BlockControlsDefault, + block: BlockControlsBlock, + inline: BlockControlsInline, + other: BlockControlsOther, + parent: BlockControlsParent }; +/* harmony default export */ var block_controls_groups = (groups); -function getForwardProps(props) { - const forward = {}; - let count = 0; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(props, (value, prop) => { - if (!RESERVED_PROPS[prop]) { - forward[prop] = value; - count++; - } - }); - - if (count) { - return forward; - } -} - -function inferTo(props) { - const to = getForwardProps(props); - - if (to) { - const out = { - to - }; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(props, (val, key) => key in to || (out[key] = val)); - return out; - } - - return _extends({}, props); -} -function computeGoal(value) { - value = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(value); - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(value) ? value.map(computeGoal) : Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isAnimatedString */ "t"])(value) ? _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].createStringInterpolator({ - range: [0, 1], - output: [value, value] - })(1) : value; -} -function hasProps(props) { - for (const _ in props) return true; - - return false; -} -function isAsyncTo(to) { - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(to) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(to) && _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(to[0]); -} -function detachRefs(ctrl, ref) { - var _ctrl$ref; - - (_ctrl$ref = ctrl.ref) == null ? void 0 : _ctrl$ref.delete(ctrl); - ref == null ? void 0 : ref.delete(ctrl); -} -function replaceRef(ctrl, ref) { - if (ref && ctrl.ref !== ref) { - var _ctrl$ref2; - - (_ctrl$ref2 = ctrl.ref) == null ? void 0 : _ctrl$ref2.delete(ctrl); - ref.add(ctrl); - ctrl.ref = ref; - } -} - -function useChain(refs, timeSteps, timeFrame = 1000) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => { - if (timeSteps) { - let prevDelay = 0; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(refs, (ref, i) => { - const controllers = ref.current; - - if (controllers.length) { - let delay = timeFrame * timeSteps[i]; - if (isNaN(delay)) delay = prevDelay;else prevDelay = delay; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(controllers, ctrl => { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ctrl.queue, props => { - const memoizedDelayProp = props.delay; - - props.delay = key => delay + callProp(memoizedDelayProp || 0, key); - }); - }); - ref.start(); - } - }); - } else { - let p = Promise.resolve(); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(refs, ref => { - const controllers = ref.current; - - if (controllers.length) { - const queues = controllers.map(ctrl => { - const q = ctrl.queue; - ctrl.queue = []; - return q; - }); - p = p.then(() => { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(controllers, (ctrl, i) => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(queues[i] || [], update => ctrl.queue.push(update))); - return Promise.all(ref.start()); - }); - } - }); - } - }); -} - -const config = { - default: { - tension: 170, - friction: 26 - }, - gentle: { - tension: 120, - friction: 14 - }, - wobbly: { - tension: 180, - friction: 12 - }, - stiff: { - tension: 210, - friction: 20 - }, - slow: { - tension: 280, - friction: 60 - }, - molasses: { - tension: 280, - friction: 120 - } -}; -const c1 = 1.70158; -const c2 = c1 * 1.525; -const c3 = c1 + 1; -const c4 = 2 * Math.PI / 3; -const c5 = 2 * Math.PI / 4.5; - -const bounceOut = x => { - const n1 = 7.5625; - const d1 = 2.75; - - if (x < 1 / d1) { - return n1 * x * x; - } else if (x < 2 / d1) { - return n1 * (x -= 1.5 / d1) * x + 0.75; - } else if (x < 2.5 / d1) { - return n1 * (x -= 2.25 / d1) * x + 0.9375; - } else { - return n1 * (x -= 2.625 / d1) * x + 0.984375; - } -}; - -const easings = { - linear: x => x, - easeInQuad: x => x * x, - easeOutQuad: x => 1 - (1 - x) * (1 - x), - easeInOutQuad: x => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2, - easeInCubic: x => x * x * x, - easeOutCubic: x => 1 - Math.pow(1 - x, 3), - easeInOutCubic: x => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2, - easeInQuart: x => x * x * x * x, - easeOutQuart: x => 1 - Math.pow(1 - x, 4), - easeInOutQuart: x => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2, - easeInQuint: x => x * x * x * x * x, - easeOutQuint: x => 1 - Math.pow(1 - x, 5), - easeInOutQuint: x => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2, - easeInSine: x => 1 - Math.cos(x * Math.PI / 2), - easeOutSine: x => Math.sin(x * Math.PI / 2), - easeInOutSine: x => -(Math.cos(Math.PI * x) - 1) / 2, - easeInExpo: x => x === 0 ? 0 : Math.pow(2, 10 * x - 10), - easeOutExpo: x => x === 1 ? 1 : 1 - Math.pow(2, -10 * x), - easeInOutExpo: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2, - easeInCirc: x => 1 - Math.sqrt(1 - Math.pow(x, 2)), - easeOutCirc: x => Math.sqrt(1 - Math.pow(x - 1, 2)), - easeInOutCirc: x => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2, - easeInBack: x => c3 * x * x * x - c1 * x * x, - easeOutBack: x => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2), - easeInOutBack: x => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2, - easeInElastic: x => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4), - easeOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1, - easeInOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1, - easeInBounce: x => 1 - bounceOut(1 - x), - easeOutBounce: bounceOut, - easeInOutBounce: x => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2 -}; - -const defaults = _extends({}, config.default, { - mass: 1, - damping: 1, - easing: easings.linear, - clamp: false -}); - -class AnimationConfig { - constructor() { - this.tension = void 0; - this.friction = void 0; - this.frequency = void 0; - this.damping = void 0; - this.mass = void 0; - this.velocity = 0; - this.restVelocity = void 0; - this.precision = void 0; - this.progress = void 0; - this.duration = void 0; - this.easing = void 0; - this.clamp = void 0; - this.bounce = void 0; - this.decay = void 0; - this.round = void 0; - Object.assign(this, defaults); - } - -} -function mergeConfig(config, newConfig, defaultConfig) { - if (defaultConfig) { - defaultConfig = _extends({}, defaultConfig); - sanitizeConfig(defaultConfig, newConfig); - newConfig = _extends({}, defaultConfig, newConfig); - } - - sanitizeConfig(config, newConfig); - Object.assign(config, newConfig); - - for (const key in defaults) { - if (config[key] == null) { - config[key] = defaults[key]; - } - } - - let { - mass, - frequency, - damping - } = config; - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(frequency)) { - if (frequency < 0.01) frequency = 0.01; - if (damping < 0) damping = 0; - config.tension = Math.pow(2 * Math.PI / frequency, 2) * mass; - config.friction = 4 * Math.PI * damping * mass / frequency; - } - - return config; -} - -function sanitizeConfig(config, props) { - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.decay)) { - config.duration = undefined; - } else { - const isTensionConfig = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.tension) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.friction); - - if (isTensionConfig || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.frequency) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.damping) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.mass)) { - config.duration = undefined; - config.decay = undefined; - } - - if (isTensionConfig) { - config.frequency = undefined; - } - } -} - -const emptyArray = []; -class Animation { - constructor() { - this.changed = false; - this.values = emptyArray; - this.toValues = null; - this.fromValues = emptyArray; - this.to = void 0; - this.from = void 0; - this.config = new AnimationConfig(); - this.immediate = false; - } - -} - -function scheduleProps(callId, { - key, - props, - defaultProps, - state, - actions -}) { - return new Promise((resolve, reject) => { - var _props$cancel; - - let delay; - let timeout; - let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key); - - if (cancel) { - onStart(); - } else { - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.pause)) { - state.paused = matchProp(props.pause, key); - } - - let pause = defaultProps == null ? void 0 : defaultProps.pause; - - if (pause !== true) { - pause = state.paused || matchProp(pause, key); - } - - delay = callProp(props.delay || 0, key); - - if (pause) { - state.resumeQueue.add(onResume); - actions.pause(); - } else { - actions.resume(); - onResume(); - } - } - - function onPause() { - state.resumeQueue.add(onResume); - state.timeouts.delete(timeout); - timeout.cancel(); - delay = timeout.time - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].now(); - } - - function onResume() { - if (delay > 0 && !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].skipAnimation) { - state.delayed = true; - timeout = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].setTimeout(onStart, delay); - state.pauseQueue.add(onPause); - state.timeouts.add(timeout); - } else { - onStart(); - } - } - - function onStart() { - if (state.delayed) { - state.delayed = false; - } - - state.pauseQueue.delete(onPause); - state.timeouts.delete(timeout); - - if (callId <= (state.cancelId || 0)) { - cancel = true; - } - - try { - actions.start(_extends({}, props, { - callId, - cancel - }), resolve); - } catch (err) { - reject(err); - } - } - }); -} - -const getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some(result => result.cancelled) ? getCancelledResult(target.get()) : results.every(result => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every(result => result.finished)); -const getNoopResult = value => ({ - value, - noop: true, - finished: true, - cancelled: false -}); -const getFinishedResult = (value, finished, cancelled = false) => ({ - value, - finished, - cancelled -}); -const getCancelledResult = value => ({ - value, - cancelled: true, - finished: false -}); - -function runAsync(to, props, state, target) { - const { - callId, - parentId, - onRest - } = props; - const { - asyncTo: prevTo, - promise: prevPromise - } = state; - - if (!parentId && to === prevTo && !props.reset) { - return prevPromise; - } - - return state.promise = (async () => { - state.asyncId = callId; - state.asyncTo = to; - const defaultProps = getDefaultProps(props, (value, key) => key === 'onRest' ? undefined : value); - let preventBail; - let bail; - const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject)); - - const bailIfEnded = bailSignal => { - const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false); - - if (bailResult) { - bailSignal.result = bailResult; - bail(bailSignal); - throw bailSignal; - } - }; - - const animate = (arg1, arg2) => { - const bailSignal = new BailSignal(); - const skipAnimationSignal = new SkipAniamtionSignal(); - return (async () => { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].skipAnimation) { - stopAsync(state); - skipAnimationSignal.result = getFinishedResult(target, false); - bail(skipAnimationSignal); - throw skipAnimationSignal; - } - - bailIfEnded(bailSignal); - const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, { - to: arg1 - }); - props.parentId = callId; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(defaultProps, (value, key) => { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props[key])) { - props[key] = value; - } - }); - const result = await target.start(props); - bailIfEnded(bailSignal); - - if (state.paused) { - await new Promise(resume => { - state.resumeQueue.add(resume); - }); - } - - return result; - })(); - }; - - let result; - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].skipAnimation) { - stopAsync(state); - return getFinishedResult(target, false); - } - - try { - let animating; - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(to)) { - animating = (async queue => { - for (const props of queue) { - await animate(props); - } - })(to); - } else { - animating = Promise.resolve(to(animate, target.stop.bind(target))); - } - - await Promise.all([animating.then(preventBail), bailPromise]); - result = getFinishedResult(target.get(), true, false); - } catch (err) { - if (err instanceof BailSignal) { - result = err.result; - } else if (err instanceof SkipAniamtionSignal) { - result = err.result; - } else { - throw err; - } - } finally { - if (callId == state.asyncId) { - state.asyncId = parentId; - state.asyncTo = parentId ? prevTo : undefined; - state.promise = parentId ? prevPromise : undefined; - } - } - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(onRest)) { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => { - onRest(result, target, target.item); - }); - } - - return result; - })(); -} -function stopAsync(state, cancelId) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flush */ "m"])(state.timeouts, t => t.cancel()); - state.pauseQueue.clear(); - state.resumeQueue.clear(); - state.asyncId = state.asyncTo = state.promise = undefined; - if (cancelId) state.cancelId = cancelId; -} -class BailSignal extends Error { - constructor() { - super('An async animation has been interrupted. You see this error because you ' + 'forgot to use `await` or `.catch(...)` on its returned promise.'); - this.result = void 0; - } - -} -class SkipAniamtionSignal extends Error { - constructor() { - super('SkipAnimationSignal'); - this.result = void 0; - } - -} - -const isFrameValue = value => value instanceof FrameValue; -let nextId$1 = 1; -class FrameValue extends _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* FluidValue */ "a"] { - constructor(...args) { - super(...args); - this.id = nextId$1++; - this.key = void 0; - this._priority = 0; - } - - get priority() { - return this._priority; - } - - set priority(priority) { - if (this._priority != priority) { - this._priority = priority; - - this._onPriorityChange(priority); - } - } - - get() { - const node = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this); - return node && node.getValue(); - } - - to(...args) { - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].to(this, args); - } - - interpolate(...args) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* deprecateInterpolate */ "j"])(); - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].to(this, args); - } - - toJSON() { - return this.get(); - } - - observerAdded(count) { - if (count == 1) this._attach(); - } - - observerRemoved(count) { - if (count == 0) this._detach(); - } - - _attach() {} - - _detach() {} - - _onChange(value, idle = false) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* callFluidObservers */ "d"])(this, { - type: 'change', - parent: this, - value, - idle - }); - } - - _onPriorityChange(priority) { - if (!this.idle) { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* frameLoop */ "o"].sort(this); - } - - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* callFluidObservers */ "d"])(this, { - type: 'priority', - parent: this, - priority - }); - } - -} - -const $P = Symbol.for('SpringPhase'); -const HAS_ANIMATED = 1; -const IS_ANIMATING = 2; -const IS_PAUSED = 4; -const hasAnimated = target => (target[$P] & HAS_ANIMATED) > 0; -const isAnimating = target => (target[$P] & IS_ANIMATING) > 0; -const isPaused = target => (target[$P] & IS_PAUSED) > 0; -const setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING; -const setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED; - -class SpringValue extends FrameValue { - constructor(arg1, arg2) { - super(); - this.key = void 0; - this.animation = new Animation(); - this.queue = void 0; - this.defaultProps = {}; - this._state = { - paused: false, - delayed: false, - pauseQueue: new Set(), - resumeQueue: new Set(), - timeouts: new Set() - }; - this._pendingCalls = new Set(); - this._lastCallId = 0; - this._lastToId = 0; - this._memoizedDuration = 0; - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(arg1) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(arg2)) { - const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, { - from: arg1 - }); - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.default)) { - props.default = true; - } - - this.start(props); - } - } - - get idle() { - return !(isAnimating(this) || this._state.asyncTo) || isPaused(this); - } - - get goal() { - return Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(this.animation.to); - } - - get velocity() { - const node = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this); - return node instanceof _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* AnimatedValue */ "c"] ? node.lastVelocity || 0 : node.getPayload().map(node => node.lastVelocity || 0); - } - - get hasAnimated() { - return hasAnimated(this); - } - - get isAnimating() { - return isAnimating(this); - } - - get isPaused() { - return isPaused(this); - } - - get isDelayed() { - return this._state.delayed; - } - - advance(dt) { - let idle = true; - let changed = false; - const anim = this.animation; - let { - config, - toValues - } = anim; - const payload = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getPayload */ "g"])(anim.to); - - if (!payload && Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(anim.to)) { - toValues = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(anim.to)); - } - - anim.values.forEach((node, i) => { - if (node.done) return; - const to = node.constructor == _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* AnimatedString */ "b"] ? 1 : payload ? payload[i].lastPosition : toValues[i]; - let finished = anim.immediate; - let position = to; - - if (!finished) { - position = node.lastPosition; - - if (config.tension <= 0) { - node.done = true; - return; - } - - let elapsed = node.elapsedTime += dt; - const from = anim.fromValues[i]; - const v0 = node.v0 != null ? node.v0 : node.v0 = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(config.velocity) ? config.velocity[i] : config.velocity; - let velocity; - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(config.duration)) { - let p = 1; - - if (config.duration > 0) { - if (this._memoizedDuration !== config.duration) { - this._memoizedDuration = config.duration; - - if (node.durationProgress > 0) { - node.elapsedTime = config.duration * node.durationProgress; - elapsed = node.elapsedTime += dt; - } - } - - p = (config.progress || 0) + elapsed / this._memoizedDuration; - p = p > 1 ? 1 : p < 0 ? 0 : p; - node.durationProgress = p; - } - - position = from + config.easing(p) * (to - from); - velocity = (position - node.lastPosition) / dt; - finished = p == 1; - } else if (config.decay) { - const decay = config.decay === true ? 0.998 : config.decay; - const e = Math.exp(-(1 - decay) * elapsed); - position = from + v0 / (1 - decay) * (1 - e); - finished = Math.abs(node.lastPosition - position) < 0.1; - velocity = v0 * e; - } else { - velocity = node.lastVelocity == null ? v0 : node.lastVelocity; - const precision = config.precision || (from == to ? 0.005 : Math.min(1, Math.abs(to - from) * 0.001)); - const restVelocity = config.restVelocity || precision / 10; - const bounceFactor = config.clamp ? 0 : config.bounce; - const canBounce = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(bounceFactor); - const isGrowing = from == to ? node.v0 > 0 : from < to; - let isMoving; - let isBouncing = false; - const step = 1; - const numSteps = Math.ceil(dt / step); - - for (let n = 0; n < numSteps; ++n) { - isMoving = Math.abs(velocity) > restVelocity; - - if (!isMoving) { - finished = Math.abs(to - position) <= precision; - - if (finished) { - break; - } - } - - if (canBounce) { - isBouncing = position == to || position > to == isGrowing; - - if (isBouncing) { - velocity = -velocity * bounceFactor; - position = to; - } - } - - const springForce = -config.tension * 0.000001 * (position - to); - const dampingForce = -config.friction * 0.001 * velocity; - const acceleration = (springForce + dampingForce) / config.mass; - velocity = velocity + acceleration * step; - position = position + velocity * step; - } - } - - node.lastVelocity = velocity; - - if (Number.isNaN(position)) { - console.warn(`Got NaN while animating:`, this); - finished = true; - } - } - - if (payload && !payload[i].done) { - finished = false; - } - - if (finished) { - node.done = true; - } else { - idle = false; - } - - if (node.setValue(position, config.round)) { - changed = true; - } - }); - const node = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this); - const currVal = node.getValue(); - - if (idle) { - const finalVal = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(anim.to); - - if ((currVal !== finalVal || changed) && !config.decay) { - node.setValue(finalVal); - - this._onChange(finalVal); - } else if (changed && config.decay) { - this._onChange(currVal); - } - - this._stop(); - } else if (changed) { - this._onChange(currVal); - } - } - - set(value) { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => { - this._stop(); - - this._focus(value); - - this._set(value); - }); - return this; - } - - pause() { - this._update({ - pause: true - }); - } - - resume() { - this._update({ - pause: false - }); - } - - finish() { - if (isAnimating(this)) { - const { - to, - config - } = this.animation; - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => { - this._onStart(); - - if (!config.decay) { - this._set(to, false); - } - - this._stop(); - }); - } - - return this; - } - - update(props) { - const queue = this.queue || (this.queue = []); - queue.push(props); - return this; - } - - start(to, arg2) { - let queue; - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(to)) { - queue = [_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(to) ? to : _extends({}, arg2, { - to - })]; - } else { - queue = this.queue || []; - this.queue = []; - } - - return Promise.all(queue.map(props => { - const up = this._update(props); - - return up; - })).then(results => getCombinedResult(this, results)); - } - - stop(cancel) { - const { - to - } = this.animation; - - this._focus(this.get()); - - stopAsync(this._state, cancel && this._lastCallId); - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => this._stop(to, cancel)); - return this; - } - - reset() { - this._update({ - reset: true - }); - } - - eventObserved(event) { - if (event.type == 'change') { - this._start(); - } else if (event.type == 'priority') { - this.priority = event.priority + 1; - } - } - - _prepareNode(props) { - const key = this.key || ''; - let { - to, - from - } = props; - to = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(to) ? to[key] : to; - - if (to == null || isAsyncTo(to)) { - to = undefined; - } - - from = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(from) ? from[key] : from; - - if (from == null) { - from = undefined; - } - - const range = { - to, - from - }; - - if (!hasAnimated(this)) { - if (props.reverse) [to, from] = [from, to]; - from = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(from); - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(from)) { - this._set(from); - } else if (!Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this)) { - this._set(to); - } - } - - return range; - } - - _update(_ref, isLoop) { - let props = _extends({}, _ref); - - const { - key, - defaultProps - } = this; - if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value)); - mergeActiveFn(this, props, 'onProps'); - sendEvent(this, 'onProps', props, this); - - const range = this._prepareNode(props); - - 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?'); - } - - const state = this._state; - return scheduleProps(++this._lastCallId, { - key, - props, - defaultProps, - state, - actions: { - pause: () => { - if (!isPaused(this)) { - setPausedBit(this, true); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flushCalls */ "n"])(state.pauseQueue); - sendEvent(this, 'onPause', getFinishedResult(this, checkFinished(this, this.animation.to)), this); - } - }, - resume: () => { - if (isPaused(this)) { - setPausedBit(this, false); - - if (isAnimating(this)) { - this._resume(); - } - - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flushCalls */ "n"])(state.resumeQueue); - sendEvent(this, 'onResume', getFinishedResult(this, checkFinished(this, this.animation.to)), this); - } - }, - start: this._merge.bind(this, range) - } - }).then(result => { - if (props.loop && result.finished && !(isLoop && result.noop)) { - const nextProps = createLoopUpdate(props); - - if (nextProps) { - return this._update(nextProps, true); - } - } - - return result; - }); - } - - _merge(range, props, resolve) { - if (props.cancel) { - this.stop(true); - return resolve(getCancelledResult(this)); - } - - const hasToProp = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(range.to); - const hasFromProp = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(range.from); - - if (hasToProp || hasFromProp) { - if (props.callId > this._lastToId) { - this._lastToId = props.callId; - } else { - return resolve(getCancelledResult(this)); - } - } - - const { - key, - defaultProps, - animation: anim - } = this; - const { - to: prevTo, - from: prevFrom - } = anim; - let { - to = prevTo, - from = prevFrom - } = range; - - if (hasFromProp && !hasToProp && (!props.default || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(to))) { - to = from; - } - - if (props.reverse) [to, from] = [from, to]; - const hasFromChanged = !Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(from, prevFrom); - - if (hasFromChanged) { - anim.from = from; - } - - from = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(from); - const hasToChanged = !Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(to, prevTo); - - if (hasToChanged) { - this._focus(to); - } - - const hasAsyncTo = isAsyncTo(props.to); - const { - config - } = anim; - const { - decay, - velocity - } = config; - - if (hasToProp || hasFromProp) { - config.velocity = 0; - } - - if (props.config && !hasAsyncTo) { - mergeConfig(config, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0); - } - - let node = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this); - - if (!node || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(to)) { - return resolve(getFinishedResult(this, true)); - } - - const reset = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.reset) ? hasFromProp && !props.default : !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(from) && matchProp(props.reset, key); - const value = reset ? from : this.get(); - const goal = computeGoal(to); - const isAnimatable = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].num(goal) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(goal) || Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isAnimatedString */ "t"])(goal); - const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key)); - - if (hasToChanged) { - const nodeType = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimatedType */ "f"])(to); - - if (nodeType !== node.constructor) { - if (immediate) { - node = this._set(goal); - } else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`); - } - } - - const goalType = node.constructor; - let started = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(to); - let finished = false; - - if (!started) { - const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged; - - if (hasToChanged || hasValueChanged) { - finished = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(computeGoal(value), goal); - started = !finished; - } - - if (!Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(anim.immediate, immediate) && !immediate || !Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(config.decay, decay) || !Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(config.velocity, velocity)) { - started = true; - } - } - - if (finished && isAnimating(this)) { - if (anim.changed && !reset) { - started = true; - } else if (!started) { - this._stop(prevTo); - } - } - - if (!hasAsyncTo) { - if (started || Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(prevTo)) { - anim.values = node.getPayload(); - anim.toValues = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(to) ? null : goalType == _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* AnimatedString */ "b"] ? [1] : Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(goal); - } - - if (anim.immediate != immediate) { - anim.immediate = immediate; - - if (!immediate && !reset) { - this._set(prevTo); - } - } - - if (started) { - const { - onRest - } = anim; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ACTIVE_EVENTS, type => mergeActiveFn(this, props, type)); - const result = getFinishedResult(this, checkFinished(this, prevTo)); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flushCalls */ "n"])(this._pendingCalls, result); - - this._pendingCalls.add(resolve); - - if (anim.changed) _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => { - anim.changed = !reset; - onRest == null ? void 0 : onRest(result, this); - - if (reset) { - callProp(defaultProps.onRest, result); - } else { - anim.onStart == null ? void 0 : anim.onStart(result, this); - } - }); - } - } - - if (reset) { - this._set(value); - } - - if (hasAsyncTo) { - resolve(runAsync(props.to, props, this._state, this)); - } else if (started) { - this._start(); - } else if (isAnimating(this) && !hasToChanged) { - this._pendingCalls.add(resolve); - } else { - resolve(getNoopResult(value)); - } - } - - _focus(value) { - const anim = this.animation; - - if (value !== anim.to) { - if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidObservers */ "p"])(this)) { - this._detach(); - } - - anim.to = value; - - if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidObservers */ "p"])(this)) { - this._attach(); - } - } - } - - _attach() { - let priority = 0; - const { - to - } = this.animation; - - if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(to)) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* addFluidObserver */ "c"])(to, this); - - if (isFrameValue(to)) { - priority = to.priority + 1; - } - } - - this.priority = priority; - } - - _detach() { - const { - to - } = this.animation; - - if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(to)) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* removeFluidObserver */ "x"])(to, this); - } - } - - _set(arg, idle = true) { - const value = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(arg); - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(value)) { - const oldNode = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this); - - if (!oldNode || !Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(value, oldNode.getValue())) { - const nodeType = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimatedType */ "f"])(value); - - if (!oldNode || oldNode.constructor != nodeType) { - Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* setAnimated */ "h"])(this, nodeType.create(value)); - } else { - oldNode.setValue(value); - } - - if (oldNode) { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => { - this._onChange(value, idle); - }); - } - } - } - - return Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this); - } - - _onStart() { - const anim = this.animation; - - if (!anim.changed) { - anim.changed = true; - sendEvent(this, 'onStart', getFinishedResult(this, checkFinished(this, anim.to)), this); - } - } - - _onChange(value, idle) { - if (!idle) { - this._onStart(); - - callProp(this.animation.onChange, value, this); - } - - callProp(this.defaultProps.onChange, value, this); - - super._onChange(value, idle); - } - - _start() { - const anim = this.animation; - Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this).reset(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(anim.to)); - - if (!anim.immediate) { - anim.fromValues = anim.values.map(node => node.lastPosition); - } - - if (!isAnimating(this)) { - setActiveBit(this, true); - - if (!isPaused(this)) { - this._resume(); - } - } - } - - _resume() { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].skipAnimation) { - this.finish(); - } else { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* frameLoop */ "o"].start(this); - } - } - - _stop(goal, cancel) { - if (isAnimating(this)) { - setActiveBit(this, false); - const anim = this.animation; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(anim.values, node => { - node.done = true; - }); - - if (anim.toValues) { - anim.onChange = anim.onPause = anim.onResume = undefined; - } - - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* callFluidObservers */ "d"])(this, { - type: 'idle', - parent: this - }); - const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to)); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flushCalls */ "n"])(this._pendingCalls, result); - - if (anim.changed) { - anim.changed = false; - sendEvent(this, 'onRest', result, this); - } - } - } - -} - -function checkFinished(target, to) { - const goal = computeGoal(to); - const value = computeGoal(target.get()); - return Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(value, goal); -} - -function createLoopUpdate(props, loop = props.loop, to = props.to) { - let loopRet = callProp(loop); - - if (loopRet) { - const overrides = loopRet !== true && inferTo(loopRet); - const reverse = (overrides || props).reverse; - const reset = !overrides || overrides.reset; - return createUpdate(_extends({}, props, { - loop, - default: false, - pause: undefined, - to: !reverse || isAsyncTo(to) ? to : undefined, - from: reset ? props.from : undefined, - reset - }, overrides)); - } -} -function createUpdate(props) { - const { - to, - from - } = props = inferTo(props); - const keys = new Set(); - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(to)) findDefined(to, keys); - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(from)) findDefined(from, keys); - props.keys = keys.size ? Array.from(keys) : null; - return props; -} -function declareUpdate(props) { - const update = createUpdate(props); - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(update.default)) { - update.default = getDefaultProps(update); - } - - return update; -} - -function findDefined(values, keys) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(values, (value, key) => value != null && keys.add(key)); -} - -const ACTIVE_EVENTS = ['onStart', 'onRest', 'onChange', 'onPause', 'onResume']; - -function mergeActiveFn(target, props, type) { - target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : undefined; -} - -function sendEvent(target, type, ...args) { - var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps; - - (_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args); - (_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args); -} - -const BATCHED_EVENTS = ['onStart', 'onChange', 'onRest']; -let nextId = 1; -class Controller { - constructor(props, flush) { - this.id = nextId++; - this.springs = {}; - this.queue = []; - this.ref = void 0; - this._flush = void 0; - this._initialProps = void 0; - this._lastAsyncId = 0; - this._active = new Set(); - this._changed = new Set(); - this._started = false; - this._item = void 0; - this._state = { - paused: false, - pauseQueue: new Set(), - resumeQueue: new Set(), - timeouts: new Set() - }; - this._events = { - onStart: new Map(), - onChange: new Map(), - onRest: new Map() - }; - this._onFrame = this._onFrame.bind(this); - - if (flush) { - this._flush = flush; - } - - if (props) { - this.start(_extends({ - default: true - }, props)); - } - } - - get idle() { - return !this._state.asyncTo && Object.values(this.springs).every(spring => { - return spring.idle && !spring.isDelayed && !spring.isPaused; - }); - } - - get item() { - return this._item; - } - - set item(item) { - this._item = item; - } - - get() { - const values = {}; - this.each((spring, key) => values[key] = spring.get()); - return values; - } - - set(values) { - for (const key in values) { - const value = values[key]; - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(value)) { - this.springs[key].set(value); - } - } - } - - update(props) { - if (props) { - this.queue.push(createUpdate(props)); - } - - return this; - } - - start(props) { - let { - queue - } = this; - - if (props) { - queue = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(props).map(createUpdate); - } else { - this.queue = []; - } - - if (this._flush) { - return this._flush(this, queue); - } - - prepareKeys(this, queue); - return flushUpdateQueue(this, queue); - } - - stop(arg, keys) { - if (arg !== !!arg) { - keys = arg; - } - - if (keys) { - const springs = this.springs; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(keys), key => springs[key].stop(!!arg)); - } else { - stopAsync(this._state, this._lastAsyncId); - this.each(spring => spring.stop(!!arg)); - } - - return this; - } - - pause(keys) { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(keys)) { - this.start({ - pause: true - }); - } else { - const springs = this.springs; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(keys), key => springs[key].pause()); - } - - return this; - } - - resume(keys) { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(keys)) { - this.start({ - pause: false - }); - } else { - const springs = this.springs; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(keys), key => springs[key].resume()); - } - - return this; - } - - each(iterator) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(this.springs, iterator); - } - - _onFrame() { - const { - onStart, - onChange, - onRest - } = this._events; - const active = this._active.size > 0; - const changed = this._changed.size > 0; - - if (active && !this._started || changed && !this._started) { - this._started = true; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flush */ "m"])(onStart, ([onStart, result]) => { - result.value = this.get(); - onStart(result, this, this._item); - }); - } - - const idle = !active && this._started; - const values = changed || idle && onRest.size ? this.get() : null; - - if (changed && onChange.size) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flush */ "m"])(onChange, ([onChange, result]) => { - result.value = values; - onChange(result, this, this._item); - }); - } - - if (idle) { - this._started = false; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flush */ "m"])(onRest, ([onRest, result]) => { - result.value = values; - onRest(result, this, this._item); - }); - } - } - - eventObserved(event) { - if (event.type == 'change') { - this._changed.add(event.parent); - - if (!event.idle) { - this._active.add(event.parent); - } - } else if (event.type == 'idle') { - this._active.delete(event.parent); - } else return; - - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].onFrame(this._onFrame); - } - -} -function flushUpdateQueue(ctrl, queue) { - return Promise.all(queue.map(props => flushUpdate(ctrl, props))).then(results => getCombinedResult(ctrl, results)); -} -async function flushUpdate(ctrl, props, isLoop) { - const { - keys, - to, - from, - loop, - onRest, - onResolve - } = props; - const defaults = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(props.default) && props.default; - - if (loop) { - props.loop = false; - } - - if (to === false) props.to = null; - if (from === false) props.from = null; - const asyncTo = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(to) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(to) ? to : undefined; - - if (asyncTo) { - props.to = undefined; - props.onRest = undefined; - - if (defaults) { - defaults.onRest = undefined; - } - } else { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(BATCHED_EVENTS, key => { - const handler = props[key]; - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(handler)) { - const queue = ctrl['_events'][key]; - - props[key] = ({ - finished, - cancelled - }) => { - const result = queue.get(handler); - - if (result) { - if (!finished) result.finished = false; - if (cancelled) result.cancelled = true; - } else { - queue.set(handler, { - value: null, - finished: finished || false, - cancelled: cancelled || false - }); - } - }; - - if (defaults) { - defaults[key] = props[key]; - } - } - }); - } - - const state = ctrl['_state']; - - if (props.pause === !state.paused) { - state.paused = props.pause; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* flushCalls */ "n"])(props.pause ? state.pauseQueue : state.resumeQueue); - } else if (state.paused) { - props.pause = true; - } - - const promises = (keys || Object.keys(ctrl.springs)).map(key => ctrl.springs[key].start(props)); - const cancel = props.cancel === true || getDefaultProp(props, 'cancel') === true; - - if (asyncTo || cancel && state.asyncId) { - promises.push(scheduleProps(++ctrl['_lastAsyncId'], { - props, - state, - actions: { - pause: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* noop */ "v"], - resume: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* noop */ "v"], - - start(props, resolve) { - if (cancel) { - stopAsync(state, ctrl['_lastAsyncId']); - resolve(getCancelledResult(ctrl)); - } else { - props.onRest = onRest; - resolve(runAsync(asyncTo, props, state, ctrl)); - } - } - - } - })); - } - - if (state.paused) { - await new Promise(resume => { - state.resumeQueue.add(resume); - }); - } - - const result = getCombinedResult(ctrl, await Promise.all(promises)); - - if (loop && result.finished && !(isLoop && result.noop)) { - const nextProps = createLoopUpdate(props, loop, to); - - if (nextProps) { - prepareKeys(ctrl, [nextProps]); - return flushUpdate(ctrl, nextProps, true); - } - } - - if (onResolve) { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => onResolve(result, ctrl, ctrl.item)); - } - - return result; -} -function getSprings(ctrl, props) { - const springs = _extends({}, ctrl.springs); - - if (props) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(props), props => { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.keys)) { - props = createUpdate(props); - } - - if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(props.to)) { - props = _extends({}, props, { - to: undefined - }); - } - - prepareSprings(springs, props, key => { - return createSpring(key); - }); - }); - } - - setSprings(ctrl, springs); - return springs; -} -function setSprings(ctrl, springs) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(springs, (spring, key) => { - if (!ctrl.springs[key]) { - ctrl.springs[key] = spring; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* addFluidObserver */ "c"])(spring, ctrl); - } - }); -} - -function createSpring(key, observer) { - const spring = new SpringValue(); - spring.key = key; - - if (observer) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* addFluidObserver */ "c"])(spring, observer); - } - - return spring; -} - -function prepareSprings(springs, props, create) { - if (props.keys) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(props.keys, key => { - const spring = springs[key] || (springs[key] = create(key)); - spring['_prepareNode'](props); - }); - } -} - -function prepareKeys(ctrl, queue) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(queue, props => { - prepareSprings(ctrl.springs, props, key => { - return createSpring(key, ctrl); - }); - }); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -const _excluded$3 = ["children"]; -const SpringContext = _ref => { - let { - children - } = _ref, - props = _objectWithoutPropertiesLoose(_ref, _excluded$3); - - const inherited = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(ctx); - const pause = props.pause || !!inherited.pause, - immediate = props.immediate || !!inherited.immediate; - props = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useMemoOne */ "B"])(() => ({ - pause, - immediate - }), [pause, immediate]); - const { - Provider - } = ctx; - return react__WEBPACK_IMPORTED_MODULE_1__["createElement"](Provider, { - value: props - }, children); -}; -const ctx = makeContext(SpringContext, {}); -SpringContext.Provider = ctx.Provider; -SpringContext.Consumer = ctx.Consumer; - -function makeContext(target, init) { - Object.assign(target, react__WEBPACK_IMPORTED_MODULE_1__["createContext"](init)); - target.Provider._context = target; - target.Consumer._context = target; - return target; -} - -const SpringRef = () => { - const current = []; - - const SpringRef = function SpringRef(props) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* deprecateDirectCall */ "i"])(); - const results = []; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, (ctrl, i) => { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props)) { - results.push(ctrl.start()); - } else { - const update = _getProps(props, ctrl, i); - - if (update) { - results.push(ctrl.start(update)); - } - } - }); - return results; - }; - - SpringRef.current = current; - - SpringRef.add = function (ctrl) { - if (!current.includes(ctrl)) { - current.push(ctrl); - } - }; - - SpringRef.delete = function (ctrl) { - const i = current.indexOf(ctrl); - if (~i) current.splice(i, 1); - }; - - SpringRef.pause = function () { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.pause(...arguments)); - return this; - }; - - SpringRef.resume = function () { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.resume(...arguments)); - return this; - }; - - SpringRef.set = function (values) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.set(values)); - }; - - SpringRef.start = function (props) { - const results = []; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, (ctrl, i) => { - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props)) { - results.push(ctrl.start()); - } else { - const update = this._getProps(props, ctrl, i); - - if (update) { - results.push(ctrl.start(update)); - } - } - }); - return results; - }; - - SpringRef.stop = function () { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.stop(...arguments)); - return this; - }; - - SpringRef.update = function (props) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i))); - return this; - }; - - const _getProps = function _getProps(arg, ctrl, index) { - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(arg) ? arg(index, ctrl) : arg; - }; - - SpringRef._getProps = _getProps; - return SpringRef; -}; - -function useSprings(length, props, deps) { - const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(props) && props; - if (propsFn && !deps) deps = []; - const ref = Object(react__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []); - const layoutId = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(0); - const forceUpdate = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useForceUpdate */ "z"])(); - const state = Object(react__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => ({ - ctrls: [], - queue: [], - - flush(ctrl, updates) { - const springs = getSprings(ctrl, updates); - const canFlushSync = layoutId.current > 0 && !state.queue.length && !Object.keys(springs).some(key => !ctrl.springs[key]); - return canFlushSync ? flushUpdateQueue(ctrl, updates) : new Promise(resolve => { - setSprings(ctrl, springs); - state.queue.push(() => { - resolve(flushUpdateQueue(ctrl, updates)); - }); - forceUpdate(); - }); - } - - }), []); - const ctrls = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])([...state.ctrls]); - const updates = []; - const prevLength = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* usePrev */ "D"])(length) || 0; - Object(react__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ctrls.current.slice(length, prevLength), ctrl => { - detachRefs(ctrl, ref); - ctrl.stop(true); - }); - ctrls.current.length = length; - declareUpdates(prevLength, length); - }, [length]); - Object(react__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => { - declareUpdates(0, Math.min(prevLength, length)); - }, deps); - - function declareUpdates(startIndex, endIndex) { - for (let i = startIndex; i < endIndex; i++) { - const ctrl = ctrls.current[i] || (ctrls.current[i] = new Controller(null, state.flush)); - const update = propsFn ? propsFn(i, ctrl) : props[i]; - - if (update) { - updates[i] = declareUpdate(update); - } - } - } - - const springs = ctrls.current.map((ctrl, i) => getSprings(ctrl, updates[i])); - const context = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(SpringContext); - const prevContext = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* usePrev */ "D"])(context); - const hasContext = context !== prevContext && hasProps(context); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => { - layoutId.current++; - state.ctrls = ctrls.current; - const { - queue - } = state; - - if (queue.length) { - state.queue = []; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(queue, cb => cb()); - } - - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ctrls.current, (ctrl, i) => { - ref == null ? void 0 : ref.add(ctrl); - - if (hasContext) { - ctrl.start({ - default: context - }); - } - - const update = updates[i]; - - if (update) { - replaceRef(ctrl, update.ref); - - if (ctrl.ref) { - ctrl.queue.push(update); - } else { - ctrl.start(update); - } - } - }); - }); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useOnce */ "C"])(() => () => { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(state.ctrls, ctrl => ctrl.stop(true)); - }); - const values = springs.map(x => _extends({}, x)); - return ref ? [values, ref] : values; -} - -function useSpring(props, deps) { - const isFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(props); - const [[values], ref] = useSprings(1, isFn ? props : [props], isFn ? deps || [] : deps); - return isFn || arguments.length == 2 ? [values, ref] : values; -} - -const initSpringRef = () => SpringRef(); - -const useSpringRef = () => Object(react__WEBPACK_IMPORTED_MODULE_1__["useState"])(initSpringRef)[0]; - -function useTrail(length, propsArg, deps) { - var _passedRef; - - const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(propsArg) && propsArg; - if (propsFn && !deps) deps = []; - let reverse = true; - let passedRef = undefined; - const result = useSprings(length, (i, ctrl) => { - const props = propsFn ? propsFn(i, ctrl) : propsArg; - passedRef = props.ref; - reverse = reverse && props.reverse; - return props; - }, deps || [{}]); - const ref = (_passedRef = passedRef) != null ? _passedRef : result[1]; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ref.current, (ctrl, i) => { - const parent = ref.current[i + (reverse ? 1 : -1)]; - - if (parent) { - ctrl.start({ - to: parent.springs - }); - } else { - ctrl.start(); - } - }); - }, deps); - - if (propsFn || arguments.length == 3) { - ref['_getProps'] = (propsArg, ctrl, i) => { - const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(propsArg) ? propsArg(i, ctrl) : propsArg; - - if (props) { - const parent = ref.current[i + (props.reverse ? 1 : -1)]; - if (parent) props.to = parent.springs; - return props; - } - }; - - return result; - } - - ref['start'] = propsArg => { - const results = []; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ref.current, (ctrl, i) => { - const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(propsArg) ? propsArg(i, ctrl) : propsArg; - const parent = ref.current[i + (reverse ? 1 : -1)]; - - if (parent) { - results.push(ctrl.start(_extends({}, props, { - to: parent.springs - }))); - } else { - results.push(ctrl.start(_extends({}, props))); - } - }); - return results; - }; - - return result[0]; -} - -let TransitionPhase; - -(function (TransitionPhase) { - TransitionPhase["MOUNT"] = "mount"; - TransitionPhase["ENTER"] = "enter"; - TransitionPhase["UPDATE"] = "update"; - TransitionPhase["LEAVE"] = "leave"; -})(TransitionPhase || (TransitionPhase = {})); - -function useTransition(data, props, deps) { - const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(props) && props; - const { - reset, - sort, - trail = 0, - expires = true, - exitBeforeEnter = false, - onDestroyed, - ref: propsRef, - config: propsConfig - } = propsFn ? propsFn() : props; - const ref = Object(react__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []); - const items = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(data); - const transitions = []; - const usedTransitions = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); - const prevTransitions = reset ? null : usedTransitions.current; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => { - usedTransitions.current = transitions; - }); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useOnce */ "C"])(() => () => { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(usedTransitions.current, t => { - if (t.expired) { - clearTimeout(t.expirationId); - } - - detachRefs(t.ctrl, ref); - t.ctrl.stop(true); - }); - }); - const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions); - const expired = reset && usedTransitions.current || []; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(expired, ({ - ctrl, - item, - key - }) => { - detachRefs(ctrl, ref); - callProp(onDestroyed, item, key); - })); - const reused = []; - if (prevTransitions) Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(prevTransitions, (t, i) => { - if (t.expired) { - clearTimeout(t.expirationId); - expired.push(t); - } else { - i = reused[i] = keys.indexOf(t.key); - if (~i) transitions[i] = t; - } - }); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(items, (item, i) => { - if (!transitions[i]) { - transitions[i] = { - key: keys[i], - item, - phase: TransitionPhase.MOUNT, - ctrl: new Controller() - }; - transitions[i].ctrl.item = item; - } - }); - - if (reused.length) { - let i = -1; - const { - leave - } = propsFn ? propsFn() : props; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(reused, (keyIndex, prevIndex) => { - const t = prevTransitions[prevIndex]; - - if (~keyIndex) { - i = transitions.indexOf(t); - transitions[i] = _extends({}, t, { - item: items[keyIndex] - }); - } else if (leave) { - transitions.splice(++i, 0, t); - } - }); - } - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(sort)) { - transitions.sort((a, b) => sort(a.item, b.item)); - } - - let delay = -trail; - const forceUpdate = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useForceUpdate */ "z"])(); - const defaultProps = getDefaultProps(props); - const changes = new Map(); - const exitingTransitions = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(new Map()); - const forceChange = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(transitions, (t, i) => { - const key = t.key; - const prevPhase = t.phase; - const p = propsFn ? propsFn() : props; - let to; - let phase; - let propsDelay = callProp(p.delay || 0, key); - - if (prevPhase == TransitionPhase.MOUNT) { - to = p.enter; - phase = TransitionPhase.ENTER; - } else { - const isLeave = keys.indexOf(key) < 0; - - if (prevPhase != TransitionPhase.LEAVE) { - if (isLeave) { - to = p.leave; - phase = TransitionPhase.LEAVE; - } else if (to = p.update) { - phase = TransitionPhase.UPDATE; - } else return; - } else if (!isLeave) { - to = p.enter; - phase = TransitionPhase.ENTER; - } else return; - } - - to = callProp(to, t.item, i); - to = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(to) ? inferTo(to) : { - to - }; - - if (!to.config) { - const config = propsConfig || defaultProps.config; - to.config = callProp(config, t.item, i, phase); - } - - delay += trail; - - const payload = _extends({}, defaultProps, { - delay: propsDelay + delay, - ref: propsRef, - immediate: p.immediate, - reset: false - }, to); - - if (phase == TransitionPhase.ENTER && _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(payload.from)) { - const _p = propsFn ? propsFn() : props; - - const from = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(_p.initial) || prevTransitions ? _p.from : _p.initial; - payload.from = callProp(from, t.item, i); - } - - const { - onResolve - } = payload; - - payload.onResolve = result => { - callProp(onResolve, result); - const transitions = usedTransitions.current; - const t = transitions.find(t => t.key === key); - if (!t) return; - - if (result.cancelled && t.phase != TransitionPhase.UPDATE) { - return; - } - - if (t.ctrl.idle) { - const idle = transitions.every(t => t.ctrl.idle); - - if (t.phase == TransitionPhase.LEAVE) { - const expiry = callProp(expires, t.item); - - if (expiry !== false) { - const expiryMs = expiry === true ? 0 : expiry; - t.expired = true; - - if (!idle && expiryMs > 0) { - if (expiryMs <= 0x7fffffff) t.expirationId = setTimeout(forceUpdate, expiryMs); - return; - } - } - } - - if (idle && transitions.some(t => t.expired)) { - exitingTransitions.current.delete(t); - - if (exitBeforeEnter) { - forceChange.current = true; - } - - forceUpdate(); - } - } - }; - - const springs = getSprings(t.ctrl, payload); - - if (phase === TransitionPhase.LEAVE && exitBeforeEnter) { - exitingTransitions.current.set(t, { - phase, - springs, - payload - }); - } else { - changes.set(t, { - phase, - springs, - payload - }); - } - }); - const context = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(SpringContext); - const prevContext = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* usePrev */ "D"])(context); - const hasContext = context !== prevContext && hasProps(context); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => { - if (hasContext) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(transitions, t => { - t.ctrl.start({ - default: context - }); - }); - } - }, [context]); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(changes, (_, t) => { - if (exitingTransitions.current.size) { - const ind = transitions.findIndex(state => state.key === t.key); - transitions.splice(ind, 1); - } - }); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(exitingTransitions.current.size ? exitingTransitions.current : changes, ({ - phase, - payload - }, t) => { - const { - ctrl - } = t; - t.phase = phase; - ref == null ? void 0 : ref.add(ctrl); - - if (hasContext && phase == TransitionPhase.ENTER) { - ctrl.start({ - default: context - }); - } - - if (payload) { - replaceRef(ctrl, payload.ref); - - if (ctrl.ref && !forceChange.current) { - ctrl.update(payload); - } else { - ctrl.start(payload); - - if (forceChange.current) { - forceChange.current = false; - } - } - } - }); - }, reset ? void 0 : deps); - - const renderTransitions = render => react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, transitions.map((t, i) => { - const { - springs - } = changes.get(t) || t.ctrl; - const elem = render(_extends({}, springs), t.item, t, i); - return elem && elem.type ? react__WEBPACK_IMPORTED_MODULE_1__["createElement"](elem.type, _extends({}, elem.props, { - key: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].str(t.key) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].num(t.key) ? t.key : t.ctrl.id, - ref: elem.ref - })) : elem; - })); - - return ref ? [renderTransitions, ref] : renderTransitions; -} -let nextKey = 1; - -function getKeys(items, { - key, - keys = key -}, prevTransitions) { - if (keys === null) { - const reused = new Set(); - return items.map(item => { - const t = prevTransitions && prevTransitions.find(t => t.item === item && t.phase !== TransitionPhase.LEAVE && !reused.has(t)); - - if (t) { - reused.add(t); - return t.key; - } - - return nextKey++; - }); - } - - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(keys) ? items : _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(keys) ? items.map(keys) : Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(keys); -} - -const _excluded$2 = ["children"]; -function Spring(_ref) { - let { - children - } = _ref, - props = _objectWithoutPropertiesLoose(_ref, _excluded$2); - - return children(useSpring(props)); -} - -const _excluded$1 = ["items", "children"]; -function Trail(_ref) { - let { - items, - children - } = _ref, - props = _objectWithoutPropertiesLoose(_ref, _excluded$1); - - const trails = useTrail(items.length, props); - return items.map((item, index) => { - const result = children(item, index); - return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(result) ? result(trails[index]) : result; - }); -} - -const _excluded = ["items", "children"]; -function Transition(_ref) { - let { - items, - children - } = _ref, - props = _objectWithoutPropertiesLoose(_ref, _excluded); - - return useTransition(items, props)(children); -} - -class Interpolation extends FrameValue { - constructor(source, args) { - super(); - this.key = void 0; - this.idle = true; - this.calc = void 0; - this._active = new Set(); - this.source = source; - this.calc = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* createInterpolator */ "f"])(...args); - - const value = this._get(); - - const nodeType = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimatedType */ "f"])(value); - Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* setAnimated */ "h"])(this, nodeType.create(value)); - } - - advance(_dt) { - const value = this._get(); - - const oldValue = this.get(); - - if (!Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isEqual */ "u"])(value, oldValue)) { - Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this).setValue(value); - - this._onChange(value, this.idle); - } - - if (!this.idle && checkIdle(this._active)) { - becomeIdle(this); - } - } - - _get() { - const inputs = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].arr(this.source) ? this.source.map(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"]) : Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidValue */ "q"])(this.source)); - return this.calc(...inputs); - } - - _start() { - if (this.idle && !checkIdle(this._active)) { - this.idle = false; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getPayload */ "g"])(this), node => { - node.done = false; - }); - - if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].skipAnimation) { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => this.advance()); - becomeIdle(this); - } else { - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* frameLoop */ "o"].start(this); - } - } - } - - _attach() { - let priority = 1; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(this.source), source => { - if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(source)) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* addFluidObserver */ "c"])(source, this); - } - - if (isFrameValue(source)) { - if (!source.idle) { - this._active.add(source); - } - - priority = Math.max(priority, source.priority + 1); - } - }); - this.priority = priority; - - this._start(); - } - - _detach() { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(this.source), source => { - if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(source)) { - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* removeFluidObserver */ "x"])(source, this); - } - }); - - this._active.clear(); - - becomeIdle(this); - } - - eventObserved(event) { - if (event.type == 'change') { - if (event.idle) { - this.advance(); - } else { - this._active.add(event.parent); - - this._start(); - } - } else if (event.type == 'idle') { - this._active.delete(event.parent); - } else if (event.type == 'priority') { - this.priority = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* toArray */ "y"])(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0); - } - } - -} - -function isIdle(source) { - return source.idle !== false; -} - -function checkIdle(active) { - return !active.size || Array.from(active).every(isIdle); -} - -function becomeIdle(self) { - if (!self.idle) { - self.idle = true; - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getPayload */ "g"])(self), node => { - node.done = true; - }); - Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* callFluidObservers */ "d"])(self, { - type: 'idle', - parent: self - }); - } -} - -const to = (source, ...args) => new Interpolation(source, args); -const interpolate = (source, ...args) => (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* deprecateInterpolate */ "j"])(), new Interpolation(source, args)); - -_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].assign({ - createStringInterpolator: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* createStringInterpolator */ "g"], - to: (source, args) => new Interpolation(source, args) -}); -const update = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* frameLoop */ "o"].advance; - - - - -/***/ }), - -/***/ "l3Sj": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["i18n"]; }()); - -/***/ }), - -/***/ "lJLt": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PREFERENCES_DEFAULTS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SETTINGS_DEFAULTS; }); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +;// CONCATENATED MODULE: external ["wp","i18n"] +var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/defaults.js /** * WordPress dependencies */ @@ -37184,74 +3161,74 @@ const SETTINGS_DEFAULTS = { // colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. colors: [{ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Black'), + name: (0,external_wp_i18n_namespaceObject.__)('Black'), slug: 'black', color: '#000000' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Cyan bluish gray'), + name: (0,external_wp_i18n_namespaceObject.__)('Cyan bluish gray'), slug: 'cyan-bluish-gray', color: '#abb8c3' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('White'), + name: (0,external_wp_i18n_namespaceObject.__)('White'), slug: 'white', color: '#ffffff' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Pale pink'), + name: (0,external_wp_i18n_namespaceObject.__)('Pale pink'), slug: 'pale-pink', color: '#f78da7' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid red'), + name: (0,external_wp_i18n_namespaceObject.__)('Vivid red'), slug: 'vivid-red', color: '#cf2e2e' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid orange'), + name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid orange'), slug: 'luminous-vivid-orange', color: '#ff6900' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid amber'), + name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid amber'), slug: 'luminous-vivid-amber', color: '#fcb900' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Light green cyan'), + name: (0,external_wp_i18n_namespaceObject.__)('Light green cyan'), slug: 'light-green-cyan', color: '#7bdcb5' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid green cyan'), + name: (0,external_wp_i18n_namespaceObject.__)('Vivid green cyan'), slug: 'vivid-green-cyan', color: '#00d084' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Pale cyan blue'), + name: (0,external_wp_i18n_namespaceObject.__)('Pale cyan blue'), slug: 'pale-cyan-blue', color: '#8ed1fc' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid cyan blue'), + name: (0,external_wp_i18n_namespaceObject.__)('Vivid cyan blue'), slug: 'vivid-cyan-blue', color: '#0693e3' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid purple'), + name: (0,external_wp_i18n_namespaceObject.__)('Vivid purple'), slug: 'vivid-purple', color: '#9b51e0' }], // fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. fontSizes: [{ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Small', 'font size name'), + name: (0,external_wp_i18n_namespaceObject._x)('Small', 'font size name'), size: 13, slug: 'small' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Normal', 'font size name'), + name: (0,external_wp_i18n_namespaceObject._x)('Normal', 'font size name'), size: 16, slug: 'normal' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Medium', 'font size name'), + name: (0,external_wp_i18n_namespaceObject._x)('Medium', 'font size name'), size: 20, slug: 'medium' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Large', 'font size name'), + name: (0,external_wp_i18n_namespaceObject._x)('Large', 'font size name'), size: 36, slug: 'large' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Huge', 'font size name'), + name: (0,external_wp_i18n_namespaceObject._x)('Huge', 'font size name'), size: 42, slug: 'huge' }], @@ -37259,16 +3236,16 @@ const SETTINGS_DEFAULTS = { imageDefaultSize: 'large', imageSizes: [{ slug: 'thumbnail', - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Thumbnail') + name: (0,external_wp_i18n_namespaceObject.__)('Thumbnail') }, { slug: 'medium', - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Medium') + name: (0,external_wp_i18n_namespaceObject.__)('Medium') }, { slug: 'large', - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Large') + name: (0,external_wp_i18n_namespaceObject.__)('Large') }, { slug: 'full', - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Full Size') + name: (0,external_wp_i18n_namespaceObject.__)('Full Size') }], // Allow plugin to disable Image Editor if need be imageEditing: true, @@ -37292,156 +3269,8387 @@ const SETTINGS_DEFAULTS = { // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. gradients: [{ - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid cyan blue to vivid purple'), + name: (0,external_wp_i18n_namespaceObject.__)('Vivid cyan blue to vivid purple'), gradient: 'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)', slug: 'vivid-cyan-blue-to-vivid-purple' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Light green cyan to vivid green cyan'), + name: (0,external_wp_i18n_namespaceObject.__)('Light green cyan to vivid green cyan'), gradient: 'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)', slug: 'light-green-cyan-to-vivid-green-cyan' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid amber to luminous vivid orange'), + name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid amber to luminous vivid orange'), gradient: 'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)', slug: 'luminous-vivid-amber-to-luminous-vivid-orange' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid orange to vivid red'), + name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid orange to vivid red'), gradient: 'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)', slug: 'luminous-vivid-orange-to-vivid-red' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Very light gray to cyan bluish gray'), + name: (0,external_wp_i18n_namespaceObject.__)('Very light gray to cyan bluish gray'), gradient: 'linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)', slug: 'very-light-gray-to-cyan-bluish-gray' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Cool to warm spectrum'), + name: (0,external_wp_i18n_namespaceObject.__)('Cool to warm spectrum'), gradient: 'linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)', slug: 'cool-to-warm-spectrum' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Blush light purple'), + name: (0,external_wp_i18n_namespaceObject.__)('Blush light purple'), gradient: 'linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)', slug: 'blush-light-purple' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Blush bordeaux'), + name: (0,external_wp_i18n_namespaceObject.__)('Blush bordeaux'), gradient: 'linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)', slug: 'blush-bordeaux' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous dusk'), + name: (0,external_wp_i18n_namespaceObject.__)('Luminous dusk'), gradient: 'linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)', slug: 'luminous-dusk' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Pale ocean'), + name: (0,external_wp_i18n_namespaceObject.__)('Pale ocean'), gradient: 'linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)', slug: 'pale-ocean' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Electric grass'), + name: (0,external_wp_i18n_namespaceObject.__)('Electric grass'), gradient: 'linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)', slug: 'electric-grass' }, { - name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Midnight'), + name: (0,external_wp_i18n_namespaceObject.__)('Midnight'), gradient: 'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)', slug: 'midnight' }] }; - -/***/ }), - -/***/ "mdLt": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - - +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/array.js /** - * WordPress dependencies + * External dependencies */ +/** + * Insert one or multiple elements into a given position of an array. + * + * @param {Array} array Source array. + * @param {*} elements Elements to insert. + * @param {number} index Insert Position. + * + * @return {Array} Result. + */ -function InserterPanel(_ref) { - let { - title, - icon, - children - } = _ref; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-inserter__panel-header" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("h2", { - className: "block-editor-inserter__panel-title" - }, title), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Icon"], { - icon: icon - })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-inserter__panel-content" - }, children)); +function insertAt(array, elements, index) { + return [...array.slice(0, index), ...(0,external_lodash_namespaceObject.castArray)(elements), ...array.slice(index)]; +} +/** + * Moves an element in an array. + * + * @param {Array} array Source array. + * @param {number} from Source index. + * @param {number} to Destination index. + * @param {number} count Number of elements to move. + * + * @return {Array} Result. + */ + +function moveTo(array, from, to) { + let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + const withoutMovedElements = [...array]; + withoutMovedElements.splice(from, count); + return insertAt(withoutMovedElements, array.slice(from, from + count), to); } -/* harmony default export */ __webpack_exports__["a"] = (InserterPanel); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/reducer.js +/** + * External dependencies + */ - -/***/ }), - -/***/ "mlss": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ + + +/** + * Internal dependencies + */ + + + +/** + * Given an array of blocks, returns an object where each key is a nesting + * context, the value of which is an array of block client IDs existing within + * that nesting context. + * + * @param {Array} blocks Blocks to map. + * @param {?string} rootClientId Assumed root client ID. + * + * @return {Object} Block order map object. + */ + +function mapBlockOrder(blocks) { + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + const result = { + [rootClientId]: [] + }; + blocks.forEach(block => { + const { + clientId, + innerBlocks + } = block; + result[rootClientId].push(clientId); + Object.assign(result, mapBlockOrder(innerBlocks, clientId)); + }); + return result; +} +/** + * Given an array of blocks, returns an object where each key contains + * the clientId of the block and the value is the parent of the block. + * + * @param {Array} blocks Blocks to map. + * @param {?string} rootClientId Assumed root client ID. + * + * @return {Object} Block order map object. + */ + + +function mapBlockParents(blocks) { + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return blocks.reduce((result, block) => Object.assign(result, { + [block.clientId]: rootClientId + }, mapBlockParents(block.innerBlocks, block.clientId)), {}); +} +/** + * Helper method to iterate through all blocks, recursing into inner blocks, + * applying a transformation function to each one. + * Returns a flattened object with the transformed blocks. + * + * @param {Array} blocks Blocks to flatten. + * @param {Function} transform Transforming function to be applied to each block. + * + * @return {Object} Flattened object. + */ + + +function flattenBlocks(blocks) { + let transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : external_lodash_namespaceObject.identity; + const result = {}; + const stack = [...blocks]; + + while (stack.length) { + const { + innerBlocks, + ...block + } = stack.shift(); + stack.push(...innerBlocks); + result[block.clientId] = transform(block); + } + + return result; +} +/** + * Given an array of blocks, returns an object containing all blocks, without + * attributes, recursing into inner blocks. Keys correspond to the block client + * ID, the value of which is the attributes object. + * + * @param {Array} blocks Blocks to flatten. + * + * @return {Object} Flattened block attributes object. + */ + + +function getFlattenedBlocksWithoutAttributes(blocks) { + return flattenBlocks(blocks, block => (0,external_lodash_namespaceObject.omit)(block, 'attributes')); +} +/** + * Given an array of blocks, returns an object containing all block attributes, + * recursing into inner blocks. Keys correspond to the block client ID, the + * value of which is the attributes object. + * + * @param {Array} blocks Blocks to flatten. + * + * @return {Object} Flattened block attributes object. + */ + + +function getFlattenedBlockAttributes(blocks) { + return flattenBlocks(blocks, block => block.attributes); +} +/** + * Returns an object against which it is safe to perform mutating operations, + * given the original object and its current working copy. + * + * @param {Object} original Original object. + * @param {Object} working Working object. + * + * @return {Object} Mutation-safe object. + */ + + +function getMutateSafeObject(original, working) { + if (original === working) { + return { ...original + }; + } + + return working; +} +/** + * Returns true if the two object arguments have the same keys, or false + * otherwise. + * + * @param {Object} a First object. + * @param {Object} b Second object. + * + * @return {boolean} Whether the two objects have the same keys. + */ + + +function hasSameKeys(a, b) { + return (0,external_lodash_namespaceObject.isEqual)((0,external_lodash_namespaceObject.keys)(a), (0,external_lodash_namespaceObject.keys)(b)); +} +/** + * Returns true if, given the currently dispatching action and the previously + * dispatched action, the two actions are updating the same block attribute, or + * false otherwise. + * + * @param {Object} action Currently dispatching action. + * @param {Object} lastAction Previously dispatched action. + * + * @return {boolean} Whether actions are updating the same block attribute. + */ + +function isUpdatingSameBlockAttribute(action, lastAction) { + return action.type === 'UPDATE_BLOCK_ATTRIBUTES' && lastAction !== undefined && lastAction.type === 'UPDATE_BLOCK_ATTRIBUTES' && (0,external_lodash_namespaceObject.isEqual)(action.clientIds, lastAction.clientIds) && hasSameKeys(action.attributes, lastAction.attributes); +} + +function buildBlockTree(state, blocks) { + const result = {}; + const stack = [...blocks]; + const flattenedBlocks = [...blocks]; + + while (stack.length) { + const block = stack.shift(); + stack.push(...block.innerBlocks); + flattenedBlocks.push(...block.innerBlocks); + } // Create objects before mutating them, that way it's always defined. + + + for (const block of flattenedBlocks) { + result[block.clientId] = {}; + } + + for (const block of flattenedBlocks) { + result[block.clientId] = Object.assign(result[block.clientId], { ...state.byClientId[block.clientId], + attributes: state.attributes[block.clientId], + innerBlocks: block.innerBlocks.map(subBlock => result[subBlock.clientId]) + }); + } + + return result; +} + +function updateParentInnerBlocksInTree(state, tree, updatedClientIds) { + let updateChildrenOfUpdatedClientIds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + const uncontrolledParents = new Set([]); + const controlledParents = new Set(); + + for (const clientId of updatedClientIds) { + let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents[clientId]; + + do { + if (state.controlledInnerBlocks[current]) { + // Should stop on controlled blocks. + // If we reach a controlled parent, break out of the loop. + controlledParents.add(current); + break; + } else { + // else continue traversing up through parents. + uncontrolledParents.add(current); + current = state.parents[current]; + } + } while (current !== undefined); + } // To make sure the order of assignments doesn't matter, + // we first create empty objects and mutates the inner blocks later. + + + for (const clientId of uncontrolledParents) { + tree[clientId] = { ...tree[clientId] + }; + } + + for (const clientId of uncontrolledParents) { + tree[clientId].innerBlocks = (state.order[clientId] || []).map(subClientId => tree[subClientId]); + } // Controlled parent blocks, need a dedicated key for their inner blocks + // to be used when doing getBlocks( controlledBlockClientId ). + + + for (const clientId of controlledParents) { + tree['controlled||' + clientId] = { + innerBlocks: (state.order[clientId] || []).map(subClientId => tree[subClientId]) + }; + } + + return tree; +} +/** + * Higher-order reducer intended to compute full block objects key for each block in the post. + * This is a denormalization to optimize the performance of the getBlock selectors and avoid + * recomputing the block objects and avoid heavy memoization. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +const withBlockTree = reducer => function () { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + const newState = reducer(state, action); + + if (newState === state) { + return state; + } + + newState.tree = state.tree ? state.tree : {}; + + switch (action.type) { + case 'RECEIVE_BLOCKS': + case 'INSERT_BLOCKS': + { + const subTree = buildBlockTree(newState, action.blocks); + newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, + ...subTree + }, action.rootClientId ? [action.rootClientId] : [''], true); + break; + } + + case 'UPDATE_BLOCK': + newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, + [action.clientId]: { ...newState.tree[action.clientId], + ...newState.byClientId[action.clientId], + attributes: newState.attributes[action.clientId] + } + }, [action.clientId], false); + break; + + case 'UPDATE_BLOCK_ATTRIBUTES': + { + const newSubTree = action.clientIds.reduce((result, clientId) => { + result[clientId] = { ...newState.tree[clientId], + attributes: newState.attributes[clientId] + }; + return result; + }, {}); + newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, + ...newSubTree + }, action.clientIds, false); + break; + } + + case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': + { + const subTree = buildBlockTree(newState, action.blocks); + newState.tree = updateParentInnerBlocksInTree(newState, { ...(0,external_lodash_namespaceObject.omit)(newState.tree, action.replacedClientIds.concat( // Controlled inner blocks are only removed + // if the block doesn't move to another position + // otherwise their content will be lost. + action.replacedClientIds.filter(clientId => !subTree[clientId]).map(clientId => 'controlled||' + clientId))), + ...subTree + }, action.blocks.map(b => b.clientId), false); // If there are no replaced blocks, it means we're removing blocks so we need to update their parent. + + const parentsOfRemovedBlocks = []; + + for (const clientId of action.clientIds) { + if (state.parents[clientId] !== undefined && (state.parents[clientId] === '' || newState.byClientId[state.parents[clientId]])) { + parentsOfRemovedBlocks.push(state.parents[clientId]); + } + } + + newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, parentsOfRemovedBlocks, true); + break; + } + + case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': + const parentsOfRemovedBlocks = []; + + for (const clientId of action.clientIds) { + if (state.parents[clientId] !== undefined && (state.parents[clientId] === '' || newState.byClientId[state.parents[clientId]])) { + parentsOfRemovedBlocks.push(state.parents[clientId]); + } + } + + newState.tree = updateParentInnerBlocksInTree(newState, (0,external_lodash_namespaceObject.omit)(newState.tree, action.removedClientIds.concat(action.removedClientIds.map(clientId => 'controlled||' + clientId))), parentsOfRemovedBlocks, true); + break; + + case 'MOVE_BLOCKS_TO_POSITION': + { + const updatedBlockUids = []; + + if (action.fromRootClientId) { + updatedBlockUids.push(action.fromRootClientId); + } + + if (action.toRootClientId) { + updatedBlockUids.push(action.toRootClientId); + } + + if (!action.fromRootClientId || !action.fromRootClientId) { + updatedBlockUids.push(''); + } + + newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, updatedBlockUids, true); + break; + } + + case 'MOVE_BLOCKS_UP': + case 'MOVE_BLOCKS_DOWN': + { + const updatedBlockUids = [action.rootClientId ? action.rootClientId : '']; + newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, updatedBlockUids, true); + break; + } + + case 'SAVE_REUSABLE_BLOCK_SUCCESS': + { + const updatedBlockUids = (0,external_lodash_namespaceObject.keys)((0,external_lodash_namespaceObject.omitBy)(newState.attributes, (attributes, clientId) => { + return newState.byClientId[clientId].name !== 'core/block' || attributes.ref !== action.updatedId; + })); + newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree, + ...updatedBlockUids.reduce((result, clientId) => { + result[clientId] = { ...newState.byClientId[clientId], + attributes: newState.attributes[clientId], + innerBlocks: newState.tree[clientId].innerBlocks + }; + return result; + }, {}) + }, updatedBlockUids, false); + } + } + + return newState; +}; +/** + * Higher-order reducer intended to augment the blocks reducer, assigning an + * `isPersistentChange` property value corresponding to whether a change in + * state can be considered as persistent. All changes are considered persistent + * except when updating the same block attribute as in the previous action. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +function withPersistentBlockChange(reducer) { + let lastAction; + let markNextChangeAsNotPersistent = false; + return (state, action) => { + let nextState = reducer(state, action); + const isExplicitPersistentChange = action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' || markNextChangeAsNotPersistent; // Defer to previous state value (or default) unless changing or + // explicitly marking as persistent. + + if (state === nextState && !isExplicitPersistentChange) { + var _state$isPersistentCh; + + markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; + const nextIsPersistentChange = (_state$isPersistentCh = state === null || state === void 0 ? void 0 : state.isPersistentChange) !== null && _state$isPersistentCh !== void 0 ? _state$isPersistentCh : true; + + if (state.isPersistentChange === nextIsPersistentChange) { + return state; + } + + return { ...nextState, + isPersistentChange: nextIsPersistentChange + }; + } + + nextState = { ...nextState, + isPersistentChange: isExplicitPersistentChange ? !markNextChangeAsNotPersistent : !isUpdatingSameBlockAttribute(action, lastAction) + }; // In comparing against the previous action, consider only those which + // would have qualified as one which would have been ignored or not + // have resulted in a changed state. + + lastAction = action; + markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; + return nextState; + }; +} +/** + * Higher-order reducer intended to augment the blocks reducer, assigning an + * `isIgnoredChange` property value corresponding to whether a change in state + * can be considered as ignored. A change is considered ignored when the result + * of an action not incurred by direct user interaction. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +function withIgnoredBlockChange(reducer) { + /** + * Set of action types for which a blocks state change should be ignored. + * + * @type {Set} + */ + const IGNORED_ACTION_TYPES = new Set(['RECEIVE_BLOCKS']); + return (state, action) => { + const nextState = reducer(state, action); + + if (nextState !== state) { + nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type); + } + + return nextState; + }; +} +/** + * Higher-order reducer targeting the combined blocks reducer, augmenting + * block client IDs in remove action to include cascade of inner blocks. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +const withInnerBlocksRemoveCascade = reducer => (state, action) => { + // Gets all children which need to be removed. + const getAllChildren = clientIds => { + let result = clientIds; + + for (let i = 0; i < result.length; i++) { + if (!state.order[result[i]] || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i]]) { + continue; + } + + if (result === clientIds) { + result = [...result]; + } + + result.push(...state.order[result[i]]); + } + + return result; + }; + + if (state) { + switch (action.type) { + case 'REMOVE_BLOCKS': + action = { ...action, + type: 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN', + removedClientIds: getAllChildren(action.clientIds) + }; + break; + + case 'REPLACE_BLOCKS': + action = { ...action, + type: 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN', + replacedClientIds: getAllChildren(action.clientIds) + }; + break; + } + } + + return reducer(state, action); +}; +/** + * Higher-order reducer which targets the combined blocks reducer and handles + * the `RESET_BLOCKS` action. When dispatched, this action will replace all + * blocks that exist in the post, leaving blocks that exist only in state (e.g. + * reusable blocks and blocks controlled by inner blocks controllers) alone. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +const withBlockReset = reducer => (state, action) => { + if (action.type === 'RESET_BLOCKS') { + const newState = { ...state, + byClientId: getFlattenedBlocksWithoutAttributes(action.blocks), + attributes: getFlattenedBlockAttributes(action.blocks), + order: mapBlockOrder(action.blocks), + parents: mapBlockParents(action.blocks), + controlledInnerBlocks: {} + }; + const subTree = buildBlockTree(newState, action.blocks); + newState.tree = { ...subTree, + // Root + '': { + innerBlocks: action.blocks.map(subBlock => subTree[subBlock.clientId]) + } + }; + return newState; + } + + return reducer(state, action); +}; +/** + * Higher-order reducer which targets the combined blocks reducer and handles + * the `REPLACE_INNER_BLOCKS` action. When dispatched, this action the state + * should become equivalent to the execution of a `REMOVE_BLOCKS` action + * containing all the child's of the root block followed by the execution of + * `INSERT_BLOCKS` with the new blocks. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +const withReplaceInnerBlocks = reducer => (state, action) => { + if (action.type !== 'REPLACE_INNER_BLOCKS') { + return reducer(state, action); + } // Finds every nested inner block controller. We must check the action blocks + // and not just the block parent state because some inner block controllers + // should be deleted if specified, whereas others should not be deleted. If + // a controlled should not be deleted, then we need to avoid deleting its + // inner blocks from the block state because its inner blocks will not be + // attached to the block in the action. + + + const nestedControllers = {}; + + if (Object.keys(state.controlledInnerBlocks).length) { + const stack = [...action.blocks]; + + while (stack.length) { + const { + innerBlocks, + ...block + } = stack.shift(); + stack.push(...innerBlocks); + + if (!!state.controlledInnerBlocks[block.clientId]) { + nestedControllers[block.clientId] = true; + } + } + } // The `keepControlledInnerBlocks` prop will keep the inner blocks of the + // marked block in the block state so that they can be reattached to the + // marked block when we re-insert everything a few lines below. + + + let stateAfterBlocksRemoval = state; + + if (state.order[action.rootClientId]) { + stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, { + type: 'REMOVE_BLOCKS', + keepControlledInnerBlocks: nestedControllers, + clientIds: state.order[action.rootClientId] + }); + } + + let stateAfterInsert = stateAfterBlocksRemoval; + + if (action.blocks.length) { + stateAfterInsert = reducer(stateAfterInsert, { ...action, + type: 'INSERT_BLOCKS', + index: 0 + }); // We need to re-attach the block order of the controlled inner blocks. + // Otherwise, an inner block controller's blocks will be deleted entirely + // from its entity.. + + stateAfterInsert.order = { ...stateAfterInsert.order, + ...(0,external_lodash_namespaceObject.reduce)(nestedControllers, (result, value, key) => { + if (state.order[key]) { + result[key] = state.order[key]; + } + + return result; + }, {}) + }; + } + + return stateAfterInsert; +}; +/** + * Higher-order reducer which targets the combined blocks reducer and handles + * the `SAVE_REUSABLE_BLOCK_SUCCESS` action. This action can't be handled by + * regular reducers and needs a higher-order reducer since it needs access to + * both `byClientId` and `attributes` simultaneously. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +const withSaveReusableBlock = reducer => (state, action) => { + if (state && action.type === 'SAVE_REUSABLE_BLOCK_SUCCESS') { + const { + id, + updatedId + } = action; // If a temporary reusable block is saved, we swap the temporary id with the final one + + if (id === updatedId) { + return state; + } + + state = { ...state + }; + state.attributes = (0,external_lodash_namespaceObject.mapValues)(state.attributes, (attributes, clientId) => { + const { + name + } = state.byClientId[clientId]; + + if (name === 'core/block' && attributes.ref === id) { + return { ...attributes, + ref: updatedId + }; + } + + return attributes; + }); + } + + return reducer(state, action); +}; +/** + * Higher-order reducer which removes blocks from state when switching parent block controlled state. + * + * @param {Function} reducer Original reducer function. + * + * @return {Function} Enhanced reducer function. + */ + + +const withResetControlledBlocks = reducer => (state, action) => { + if (action.type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { + // when switching a block from controlled to uncontrolled or inverse, + // we need to remove its content first. + const tempState = reducer(state, { + type: 'REPLACE_INNER_BLOCKS', + rootClientId: action.clientId, + blocks: [] + }); + return reducer(tempState, action); + } + + return reducer(state, action); +}; +/** + * Reducer returning the blocks state. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {Object} Updated state. + */ + + +const blocks = (0,external_lodash_namespaceObject.flow)(external_wp_data_namespaceObject.combineReducers, withSaveReusableBlock, // needs to be before withBlockCache +withBlockTree, // needs to be before withInnerBlocksRemoveCascade +withInnerBlocksRemoveCascade, withReplaceInnerBlocks, // needs to be after withInnerBlocksRemoveCascade +withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks)({ + byClientId() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'RECEIVE_BLOCKS': + case 'INSERT_BLOCKS': + return { ...state, + ...getFlattenedBlocksWithoutAttributes(action.blocks) + }; + + case 'UPDATE_BLOCK': + // Ignore updates if block isn't known + if (!state[action.clientId]) { + return state; + } // Do nothing if only attributes change. + + + const changes = (0,external_lodash_namespaceObject.omit)(action.updates, 'attributes'); + + if ((0,external_lodash_namespaceObject.isEmpty)(changes)) { + return state; + } + + return { ...state, + [action.clientId]: { ...state[action.clientId], + ...changes + } + }; + + case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': + if (!action.blocks) { + return state; + } + + return { ...(0,external_lodash_namespaceObject.omit)(state, action.replacedClientIds), + ...getFlattenedBlocksWithoutAttributes(action.blocks) + }; + + case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': + return (0,external_lodash_namespaceObject.omit)(state, action.removedClientIds); + } + + return state; + }, + + attributes() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'RECEIVE_BLOCKS': + case 'INSERT_BLOCKS': + return { ...state, + ...getFlattenedBlockAttributes(action.blocks) + }; + + case 'UPDATE_BLOCK': + // Ignore updates if block isn't known or there are no attribute changes. + if (!state[action.clientId] || !action.updates.attributes) { + return state; + } + + return { ...state, + [action.clientId]: { ...state[action.clientId], + ...action.updates.attributes + } + }; + + case 'UPDATE_BLOCK_ATTRIBUTES': + { + // Avoid a state change if none of the block IDs are known. + if (action.clientIds.every(id => !state[id])) { + return state; + } + + const next = action.clientIds.reduce((accumulator, id) => ({ ...accumulator, + [id]: (0,external_lodash_namespaceObject.reduce)(action.uniqueByBlock ? action.attributes[id] : action.attributes, (result, value, key) => { + // Consider as updates only changed values. + if (value !== result[key]) { + result = getMutateSafeObject(state[id], result); + result[key] = value; + } + + return result; + }, state[id]) + }), {}); + + if (action.clientIds.every(id => next[id] === state[id])) { + return state; + } + + return { ...state, + ...next + }; + } + + case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': + if (!action.blocks) { + return state; + } + + return { ...(0,external_lodash_namespaceObject.omit)(state, action.replacedClientIds), + ...getFlattenedBlockAttributes(action.blocks) + }; + + case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': + return (0,external_lodash_namespaceObject.omit)(state, action.removedClientIds); + } + + return state; + }, + + order() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'RECEIVE_BLOCKS': + { + const blockOrder = mapBlockOrder(action.blocks); + return { ...state, + ...(0,external_lodash_namespaceObject.omit)(blockOrder, ''), + '': ((state === null || state === void 0 ? void 0 : state['']) || []).concat(blockOrder['']) + }; + } + + case 'INSERT_BLOCKS': + { + const { + rootClientId = '' + } = action; + const subState = state[rootClientId] || []; + const mappedBlocks = mapBlockOrder(action.blocks, rootClientId); + const { + index = subState.length + } = action; + return { ...state, + ...mappedBlocks, + [rootClientId]: insertAt(subState, mappedBlocks[rootClientId], index) + }; + } + + case 'MOVE_BLOCKS_TO_POSITION': + { + const { + fromRootClientId = '', + toRootClientId = '', + clientIds + } = action; + const { + index = state[toRootClientId].length + } = action; // Moving inside the same parent block + + if (fromRootClientId === toRootClientId) { + const subState = state[toRootClientId]; + const fromIndex = subState.indexOf(clientIds[0]); + return { ...state, + [toRootClientId]: moveTo(state[toRootClientId], fromIndex, index, clientIds.length) + }; + } // Moving from a parent block to another + + + return { ...state, + [fromRootClientId]: (0,external_lodash_namespaceObject.without)(state[fromRootClientId], ...clientIds), + [toRootClientId]: insertAt(state[toRootClientId], clientIds, index) + }; + } + + case 'MOVE_BLOCKS_UP': + { + const { + clientIds, + rootClientId = '' + } = action; + const firstClientId = (0,external_lodash_namespaceObject.first)(clientIds); + const subState = state[rootClientId]; + + if (!subState.length || firstClientId === (0,external_lodash_namespaceObject.first)(subState)) { + return state; + } + + const firstIndex = subState.indexOf(firstClientId); + return { ...state, + [rootClientId]: moveTo(subState, firstIndex, firstIndex - 1, clientIds.length) + }; + } + + case 'MOVE_BLOCKS_DOWN': + { + const { + clientIds, + rootClientId = '' + } = action; + const firstClientId = (0,external_lodash_namespaceObject.first)(clientIds); + const lastClientId = (0,external_lodash_namespaceObject.last)(clientIds); + const subState = state[rootClientId]; + + if (!subState.length || lastClientId === (0,external_lodash_namespaceObject.last)(subState)) { + return state; + } + + const firstIndex = subState.indexOf(firstClientId); + return { ...state, + [rootClientId]: moveTo(subState, firstIndex, firstIndex + 1, clientIds.length) + }; + } + + case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': + { + const { + clientIds + } = action; + + if (!action.blocks) { + return state; + } + + const mappedBlocks = mapBlockOrder(action.blocks); + return (0,external_lodash_namespaceObject.flow)([nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.replacedClientIds), nextState => ({ ...nextState, + ...(0,external_lodash_namespaceObject.omit)(mappedBlocks, '') + }), nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState => (0,external_lodash_namespaceObject.reduce)(subState, (result, clientId) => { + if (clientId === clientIds[0]) { + return [...result, ...mappedBlocks['']]; + } + + if (clientIds.indexOf(clientId) === -1) { + result.push(clientId); + } + + return result; + }, []))])(state); + } + + case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': + return (0,external_lodash_namespaceObject.flow)([// Remove inner block ordering for removed blocks + nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.removedClientIds), // Remove deleted blocks from other blocks' orderings + nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState => (0,external_lodash_namespaceObject.without)(subState, ...action.removedClientIds))])(state); + } + + return state; + }, + + // While technically redundant data as the inverse of `order`, it serves as + // an optimization for the selectors which derive the ancestry of a block. + parents() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'RECEIVE_BLOCKS': + return { ...state, + ...mapBlockParents(action.blocks) + }; + + case 'INSERT_BLOCKS': + return { ...state, + ...mapBlockParents(action.blocks, action.rootClientId || '') + }; + + case 'MOVE_BLOCKS_TO_POSITION': + { + return { ...state, + ...action.clientIds.reduce((accumulator, id) => { + accumulator[id] = action.toRootClientId || ''; + return accumulator; + }, {}) + }; + } + + case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': + return { ...(0,external_lodash_namespaceObject.omit)(state, action.replacedClientIds), + ...mapBlockParents(action.blocks, state[action.clientIds[0]]) + }; + + case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': + return (0,external_lodash_namespaceObject.omit)(state, action.removedClientIds); + } + + return state; + }, + + controlledInnerBlocks() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let { + type, + clientId, + hasControlledInnerBlocks + } = arguments.length > 1 ? arguments[1] : undefined; + + if (type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { + return { ...state, + [clientId]: hasControlledInnerBlocks + }; + } + + return state; + } + +}); +/** + * Reducer returning typing state. + * + * @param {boolean} state Current state. + * @param {Object} action Dispatched action. + * + * @return {boolean} Updated state. + */ + +function isTyping() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'START_TYPING': + return true; + + case 'STOP_TYPING': + return false; + } + + return state; +} +/** + * Reducer returning dragged block client id. + * + * @param {string[]} state Current state. + * @param {Object} action Dispatched action. + * + * @return {string[]} Updated state. + */ + +function draggedBlocks() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'START_DRAGGING_BLOCKS': + return action.clientIds; + + case 'STOP_DRAGGING_BLOCKS': + return []; + } + + return state; +} +/** + * Reducer returning whether the caret is within formatted text. + * + * @param {boolean} state Current state. + * @param {Object} action Dispatched action. + * + * @return {boolean} Updated state. + */ + +function isCaretWithinFormattedText() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'ENTER_FORMATTED_TEXT': + return true; + + case 'EXIT_FORMATTED_TEXT': + return false; + } + + return state; +} +/** + * Internal helper reducer for selectionStart and selectionEnd. Can hold a block + * selection, represented by an object with property clientId. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {Object} Updated state. + */ + +function selectionHelper() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'CLEAR_SELECTED_BLOCK': + { + if (state.clientId) { + return {}; + } + + return state; + } + + case 'SELECT_BLOCK': + if (action.clientId === state.clientId) { + return state; + } + + return { + clientId: action.clientId + }; + + case 'REPLACE_INNER_BLOCKS': + case 'INSERT_BLOCKS': + { + if (!action.updateSelection || !action.blocks.length) { + return state; + } + + return { + clientId: action.blocks[0].clientId + }; + } + + case 'REMOVE_BLOCKS': + if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) { + return state; + } + + return {}; + + case 'REPLACE_BLOCKS': + { + if (action.clientIds.indexOf(state.clientId) === -1) { + return state; + } + + const blockToSelect = action.blocks[action.indexToSelect] || action.blocks[action.blocks.length - 1]; + + if (!blockToSelect) { + return {}; + } + + if (blockToSelect.clientId === state.clientId) { + return state; + } + + return { + clientId: blockToSelect.clientId + }; + } + } + + return state; +} +/** + * Reducer returning the selection state. + * + * @param {boolean} state Current state. + * @param {Object} action Dispatched action. + * + * @return {boolean} Updated state. + */ + + +function selection() { + var _state$selectionStart, _state$selectionEnd; + + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'SELECTION_CHANGE': + return { + selectionStart: { + clientId: action.clientId, + attributeKey: action.attributeKey, + offset: action.startOffset + }, + selectionEnd: { + clientId: action.clientId, + attributeKey: action.attributeKey, + offset: action.endOffset + } + }; + + case 'RESET_SELECTION': + const { + selectionStart, + selectionEnd + } = action; + return { + selectionStart, + selectionEnd + }; + + case 'MULTI_SELECT': + const { + start, + end + } = action; + return { + selectionStart: { + clientId: start + }, + selectionEnd: { + clientId: end + } + }; + + case 'RESET_BLOCKS': + const startClientId = state === null || state === void 0 ? void 0 : (_state$selectionStart = state.selectionStart) === null || _state$selectionStart === void 0 ? void 0 : _state$selectionStart.clientId; + const endClientId = state === null || state === void 0 ? void 0 : (_state$selectionEnd = state.selectionEnd) === null || _state$selectionEnd === void 0 ? void 0 : _state$selectionEnd.clientId; // Do nothing if there's no selected block. + + if (!startClientId && !endClientId) { + return state; + } // If the start of the selection won't exist after reset, remove selection. + + + if (!action.blocks.some(block => block.clientId === startClientId)) { + return { + selectionStart: {}, + selectionEnd: {} + }; + } // If the end of the selection won't exist after reset, collapse selection. + + + if (!action.blocks.some(block => block.clientId === endClientId)) { + return { ...state, + selectionEnd: state.selectionStart + }; + } + + } + + return { + selectionStart: selectionHelper(state.selectionStart, action), + selectionEnd: selectionHelper(state.selectionEnd, action) + }; +} +/** + * Reducer returning whether the user is multi-selecting. + * + * @param {boolean} state Current state. + * @param {Object} action Dispatched action. + * + * @return {boolean} Updated state. + */ + +function isMultiSelecting() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'START_MULTI_SELECT': + return true; + + case 'STOP_MULTI_SELECT': + return false; + } + + return state; +} +/** + * Reducer returning whether selection is enabled. + * + * @param {boolean} state Current state. + * @param {Object} action Dispatched action. + * + * @return {boolean} Updated state. + */ + +function isSelectionEnabled() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'TOGGLE_SELECTION': + return action.isSelectionEnabled; + } + + return state; +} +/** + * Reducer returning the intial block selection. + * + * Currently this in only used to restore the selection after block deletion and + * pasting new content.This reducer should eventually be removed in favour of setting + * selection directly. + * + * @param {boolean} state Current state. + * @param {Object} action Dispatched action. + * + * @return {number|null} Initial position: 0, -1 or null. + */ + +function initialPosition() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let action = arguments.length > 1 ? arguments[1] : undefined; + + if (action.type === 'REPLACE_BLOCKS' && action.initialPosition !== undefined) { + return action.initialPosition; + } else if (['SELECT_BLOCK', 'RESET_SELECTION', 'INSERT_BLOCKS', 'REPLACE_INNER_BLOCKS'].includes(action.type)) { + return action.initialPosition; + } + + return state; +} +function blocksMode() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + if (action.type === 'TOGGLE_BLOCK_MODE') { + const { + clientId + } = action; + return { ...state, + [clientId]: state[clientId] && state[clientId] === 'html' ? 'visual' : 'html' + }; + } + + return state; +} +/** + * Reducer returning the block insertion point visibility, either null if there + * is not an explicit insertion point assigned, or an object of its `index` and + * `rootClientId`. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {Object} Updated state. + */ + +function insertionPoint() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'SHOW_INSERTION_POINT': + const { + rootClientId, + index, + __unstableWithInserter + } = action; + return { + rootClientId, + index, + __unstableWithInserter + }; + + case 'HIDE_INSERTION_POINT': + return null; + } + + return state; +} +/** + * Reducer returning whether the post blocks match the defined template or not. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {boolean} Updated state. + */ + +function template() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + isValid: true + }; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'SET_TEMPLATE_VALIDITY': + return { ...state, + isValid: action.isValid + }; + } + + return state; +} +/** + * Reducer returning the editor setting. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {Object} Updated state. + */ + +function settings() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SETTINGS_DEFAULTS; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'UPDATE_SETTINGS': + return { ...state, + ...action.settings + }; + } + + return state; +} +/** + * Reducer returning the user preferences. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {string} Updated state. + */ + +function preferences() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PREFERENCES_DEFAULTS; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'INSERT_BLOCKS': + case 'REPLACE_BLOCKS': + return action.blocks.reduce((prevState, block) => { + const { + attributes, + name: blockName + } = block; + const match = (0,external_wp_data_namespaceObject.select)(external_wp_blocks_namespaceObject.store).getActiveBlockVariation(blockName, attributes); // If a block variation match is found change the name to be the same with the + // one that is used for block variations in the Inserter (`getItemFromVariation`). + + let id = match !== null && match !== void 0 && match.name ? `${blockName}/${match.name}` : blockName; + const insert = { + name: id + }; + + if (blockName === 'core/block') { + insert.ref = attributes.ref; + id += '/' + attributes.ref; + } + + return { ...prevState, + insertUsage: { ...prevState.insertUsage, + [id]: { + time: action.time, + count: prevState.insertUsage[id] ? prevState.insertUsage[id].count + 1 : 1, + insert + } + } + }; + }, state); + } + + return state; +} +/** + * Reducer returning an object where each key is a block client ID, its value + * representing the settings for its nested blocks. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {Object} Updated state. + */ + +const blockListSettings = function () { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + // Even if the replaced blocks have the same client ID, our logic + // should correct the state. + case 'REPLACE_BLOCKS': + case 'REMOVE_BLOCKS': + { + return (0,external_lodash_namespaceObject.omit)(state, action.clientIds); + } + + case 'UPDATE_BLOCK_LIST_SETTINGS': + { + const { + clientId + } = action; + + if (!action.settings) { + if (state.hasOwnProperty(clientId)) { + return (0,external_lodash_namespaceObject.omit)(state, clientId); + } + + return state; + } + + if ((0,external_lodash_namespaceObject.isEqual)(state[clientId], action.settings)) { + return state; + } + + return { ...state, + [clientId]: action.settings + }; + } + } + + return state; +}; +/** + * Reducer returning whether the navigation mode is enabled or not. + * + * @param {string} state Current state. + * @param {Object} action Dispatched action. + * + * @return {string} Updated state. + */ + +function isNavigationMode() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + let action = arguments.length > 1 ? arguments[1] : undefined; + + // Let inserting block always trigger Edit mode. + if (action.type === 'INSERT_BLOCKS') { + return false; + } + + if (action.type === 'SET_NAVIGATION_MODE') { + return action.isNavigationMode; + } + + return state; +} +/** + * Reducer returning whether the block moving mode is enabled or not. + * + * @param {string|null} state Current state. + * @param {Object} action Dispatched action. + * + * @return {string|null} Updated state. + */ + +function hasBlockMovingClientId() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let action = arguments.length > 1 ? arguments[1] : undefined; + + // Let inserting block always trigger Edit mode. + if (action.type === 'SET_BLOCK_MOVING_MODE') { + return action.hasBlockMovingClientId; + } + + if (action.type === 'SET_NAVIGATION_MODE') { + return null; + } + + return state; +} +/** + * Reducer return an updated state representing the most recent block attribute + * update. The state is structured as an object where the keys represent the + * client IDs of blocks, the values a subset of attributes from the most recent + * block update. The state is always reset to null if the last action is + * anything other than an attributes update. + * + * @param {Object} state Current state. + * @param {Object} action Action object. + * + * @return {[string,Object]} Updated state. + */ + +function lastBlockAttributesChange(state, action) { + switch (action.type) { + case 'UPDATE_BLOCK': + if (!action.updates.attributes) { + break; + } + + return { + [action.clientId]: action.updates.attributes + }; + + case 'UPDATE_BLOCK_ATTRIBUTES': + return action.clientIds.reduce((accumulator, id) => ({ ...accumulator, + [id]: action.uniqueByBlock ? action.attributes[id] : action.attributes + }), {}); + } + + return null; +} +/** + * Reducer returning automatic change state. + * + * @param {boolean} state Current state. + * @param {Object} action Dispatched action. + * + * @return {string} Updated state. + */ + +function automaticChangeStatus(state, action) { + switch (action.type) { + case 'MARK_AUTOMATIC_CHANGE': + return 'pending'; + + case 'MARK_AUTOMATIC_CHANGE_FINAL': + if (state === 'pending') { + return 'final'; + } + + return; + + case 'SELECTION_CHANGE': + // As long as the state is not final, ignore any selection changes. + if (state !== 'final') { + return state; + } + + return; + // Undoing an automatic change should still be possible after mouse + // move. + + case 'START_TYPING': + case 'STOP_TYPING': + return state; + } // Reset the state by default (for any action not handled). + +} +/** + * Reducer returning current highlighted block. + * + * @param {boolean} state Current highlighted block. + * @param {Object} action Dispatched action. + * + * @return {string} Updated state. + */ + +function highlightedBlock(state, action) { + switch (action.type) { + case 'TOGGLE_BLOCK_HIGHLIGHT': + const { + clientId, + isHighlighted + } = action; + + if (isHighlighted) { + return clientId; + } else if (state === clientId) { + return null; + } + + return state; + + case 'SELECT_BLOCK': + if (action.clientId !== state) { + return null; + } + + } + + return state; +} +/** + * Reducer returning the block insertion event list state. + * + * @param {Object} state Current state. + * @param {Object} action Dispatched action. + * + * @return {Object} Updated state. + */ + +function lastBlockInserted() { + var _action$meta; + + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case 'INSERT_BLOCKS': + if (!action.blocks.length) { + return state; + } + + const clientId = action.blocks[0].clientId; + const source = (_action$meta = action.meta) === null || _action$meta === void 0 ? void 0 : _action$meta.source; + return { + clientId, + source + }; + + case 'RESET_BLOCKS': + return {}; + } + + return state; +} +/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ + blocks, + isTyping, + draggedBlocks, + isCaretWithinFormattedText, + selection, + isMultiSelecting, + isSelectionEnabled, + initialPosition, + blocksMode, + blockListSettings, + insertionPoint, + template, + settings, + preferences, + lastBlockAttributesChange, + isNavigationMode, + hasBlockMovingClientId, + automaticChangeStatus, + highlightedBlock, + lastBlockInserted +})); + +;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js + + +var LEAF_KEY, hasWeakMap; + +/** + * Arbitrary value used as key for referencing cache object in WeakMap tree. + * + * @type {Object} + */ +LEAF_KEY = {}; + +/** + * Whether environment supports WeakMap. + * + * @type {boolean} + */ +hasWeakMap = typeof WeakMap !== 'undefined'; + +/** + * Returns the first argument as the sole entry in an array. + * + * @param {*} value Value to return. + * + * @return {Array} Value returned as entry in array. + */ +function arrayOf( value ) { + return [ value ]; +} + +/** + * Returns true if the value passed is object-like, or false otherwise. A value + * is object-like if it can support property assignment, e.g. object or array. + * + * @param {*} value Value to test. + * + * @return {boolean} Whether value is object-like. + */ +function isObjectLike( value ) { + return !! value && 'object' === typeof value; +} + +/** + * Creates and returns a new cache object. + * + * @return {Object} Cache object. + */ +function createCache() { + var cache = { + clear: function() { + cache.head = null; + }, + }; + + return cache; +} + +/** + * Returns true if entries within the two arrays are strictly equal by + * reference from a starting index. + * + * @param {Array} a First array. + * @param {Array} b Second array. + * @param {number} fromIndex Index from which to start comparison. + * + * @return {boolean} Whether arrays are shallowly equal. + */ +function isShallowEqual( a, b, fromIndex ) { + var i; + + if ( a.length !== b.length ) { + return false; + } + + for ( i = fromIndex; i < a.length; i++ ) { + if ( a[ i ] !== b[ i ] ) { + return false; + } + } + + return true; +} + +/** + * Returns a memoized selector function. The getDependants function argument is + * called before the memoized selector and is expected to return an immutable + * reference or array of references on which the selector depends for computing + * its own return value. The memoize cache is preserved only as long as those + * dependant references remain the same. If getDependants returns a different + * reference(s), the cache is cleared and the selector value regenerated. + * + * @param {Function} selector Selector function. + * @param {Function} getDependants Dependant getter returning an immutable + * reference or array of reference used in + * cache bust consideration. + * + * @return {Function} Memoized selector. + */ +/* harmony default export */ function rememo(selector, getDependants ) { + var rootCache, getCache; + + // Use object source as dependant if getter not provided + if ( ! getDependants ) { + getDependants = arrayOf; + } + + /** + * Returns the root cache. If WeakMap is supported, this is assigned to the + * root WeakMap cache set, otherwise it is a shared instance of the default + * cache object. + * + * @return {(WeakMap|Object)} Root cache object. + */ + function getRootCache() { + return rootCache; + } + + /** + * Returns the cache for a given dependants array. When possible, a WeakMap + * will be used to create a unique cache for each set of dependants. This + * is feasible due to the nature of WeakMap in allowing garbage collection + * to occur on entries where the key object is no longer referenced. Since + * WeakMap requires the key to be an object, this is only possible when the + * dependant is object-like. The root cache is created as a hierarchy where + * each top-level key is the first entry in a dependants set, the value a + * WeakMap where each key is the next dependant, and so on. This continues + * so long as the dependants are object-like. If no dependants are object- + * like, then the cache is shared across all invocations. + * + * @see isObjectLike + * + * @param {Array} dependants Selector dependants. + * + * @return {Object} Cache object. + */ + function getWeakMapCache( dependants ) { + var caches = rootCache, + isUniqueByDependants = true, + i, dependant, map, cache; + + for ( i = 0; i < dependants.length; i++ ) { + dependant = dependants[ i ]; + + // Can only compose WeakMap from object-like key. + if ( ! isObjectLike( dependant ) ) { + isUniqueByDependants = false; + break; + } + + // Does current segment of cache already have a WeakMap? + if ( caches.has( dependant ) ) { + // Traverse into nested WeakMap. + caches = caches.get( dependant ); + } else { + // Create, set, and traverse into a new one. + map = new WeakMap(); + caches.set( dependant, map ); + caches = map; + } + } + + // We use an arbitrary (but consistent) object as key for the last item + // in the WeakMap to serve as our running cache. + if ( ! caches.has( LEAF_KEY ) ) { + cache = createCache(); + cache.isUniqueByDependants = isUniqueByDependants; + caches.set( LEAF_KEY, cache ); + } + + return caches.get( LEAF_KEY ); + } + + // Assign cache handler by availability of WeakMap + getCache = hasWeakMap ? getWeakMapCache : getRootCache; + + /** + * Resets root memoization cache. + */ + function clear() { + rootCache = hasWeakMap ? new WeakMap() : createCache(); + } + + // eslint-disable-next-line jsdoc/check-param-names + /** + * The augmented selector call, considering first whether dependants have + * changed before passing it to underlying memoize function. + * + * @param {Object} source Source object for derivation. + * @param {...*} extraArgs Additional arguments to pass to selector. + * + * @return {*} Selector result. + */ + function callSelector( /* source, ...extraArgs */ ) { + var len = arguments.length, + cache, node, i, args, dependants; + + // Create copy of arguments (avoid leaking deoptimization). + args = new Array( len ); + for ( i = 0; i < len; i++ ) { + args[ i ] = arguments[ i ]; + } + + dependants = getDependants.apply( null, args ); + cache = getCache( dependants ); + + // If not guaranteed uniqueness by dependants (primitive type or lack + // of WeakMap support), shallow compare against last dependants and, if + // references have changed, destroy cache to recalculate result. + if ( ! cache.isUniqueByDependants ) { + if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) { + cache.clear(); + } + + cache.lastDependants = dependants; + } + + node = cache.head; + while ( node ) { + // Check whether node arguments match arguments + if ( ! isShallowEqual( node.args, args, 1 ) ) { + node = node.next; + continue; + } + + // At this point we can assume we've found a match + + // Surface matched node to head if not already + if ( node !== cache.head ) { + // Adjust siblings to point to each other. + node.prev.next = node.next; + if ( node.next ) { + node.next.prev = node.prev; + } + + node.next = cache.head; + node.prev = null; + cache.head.prev = node; + cache.head = node; + } + + // Return immediately + return node.val; + } + + // No cached value found. Continue to insertion phase: + + node = { + // Generate the result from original function + val: selector.apply( null, args ), + }; + + // Avoid including the source object in the cache. + args[ 0 ] = null; + node.args = args; + + // Don't need to check whether node is already head, since it would + // have been returned above already if it was + + // Shift existing head down list + if ( cache.head ) { + cache.head.prev = node; + node.next = cache.head; + } + + cache.head = node; + + return node.val; + } + + callSelector.getDependants = getDependants; + callSelector.clear = clear; + clear(); + + return callSelector; +} + +;// CONCATENATED MODULE: external ["wp","primitives"] +var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js + + +/** + * WordPress dependencies + */ + +const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var library_symbol = (symbol); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + +/** + * A block selection object. + * + * @typedef {Object} WPBlockSelection + * + * @property {string} clientId A block client ID. + * @property {string} attributeKey A block attribute key. + * @property {number} offset An attribute value offset, based on the rich + * text value. See `wp.richText.create`. + */ +// Module constants + +const MILLISECONDS_PER_HOUR = 3600 * 1000; +const MILLISECONDS_PER_DAY = 24 * 3600 * 1000; +const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000; +/** + * Shared reference to an empty array for cases where it is important to avoid + * returning a new array reference on every invocation, as in a connected or + * other pure component which performs `shouldComponentUpdate` check on props. + * This should be used as a last resort, since the normalized data should be + * maintained by the reducer result in state. + * + * @type {Array} + */ + +const EMPTY_ARRAY = []; +/** + * Returns a block's name given its client ID, or null if no block exists with + * the client ID. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {string} Block name. + */ + +function getBlockName(state, clientId) { + const block = state.blocks.byClientId[clientId]; + const socialLinkName = 'core/social-link'; + + if (external_wp_element_namespaceObject.Platform.OS !== 'web' && (block === null || block === void 0 ? void 0 : block.name) === socialLinkName) { + const attributes = state.blocks.attributes[clientId]; + const { + service + } = attributes; + return service ? `${socialLinkName}-${service}` : socialLinkName; + } + + return block ? block.name : null; +} +/** + * Returns whether a block is valid or not. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {boolean} Is Valid. + */ + +function isBlockValid(state, clientId) { + const block = state.blocks.byClientId[clientId]; + return !!block && block.isValid; +} +/** + * Returns a block's attributes given its client ID, or null if no block exists with + * the client ID. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {Object?} Block attributes. + */ + +function getBlockAttributes(state, clientId) { + const block = state.blocks.byClientId[clientId]; + + if (!block) { + return null; + } + + return state.blocks.attributes[clientId]; +} +/** + * Returns a block given its client ID. This is a parsed copy of the block, + * containing its `blockName`, `clientId`, and current `attributes` state. This + * is not the block's registration settings, which must be retrieved from the + * blocks module registration store. + * + * getBlock recurses through its inner blocks until all its children blocks have + * been retrieved. Note that getBlock will not return the child inner blocks of + * an inner block controller. This is because an inner block controller syncs + * itself with its own entity, and should therefore not be included with the + * blocks of a different entity. For example, say you call `getBlocks( TP )` to + * get the blocks of a template part. If another template part is a child of TP, + * then the nested template part's child blocks will not be returned. This way, + * the template block itself is considered part of the parent, but the children + * are not. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {Object} Parsed block object. + */ + +function getBlock(state, clientId) { + const block = state.blocks.byClientId[clientId]; + + if (!block) { + return null; + } + + return state.blocks.tree[clientId]; +} +const __unstableGetBlockWithoutInnerBlocks = rememo((state, clientId) => { + const block = state.blocks.byClientId[clientId]; + + if (!block) { + return null; + } + + return { ...block, + attributes: getBlockAttributes(state, clientId) + }; +}, (state, clientId) => [state.blocks.byClientId[clientId], state.blocks.attributes[clientId]]); +/** + * Returns all block objects for the current post being edited as an array in + * the order they appear in the post. Note that this will exclude child blocks + * of nested inner block controllers. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {Object[]} Post blocks. + */ + +function getBlocks(state, rootClientId) { + var _state$blocks$tree$tr; + + const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || '' : 'controlled||' + rootClientId; + return ((_state$blocks$tree$tr = state.blocks.tree[treeKey]) === null || _state$blocks$tree$tr === void 0 ? void 0 : _state$blocks$tree$tr.innerBlocks) || EMPTY_ARRAY; +} +/** + * Returns a stripped down block object containing only its client ID, + * and its inner blocks' client IDs. + * + * @param {Object} state Editor state. + * @param {string} clientId Client ID of the block to get. + * + * @return {Object} Client IDs of the post blocks. + */ + +const __unstableGetClientIdWithClientIdsTree = rememo((state, clientId) => ({ + clientId, + innerBlocks: __unstableGetClientIdsTree(state, clientId) +}), state => [state.blocks.order]); +/** + * Returns the block tree represented in the block-editor store from the + * given root, consisting of stripped down block objects containing only + * their client IDs, and their inner blocks' client IDs. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {Object[]} Client IDs of the post blocks. + */ + +const __unstableGetClientIdsTree = rememo(function (state) { + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return (0,external_lodash_namespaceObject.map)(getBlockOrder(state, rootClientId), clientId => __unstableGetClientIdWithClientIdsTree(state, clientId)); +}, state => [state.blocks.order]); +/** + * Returns an array containing the clientIds of all descendants + * of the blocks given. + * + * @param {Object} state Global application state. + * @param {Array} clientIds Array of blocks to inspect. + * + * @return {Array} ids of descendants. + */ + +const getClientIdsOfDescendants = (state, clientIds) => (0,external_lodash_namespaceObject.flatMap)(clientIds, clientId => { + const descendants = getBlockOrder(state, clientId); + return [...descendants, ...getClientIdsOfDescendants(state, descendants)]; +}); +/** + * Returns an array containing the clientIds of the top-level blocks + * and their descendants of any depth (for nested blocks). + * + * @param {Object} state Global application state. + * + * @return {Array} ids of top-level and descendant blocks. + */ + +const getClientIdsWithDescendants = rememo(state => { + const topLevelIds = getBlockOrder(state); + return [...topLevelIds, ...getClientIdsOfDescendants(state, topLevelIds)]; +}, state => [state.blocks.order]); +/** + * Returns the total number of blocks, or the total number of blocks with a specific name in a post. + * The number returned includes nested blocks. + * + * @param {Object} state Global application state. + * @param {?string} blockName Optional block name, if specified only blocks of that type will be counted. + * + * @return {number} Number of blocks in the post, or number of blocks with name equal to blockName. + */ + +const getGlobalBlockCount = rememo((state, blockName) => { + const clientIds = getClientIdsWithDescendants(state); + + if (!blockName) { + return clientIds.length; + } + + return (0,external_lodash_namespaceObject.reduce)(clientIds, (accumulator, clientId) => { + const block = state.blocks.byClientId[clientId]; + return block.name === blockName ? accumulator + 1 : accumulator; + }, 0); +}, state => [state.blocks.order, state.blocks.byClientId]); +/** + * Given an array of block client IDs, returns the corresponding array of block + * objects. + * + * @param {Object} state Editor state. + * @param {string[]} clientIds Client IDs for which blocks are to be returned. + * + * @return {WPBlock[]} Block objects. + */ + +const getBlocksByClientId = rememo((state, clientIds) => (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.castArray)(clientIds), clientId => getBlock(state, clientId)), (state, clientIds) => (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.castArray)(clientIds), clientId => state.blocks.tree[clientId])); +/** + * Returns the number of blocks currently present in the post. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {number} Number of blocks in the post. + */ + +function getBlockCount(state, rootClientId) { + return getBlockOrder(state, rootClientId).length; +} +/** + * Returns the current selection start block client ID, attribute key and text + * offset. + * + * @param {Object} state Block editor state. + * + * @return {WPBlockSelection} Selection start information. + */ + +function getSelectionStart(state) { + return state.selection.selectionStart; +} +/** + * Returns the current selection end block client ID, attribute key and text + * offset. + * + * @param {Object} state Block editor state. + * + * @return {WPBlockSelection} Selection end information. + */ + +function getSelectionEnd(state) { + return state.selection.selectionEnd; +} +/** + * Returns the current block selection start. This value may be null, and it + * may represent either a singular block selection or multi-selection start. + * A selection is singular if its start and end match. + * + * @param {Object} state Global application state. + * + * @return {?string} Client ID of block selection start. + */ + +function getBlockSelectionStart(state) { + return state.selection.selectionStart.clientId; +} +/** + * Returns the current block selection end. This value may be null, and it + * may represent either a singular block selection or multi-selection end. + * A selection is singular if its start and end match. + * + * @param {Object} state Global application state. + * + * @return {?string} Client ID of block selection end. + */ + +function getBlockSelectionEnd(state) { + return state.selection.selectionEnd.clientId; +} +/** + * Returns the number of blocks currently selected in the post. + * + * @param {Object} state Global application state. + * + * @return {number} Number of blocks selected in the post. + */ + +function getSelectedBlockCount(state) { + const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length; + + if (multiSelectedBlockCount) { + return multiSelectedBlockCount; + } + + return state.selection.selectionStart.clientId ? 1 : 0; +} +/** + * Returns true if there is a single selected block, or false otherwise. + * + * @param {Object} state Editor state. + * + * @return {boolean} Whether a single block is selected. + */ + +function hasSelectedBlock(state) { + const { + selectionStart, + selectionEnd + } = state.selection; + return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId; +} +/** + * Returns the currently selected block client ID, or null if there is no + * selected block. + * + * @param {Object} state Editor state. + * + * @return {?string} Selected block client ID. + */ + +function getSelectedBlockClientId(state) { + const { + selectionStart, + selectionEnd + } = state.selection; + const { + clientId + } = selectionStart; + + if (!clientId || clientId !== selectionEnd.clientId) { + return null; + } + + return clientId; +} +/** + * Returns the currently selected block, or null if there is no selected block. + * + * @param {Object} state Global application state. + * + * @return {?Object} Selected block. + */ + +function getSelectedBlock(state) { + const clientId = getSelectedBlockClientId(state); + return clientId ? getBlock(state, clientId) : null; +} +/** + * Given a block client ID, returns the root block from which the block is + * nested, an empty string for top-level blocks, or null if the block does not + * exist. + * + * @param {Object} state Editor state. + * @param {string} clientId Block from which to find root client ID. + * + * @return {?string} Root client ID, if exists + */ + +function getBlockRootClientId(state, clientId) { + return state.blocks.parents[clientId] !== undefined ? state.blocks.parents[clientId] : null; +} +/** + * Given a block client ID, returns the list of all its parents from top to bottom. + * + * @param {Object} state Editor state. + * @param {string} clientId Block from which to find root client ID. + * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false). + * + * @return {Array} ClientIDs of the parent blocks. + */ + +const getBlockParents = rememo(function (state, clientId) { + let ascending = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const parents = []; + let current = clientId; + + while (!!state.blocks.parents[current]) { + current = state.blocks.parents[current]; + parents.push(current); + } + + return ascending ? parents : parents.reverse(); +}, state => [state.blocks.parents]); +/** + * Given a block client ID and a block name, returns the list of all its parents + * from top to bottom, filtered by the given name(s). For example, if passed + * 'core/group' as the blockName, it will only return parents which are group + * blocks. If passed `[ 'core/group', 'core/cover']`, as the blockName, it will + * return parents which are group blocks and parents which are cover blocks. + * + * @param {Object} state Editor state. + * @param {string} clientId Block from which to find root client ID. + * @param {string|string[]} blockName Block name(s) to filter. + * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false). + * + * @return {Array} ClientIDs of the parent blocks. + */ + +const getBlockParentsByBlockName = rememo(function (state, clientId, blockName) { + let ascending = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + const parents = getBlockParents(state, clientId, ascending); + return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)((0,external_lodash_namespaceObject.map)(parents, id => ({ + id, + name: getBlockName(state, id) + })), _ref => { + let { + name + } = _ref; + + if (Array.isArray(blockName)) { + return blockName.includes(name); + } + + return name === blockName; + }), _ref2 => { + let { + id + } = _ref2; + return id; + }); +}, state => [state.blocks.parents]); +/** + * Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks. + * + * @param {Object} state Editor state. + * @param {string} clientId Block from which to find root client ID. + * + * @return {string} Root client ID + */ + +function getBlockHierarchyRootClientId(state, clientId) { + let current = clientId; + let parent; + + do { + parent = current; + current = state.blocks.parents[current]; + } while (current); + + return parent; +} +/** + * Given a block client ID, returns the lowest common ancestor with selected client ID. + * + * @param {Object} state Editor state. + * @param {string} clientId Block from which to find common ancestor client ID. + * + * @return {string} Common ancestor client ID or undefined + */ + +function getLowestCommonAncestorWithSelectedBlock(state, clientId) { + const selectedId = getSelectedBlockClientId(state); + const clientParents = [...getBlockParents(state, clientId), clientId]; + const selectedParents = [...getBlockParents(state, selectedId), selectedId]; + let lowestCommonAncestor; + const maxDepth = Math.min(clientParents.length, selectedParents.length); + + for (let index = 0; index < maxDepth; index++) { + if (clientParents[index] === selectedParents[index]) { + lowestCommonAncestor = clientParents[index]; + } else { + break; + } + } + + return lowestCommonAncestor; +} +/** + * Returns the client ID of the block adjacent one at the given reference + * startClientId and modifier directionality. Defaults start startClientId to + * the selected block, and direction as next block. Returns null if there is no + * adjacent block. + * + * @param {Object} state Editor state. + * @param {?string} startClientId Optional client ID of block from which to + * search. + * @param {?number} modifier Directionality multiplier (1 next, -1 + * previous). + * + * @return {?string} Return the client ID of the block, or null if none exists. + */ + +function getAdjacentBlockClientId(state, startClientId) { + let modifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; + + // Default to selected block. + if (startClientId === undefined) { + startClientId = getSelectedBlockClientId(state); + } // Try multi-selection starting at extent based on modifier. + + + if (startClientId === undefined) { + if (modifier < 0) { + startClientId = getFirstMultiSelectedBlockClientId(state); + } else { + startClientId = getLastMultiSelectedBlockClientId(state); + } + } // Validate working start client ID. + + + if (!startClientId) { + return null; + } // Retrieve start block root client ID, being careful to allow the falsey + // empty string top-level root by explicitly testing against null. + + + const rootClientId = getBlockRootClientId(state, startClientId); + + if (rootClientId === null) { + return null; + } + + const { + order + } = state.blocks; + const orderSet = order[rootClientId]; + const index = orderSet.indexOf(startClientId); + const nextIndex = index + 1 * modifier; // Block was first in set and we're attempting to get previous. + + if (nextIndex < 0) { + return null; + } // Block was last in set and we're attempting to get next. + + + if (nextIndex === orderSet.length) { + return null; + } // Assume incremented index is within the set. + + + return orderSet[nextIndex]; +} +/** + * Returns the previous block's client ID from the given reference start ID. + * Defaults start to the selected block. Returns null if there is no previous + * block. + * + * @param {Object} state Editor state. + * @param {?string} startClientId Optional client ID of block from which to + * search. + * + * @return {?string} Adjacent block's client ID, or null if none exists. + */ + +function getPreviousBlockClientId(state, startClientId) { + return getAdjacentBlockClientId(state, startClientId, -1); +} +/** + * Returns the next block's client ID from the given reference start ID. + * Defaults start to the selected block. Returns null if there is no next + * block. + * + * @param {Object} state Editor state. + * @param {?string} startClientId Optional client ID of block from which to + * search. + * + * @return {?string} Adjacent block's client ID, or null if none exists. + */ + +function getNextBlockClientId(state, startClientId) { + return getAdjacentBlockClientId(state, startClientId, 1); +} +/* eslint-disable jsdoc/valid-types */ + +/** + * Returns the initial caret position for the selected block. + * This position is to used to position the caret properly when the selected block changes. + * If the current block is not a RichText, having initial position set to 0 means "focus block" + * + * @param {Object} state Global application state. + * + * @return {0|-1|null} Initial position. + */ + +function getSelectedBlocksInitialCaretPosition(state) { + /* eslint-enable jsdoc/valid-types */ + return state.initialPosition; +} +/** + * Returns the current selection set of block client IDs (multiselection or single selection). + * + * @param {Object} state Editor state. + * + * @return {Array} Multi-selected block client IDs. + */ + +const getSelectedBlockClientIds = rememo(state => { + const { + selectionStart, + selectionEnd + } = state.selection; + + if (selectionStart.clientId === undefined || selectionEnd.clientId === undefined) { + return EMPTY_ARRAY; + } + + if (selectionStart.clientId === selectionEnd.clientId) { + return [selectionStart.clientId]; + } // Retrieve root client ID to aid in retrieving relevant nested block + // order, being careful to allow the falsey empty string top-level root + // by explicitly testing against null. + + + const rootClientId = getBlockRootClientId(state, selectionStart.clientId); + + if (rootClientId === null) { + return EMPTY_ARRAY; + } + + const blockOrder = getBlockOrder(state, rootClientId); + const startIndex = blockOrder.indexOf(selectionStart.clientId); + const endIndex = blockOrder.indexOf(selectionEnd.clientId); + + if (startIndex > endIndex) { + return blockOrder.slice(endIndex, startIndex + 1); + } + + return blockOrder.slice(startIndex, endIndex + 1); +}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]); +/** + * Returns the current multi-selection set of block client IDs, or an empty + * array if there is no multi-selection. + * + * @param {Object} state Editor state. + * + * @return {Array} Multi-selected block client IDs. + */ + +function getMultiSelectedBlockClientIds(state) { + const { + selectionStart, + selectionEnd + } = state.selection; + + if (selectionStart.clientId === selectionEnd.clientId) { + return EMPTY_ARRAY; + } + + return getSelectedBlockClientIds(state); +} +/** + * Returns the current multi-selection set of blocks, or an empty array if + * there is no multi-selection. + * + * @param {Object} state Editor state. + * + * @return {Array} Multi-selected block objects. + */ + +const getMultiSelectedBlocks = rememo(state => { + const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); + + if (!multiSelectedBlockClientIds.length) { + return EMPTY_ARRAY; + } + + return multiSelectedBlockClientIds.map(clientId => getBlock(state, clientId)); +}, state => [...getSelectedBlockClientIds.getDependants(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes]); +/** + * Returns the client ID of the first block in the multi-selection set, or null + * if there is no multi-selection. + * + * @param {Object} state Editor state. + * + * @return {?string} First block client ID in the multi-selection set. + */ + +function getFirstMultiSelectedBlockClientId(state) { + return (0,external_lodash_namespaceObject.first)(getMultiSelectedBlockClientIds(state)) || null; +} +/** + * Returns the client ID of the last block in the multi-selection set, or null + * if there is no multi-selection. + * + * @param {Object} state Editor state. + * + * @return {?string} Last block client ID in the multi-selection set. + */ + +function getLastMultiSelectedBlockClientId(state) { + return (0,external_lodash_namespaceObject.last)(getMultiSelectedBlockClientIds(state)) || null; +} +/** + * Returns true if a multi-selection exists, and the block corresponding to the + * specified client ID is the first block of the multi-selection set, or false + * otherwise. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {boolean} Whether block is first in multi-selection. + */ + +function isFirstMultiSelectedBlock(state, clientId) { + return getFirstMultiSelectedBlockClientId(state) === clientId; +} +/** + * Returns true if the client ID occurs within the block multi-selection, or + * false otherwise. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {boolean} Whether block is in multi-selection set. + */ + +function isBlockMultiSelected(state, clientId) { + return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1; +} +/** + * Returns true if an ancestor of the block is multi-selected, or false + * otherwise. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {boolean} Whether an ancestor of the block is in multi-selection + * set. + */ + +const isAncestorMultiSelected = rememo((state, clientId) => { + let ancestorClientId = clientId; + let isMultiSelected = false; + + while (ancestorClientId && !isMultiSelected) { + ancestorClientId = getBlockRootClientId(state, ancestorClientId); + isMultiSelected = isBlockMultiSelected(state, ancestorClientId); + } + + return isMultiSelected; +}, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]); +/** + * Returns the client ID of the block which begins the multi-selection set, or + * null if there is no multi-selection. + * + * This is not necessarily the first client ID in the selection. + * + * @see getFirstMultiSelectedBlockClientId + * + * @param {Object} state Editor state. + * + * @return {?string} Client ID of block beginning multi-selection. + */ + +function getMultiSelectedBlocksStartClientId(state) { + const { + selectionStart, + selectionEnd + } = state.selection; + + if (selectionStart.clientId === selectionEnd.clientId) { + return null; + } + + return selectionStart.clientId || null; +} +/** + * Returns the client ID of the block which ends the multi-selection set, or + * null if there is no multi-selection. + * + * This is not necessarily the last client ID in the selection. + * + * @see getLastMultiSelectedBlockClientId + * + * @param {Object} state Editor state. + * + * @return {?string} Client ID of block ending multi-selection. + */ + +function getMultiSelectedBlocksEndClientId(state) { + const { + selectionStart, + selectionEnd + } = state.selection; + + if (selectionStart.clientId === selectionEnd.clientId) { + return null; + } + + return selectionEnd.clientId || null; +} +/** + * Returns an array containing all block client IDs in the editor in the order + * they appear. Optionally accepts a root client ID of the block list for which + * the order should be returned, defaulting to the top-level block order. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {Array} Ordered client IDs of editor blocks. + */ + +function getBlockOrder(state, rootClientId) { + return state.blocks.order[rootClientId || ''] || EMPTY_ARRAY; +} +/** + * Returns the index at which the block corresponding to the specified client + * ID occurs within the block order, or `-1` if the block does not exist. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {number} Index at which block exists in order. + */ + +function getBlockIndex(state, clientId) { + const rootClientId = getBlockRootClientId(state, clientId); + return getBlockOrder(state, rootClientId).indexOf(clientId); +} +/** + * Returns true if the block corresponding to the specified client ID is + * currently selected and no multi-selection exists, or false otherwise. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {boolean} Whether block is selected and multi-selection exists. + */ + +function isBlockSelected(state, clientId) { + const { + selectionStart, + selectionEnd + } = state.selection; + + if (selectionStart.clientId !== selectionEnd.clientId) { + return false; + } + + return selectionStart.clientId === clientId; +} +/** + * Returns true if one of the block's inner blocks is selected. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * @param {boolean} deep Perform a deep check. + * + * @return {boolean} Whether the block as an inner block selected + */ + +function hasSelectedInnerBlock(state, clientId) { + let deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + return (0,external_lodash_namespaceObject.some)(getBlockOrder(state, clientId), innerClientId => isBlockSelected(state, innerClientId) || isBlockMultiSelected(state, innerClientId) || deep && hasSelectedInnerBlock(state, innerClientId, deep)); +} +/** + * Returns true if the block corresponding to the specified client ID is + * currently selected but isn't the last of the selected blocks. Here "last" + * refers to the block sequence in the document, _not_ the sequence of + * multi-selection, which is why `state.selectionEnd` isn't used. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {boolean} Whether block is selected and not the last in the + * selection. + */ + +function isBlockWithinSelection(state, clientId) { + if (!clientId) { + return false; + } + + const clientIds = getMultiSelectedBlockClientIds(state); + const index = clientIds.indexOf(clientId); + return index > -1 && index < clientIds.length - 1; +} +/** + * Returns true if a multi-selection has been made, or false otherwise. + * + * @param {Object} state Editor state. + * + * @return {boolean} Whether multi-selection has been made. + */ + +function hasMultiSelection(state) { + const { + selectionStart, + selectionEnd + } = state.selection; + return selectionStart.clientId !== selectionEnd.clientId; +} +/** + * Whether in the process of multi-selecting or not. This flag is only true + * while the multi-selection is being selected (by mouse move), and is false + * once the multi-selection has been settled. + * + * @see hasMultiSelection + * + * @param {Object} state Global application state. + * + * @return {boolean} True if multi-selecting, false if not. + */ + +function selectors_isMultiSelecting(state) { + return state.isMultiSelecting; +} +/** + * Selector that returns if multi-selection is enabled or not. + * + * @param {Object} state Global application state. + * + * @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled. + */ + +function selectors_isSelectionEnabled(state) { + return state.isSelectionEnabled; +} +/** + * Returns the block's editing mode, defaulting to "visual" if not explicitly + * assigned. + * + * @param {Object} state Editor state. + * @param {string} clientId Block client ID. + * + * @return {Object} Block editing mode. + */ + +function getBlockMode(state, clientId) { + return state.blocksMode[clientId] || 'visual'; +} +/** + * Returns true if the user is typing, or false otherwise. + * + * @param {Object} state Global application state. + * + * @return {boolean} Whether user is typing. + */ + +function selectors_isTyping(state) { + return state.isTyping; +} +/** + * Returns true if the user is dragging blocks, or false otherwise. + * + * @param {Object} state Global application state. + * + * @return {boolean} Whether user is dragging blocks. + */ + +function isDraggingBlocks(state) { + return !!state.draggedBlocks.length; +} +/** + * Returns the client ids of any blocks being directly dragged. + * + * This does not include children of a parent being dragged. + * + * @param {Object} state Global application state. + * + * @return {string[]} Array of dragged block client ids. + */ + +function getDraggedBlockClientIds(state) { + return state.draggedBlocks; +} +/** + * Returns whether the block is being dragged. + * + * Only returns true if the block is being directly dragged, + * not if the block is a child of a parent being dragged. + * See `isAncestorBeingDragged` for child blocks. + * + * @param {Object} state Global application state. + * @param {string} clientId Client id for block to check. + * + * @return {boolean} Whether the block is being dragged. + */ + +function isBlockBeingDragged(state, clientId) { + return state.draggedBlocks.includes(clientId); +} +/** + * Returns whether a parent/ancestor of the block is being dragged. + * + * @param {Object} state Global application state. + * @param {string} clientId Client id for block to check. + * + * @return {boolean} Whether the block's ancestor is being dragged. + */ + +function isAncestorBeingDragged(state, clientId) { + // Return early if no blocks are being dragged rather than + // the more expensive check for parents. + if (!isDraggingBlocks(state)) { + return false; + } + + const parents = getBlockParents(state, clientId); + return (0,external_lodash_namespaceObject.some)(parents, parentClientId => isBlockBeingDragged(state, parentClientId)); +} +/** + * Returns true if the caret is within formatted text, or false otherwise. + * + * @param {Object} state Global application state. + * + * @return {boolean} Whether the caret is within formatted text. + */ + +function selectors_isCaretWithinFormattedText(state) { + return state.isCaretWithinFormattedText; +} +/** + * Returns the insertion point, the index at which the new inserted block would + * be placed. Defaults to the last index. + * + * @param {Object} state Editor state. + * + * @return {Object} Insertion point object with `rootClientId`, `index`. + */ + +function getBlockInsertionPoint(state) { + let rootClientId, index; + const { + insertionPoint, + selection: { + selectionEnd + } + } = state; + + if (insertionPoint !== null) { + return insertionPoint; + } + + const { + clientId + } = selectionEnd; + + if (clientId) { + rootClientId = getBlockRootClientId(state, clientId) || undefined; + index = getBlockIndex(state, selectionEnd.clientId, rootClientId) + 1; + } else { + index = getBlockOrder(state).length; + } + + return { + rootClientId, + index + }; +} +/** + * Returns true if we should show the block insertion point. + * + * @param {Object} state Global application state. + * + * @return {?boolean} Whether the insertion point is visible or not. + */ + +function isBlockInsertionPointVisible(state) { + return state.insertionPoint !== null; +} +/** + * Returns whether the blocks matches the template or not. + * + * @param {boolean} state + * @return {?boolean} Whether the template is valid or not. + */ + +function isValidTemplate(state) { + return state.template.isValid; +} +/** + * Returns the defined block template + * + * @param {boolean} state + * + * @return {?Array} Block Template. + */ + +function getTemplate(state) { + return state.settings.template; +} +/** + * Returns the defined block template lock. Optionally accepts a root block + * client ID as context, otherwise defaulting to the global context. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional block root client ID. + * + * @return {?string} Block Template Lock + */ + +function getTemplateLock(state, rootClientId) { + if (!rootClientId) { + return state.settings.templateLock; + } + + const blockListSettings = getBlockListSettings(state, rootClientId); + + if (!blockListSettings) { + return null; + } + + return blockListSettings.templateLock; +} + +const checkAllowList = function (list, item) { + let defaultResult = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + + if ((0,external_lodash_namespaceObject.isBoolean)(list)) { + return list; + } + + if ((0,external_lodash_namespaceObject.isArray)(list)) { + // TODO: when there is a canonical way to detect that we are editing a post + // the following check should be changed to something like: + // if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null ) + if (list.includes('core/post-content') && item === null) { + return true; + } + + return list.includes(item); + } + + return defaultResult; +}; +/** + * Determines if the given block type is allowed to be inserted into the block list. + * This function is not exported and not memoized because using a memoized selector + * inside another memoized selector is just a waste of time. + * + * @param {Object} state Editor state. + * @param {string|Object} blockName The block type object, e.g., the response + * from the block directory; or a string name of + * an installed block type, e.g.' core/paragraph'. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given block type is allowed to be inserted. + */ + + +const canInsertBlockTypeUnmemoized = function (state, blockName) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + let blockType; + + if (blockName && 'object' === typeof blockName) { + blockType = blockName; + blockName = blockType.name; + } else { + blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); + } + + if (!blockType) { + return false; + } + + const { + allowedBlockTypes + } = getSettings(state); + const isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true); + + if (!isBlockAllowedInEditor) { + return false; + } + + const isLocked = !!getTemplateLock(state, rootClientId); + + if (isLocked) { + return false; + } + + const parentBlockListSettings = getBlockListSettings(state, rootClientId); // The parent block doesn't have settings indicating it doesn't support + // inner blocks, return false. + + if (rootClientId && parentBlockListSettings === undefined) { + return false; + } + + const parentAllowedBlocks = parentBlockListSettings === null || parentBlockListSettings === void 0 ? void 0 : parentBlockListSettings.allowedBlocks; + const hasParentAllowedBlock = checkAllowList(parentAllowedBlocks, blockName); + const blockAllowedParentBlocks = blockType.parent; + const parentName = getBlockName(state, rootClientId); + const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName); + const canInsert = hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true; + + if (!canInsert) { + return canInsert; + } + /** + * This filter is an ad-hoc solution to prevent adding template parts inside post content. + * Conceptually, having a filter inside a selector is bad pattern so this code will be + * replaced by a declarative API that doesn't the following drawbacks: + * + * Filters are not reactive: Upon switching between "template mode" and non "template mode", + * the filter and selector won't necessarily be executed again. For now, it doesn't matter much + * because you can't switch between the two modes while the inserter stays open. + * + * Filters are global: Once they're defined, they will affect all editor instances and all registries. + * An ideal API would only affect specific editor instances. + */ + + + return (0,external_wp_hooks_namespaceObject.applyFilters)('blockEditor.__unstableCanInsertBlockType', canInsert, blockType, rootClientId, { + // Pass bound selectors of the current registry. If we're in a nested + // context, the data will differ from the one selected from the root + // registry. + getBlock: getBlock.bind(null, state), + getBlockParentsByBlockName: getBlockParentsByBlockName.bind(null, state) + }); +}; +/** + * Determines if the given block type is allowed to be inserted into the block list. + * + * @param {Object} state Editor state. + * @param {string} blockName The name of the block type, e.g.' core/paragraph'. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given block type is allowed to be inserted. + */ + + +const canInsertBlockType = rememo(canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId[rootClientId], state.settings.allowedBlockTypes, state.settings.templateLock]); +/** + * Determines if the given blocks are allowed to be inserted into the block + * list. + * + * @param {Object} state Editor state. + * @param {string} clientIds The block client IDs to be inserted. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given blocks are allowed to be inserted. + */ + +function canInsertBlocks(state, clientIds) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + return clientIds.every(id => canInsertBlockType(state, getBlockName(state, id), rootClientId)); +} +/** + * Determines if the given block is allowed to be deleted. + * + * @param {Object} state Editor state. + * @param {string} clientId The block client Id. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given block is allowed to be removed. + */ + +function canRemoveBlock(state, clientId) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + const attributes = getBlockAttributes(state, clientId); // attributes can be null if the block is already deleted. + + if (attributes === null) { + return true; + } + + const { + lock + } = attributes; + const parentIsLocked = !!getTemplateLock(state, rootClientId); // If we don't have a lock on the blockType level, we differ to the parent templateLock. + + if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.remove) === undefined) { + return !parentIsLocked; + } // when remove is true, it means we cannot remove it. + + + return !(lock !== null && lock !== void 0 && lock.remove); +} +/** + * Determines if the given blocks are allowed to be removed. + * + * @param {Object} state Editor state. + * @param {string} clientIds The block client IDs to be removed. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given blocks are allowed to be removed. + */ + +function canRemoveBlocks(state, clientIds) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + return clientIds.every(clientId => canRemoveBlock(state, clientId, rootClientId)); +} +/** + * Determines if the given block is allowed to be moved. + * + * @param {Object} state Editor state. + * @param {string} clientId The block client Id. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given block is allowed to be moved. + */ + +function canMoveBlock(state, clientId) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + const attributes = getBlockAttributes(state, clientId); + + if (attributes === null) { + return; + } + + const { + lock + } = attributes; + const parentIsLocked = getTemplateLock(state, rootClientId) === 'all'; // If we don't have a lock on the blockType level, we differ to the parent templateLock. + + if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.move) === undefined) { + return !parentIsLocked; + } // when move is true, it means we cannot move it. + + + return !(lock !== null && lock !== void 0 && lock.move); +} +/** + * Determines if the given blocks are allowed to be moved. + * + * @param {Object} state Editor state. + * @param {string} clientIds The block client IDs to be moved. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given blocks are allowed to be moved. + */ + +function canMoveBlocks(state, clientIds) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId)); +} +/** + * Returns information about how recently and frequently a block has been inserted. + * + * @param {Object} state Global application state. + * @param {string} id A string which identifies the insert, e.g. 'core/block/12' + * + * @return {?{ time: number, count: number }} An object containing `time` which is when the last + * insert occurred as a UNIX epoch, and `count` which is + * the number of inserts that have occurred. + */ + +function getInsertUsage(state, id) { + var _state$preferences$in, _state$preferences$in2; + + return (_state$preferences$in = (_state$preferences$in2 = state.preferences.insertUsage) === null || _state$preferences$in2 === void 0 ? void 0 : _state$preferences$in2[id]) !== null && _state$preferences$in !== void 0 ? _state$preferences$in : null; +} +/** + * Returns whether we can show a block type in the inserter + * + * @param {Object} state Global State + * @param {Object} blockType BlockType + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Whether the given block type is allowed to be shown in the inserter. + */ + + +const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'inserter', true)) { + return false; + } + + return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId); +}; +/** + * Return a function to be used to tranform a block variation to an inserter item + * + * @param {Object} state Global State + * @param {Object} item Denormalized inserter item + * @return {Function} Function to transform a block variation to inserter item + */ + + +const getItemFromVariation = (state, item) => variation => { + const variationId = `${item.id}/${variation.name}`; + const { + time, + count = 0 + } = getInsertUsage(state, variationId) || {}; + return { ...item, + id: variationId, + icon: variation.icon || item.icon, + title: variation.title || item.title, + description: variation.description || item.description, + category: variation.category || item.category, + // If `example` is explicitly undefined for the variation, the preview will not be shown. + example: variation.hasOwnProperty('example') ? variation.example : item.example, + initialAttributes: { ...item.initialAttributes, + ...variation.attributes + }, + innerBlocks: variation.innerBlocks, + keywords: variation.keywords || item.keywords, + frecency: calculateFrecency(time, count) + }; +}; +/** + * Returns the calculated frecency. + * + * 'frecency' is a heuristic (https://en.wikipedia.org/wiki/Frecency) + * that combines block usage frequenty and recency. + * + * @param {number} time When the last insert occurred as a UNIX epoch + * @param {number} count The number of inserts that have occurred. + * + * @return {number} The calculated frecency. + */ + + +const calculateFrecency = (time, count) => { + if (!time) { + return count; + } // The selector is cached, which means Date.now() is the last time that the + // relevant state changed. This suits our needs. + + + const duration = Date.now() - time; + + switch (true) { + case duration < MILLISECONDS_PER_HOUR: + return count * 4; + + case duration < MILLISECONDS_PER_DAY: + return count * 2; + + case duration < MILLISECONDS_PER_WEEK: + return count / 2; + + default: + return count / 4; + } +}; +/** + * Returns a function that accepts a block type and builds an item to be shown + * in a specific context. It's used for building items for Inserter and available + * block Transfroms list. + * + * @param {Object} state Editor state. + * @param {Object} options Options object for handling the building of a block type. + * @param {string} options.buildScope The scope for which the item is going to be used. + * @return {Function} Function returns an item to be shown in a specific context (Inserter|Transforms list). + */ + + +const buildBlockTypeItem = (state, _ref3) => { + let { + buildScope = 'inserter' + } = _ref3; + return blockType => { + const id = blockType.name; + let isDisabled = false; + + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType.name, 'multiple', true)) { + isDisabled = (0,external_lodash_namespaceObject.some)(getBlocksByClientId(state, getClientIdsWithDescendants(state)), { + name: blockType.name + }); + } + + const { + time, + count = 0 + } = getInsertUsage(state, id) || {}; + const blockItemBase = { + id, + name: blockType.name, + title: blockType.title, + icon: blockType.icon, + isDisabled, + frecency: calculateFrecency(time, count) + }; + if (buildScope === 'transform') return blockItemBase; + const inserterVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(blockType.name, 'inserter'); + return { ...blockItemBase, + initialAttributes: {}, + description: blockType.description, + category: blockType.category, + keywords: blockType.keywords, + variations: inserterVariations, + example: blockType.example, + utility: 1 // deprecated + + }; + }; +}; +/** + * Determines the items that appear in the inserter. Includes both static + * items (e.g. a regular block type) and dynamic items (e.g. a reusable block). + * + * Each item object contains what's necessary to display a button in the + * inserter and handle its selection. + * + * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency) + * that combines block usage frequenty and recency. + * + * Items are returned ordered descendingly by their 'utility' and 'frecency'. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {WPEditorInserterItem[]} Items that appear in inserter. + * + * @typedef {Object} WPEditorInserterItem + * @property {string} id Unique identifier for the item. + * @property {string} name The type of block to create. + * @property {Object} initialAttributes Attributes to pass to the newly created block. + * @property {string} title Title of the item, as it appears in the inserter. + * @property {string} icon Dashicon for the item, as it appears in the inserter. + * @property {string} category Block category that the item is associated with. + * @property {string[]} keywords Keywords that can be searched to find this item. + * @property {boolean} isDisabled Whether or not the user should be prevented from inserting + * this item. + * @property {number} frecency Heuristic that combines frequency and recency. + */ + + +const getInserterItems = rememo(function (state) { + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const buildBlockTypeInserterItem = buildBlockTypeItem(state, { + buildScope: 'inserter' + }); + /* + * Matches block comment delimiters amid serialized content. + * + * @see `tokenizer` in `@wordpress/block-serialization-default-parser` + * package + * + * blockParserTokenizer differs from the original tokenizer in the + * following ways: + * + * - removed global flag (/g) + * - prepended ^\s* + * + */ + + const blockParserTokenizer = /^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/; + + const buildReusableBlockInserterItem = reusableBlock => { + let icon = library_symbol; + /* + * Instead of always displaying a generic "symbol" icon for every + * reusable block, try to use an icon that represents the first + * outermost block contained in the reusable block. This requires + * scanning the serialized form of the reusable block to find its + * first block delimiter, then looking up the corresponding block + * type, if available. + */ + + if (external_wp_element_namespaceObject.Platform.OS === 'web') { + const content = typeof reusableBlock.content.raw === 'string' ? reusableBlock.content.raw : reusableBlock.content; + const rawBlockMatch = content.match(blockParserTokenizer); + + if (rawBlockMatch) { + const [,, namespace = 'core/', blockName] = rawBlockMatch; + const referencedBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(namespace + blockName); + + if (referencedBlockType) { + icon = referencedBlockType.icon; + } + } + } + + const id = `core/block/${reusableBlock.id}`; + const { + time, + count = 0 + } = getInsertUsage(state, id) || {}; + const frecency = calculateFrecency(time, count); + return { + id, + name: 'core/block', + initialAttributes: { + ref: reusableBlock.id + }, + title: reusableBlock.title.raw, + icon, + category: 'reusable', + keywords: [], + isDisabled: false, + utility: 1, + // deprecated + frecency + }; + }; + + const blockTypeInserterItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)).map(buildBlockTypeInserterItem); + const reusableBlockInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? getReusableBlocks(state).map(buildReusableBlockInserterItem) : []; + const items = blockTypeInserterItems.reduce((accumulator, item) => { + const { + variations = [] + } = item; // Exclude any block type item that is to be replaced by a default variation + + if (!variations.some(_ref4 => { + let { + isDefault + } = _ref4; + return isDefault; + })) { + accumulator.push(item); + } + + if (variations.length) { + const variationMapper = getItemFromVariation(state, item); + accumulator.push(...variations.map(variationMapper)); + } + + return accumulator; + }, []); // Ensure core blocks are prioritized in the returned results, + // because third party blocks can be registered earlier than + // the core blocks (usually by using the `init` action), + // thus affecting the display order. + // We don't sort reusable blocks as they are handled differently. + + const groupByType = (blocks, block) => { + const { + core, + noncore + } = blocks; + const type = block.name.startsWith('core/') ? core : noncore; + type.push(block); + return blocks; + }; + + const { + core: coreItems, + noncore: nonCoreItems + } = items.reduce(groupByType, { + core: [], + noncore: [] + }); + const sortedBlockTypes = [...coreItems, ...nonCoreItems]; + return [...sortedBlockTypes, ...reusableBlockInserterItems]; +}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.blocks.order, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), (0,external_wp_blocks_namespaceObject.getBlockTypes)()]); +/** + * Determines the items that appear in the available block transforms list. + * + * Each item object contains what's necessary to display a menu item in the + * transform list and handle its selection. + * + * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency) + * that combines block usage frequenty and recency. + * + * Items are returned ordered descendingly by their 'frecency'. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {WPEditorTransformItem[]} Items that appear in inserter. + * + * @typedef {Object} WPEditorTransformItem + * @property {string} id Unique identifier for the item. + * @property {string} name The type of block to create. + * @property {string} title Title of the item, as it appears in the inserter. + * @property {string} icon Dashicon for the item, as it appears in the inserter. + * @property {boolean} isDisabled Whether or not the user should be prevented from inserting + * this item. + * @property {number} frecency Heuristic that combines frequency and recency. + */ + +const getBlockTransformItems = rememo(function (state, blocks) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + const buildBlockTypeTransformItem = buildBlockTypeItem(state, { + buildScope: 'transform' + }); + const blockTypeTransformItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)).map(buildBlockTypeTransformItem); + const itemsByName = (0,external_lodash_namespaceObject.mapKeys)(blockTypeTransformItems, _ref5 => { + let { + name + } = _ref5; + return name; + }); + const possibleTransforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)(blocks).reduce((accumulator, block) => { + if (itemsByName[block === null || block === void 0 ? void 0 : block.name]) { + accumulator.push(itemsByName[block.name]); + } + + return accumulator; + }, []); + const possibleBlockTransformations = (0,external_lodash_namespaceObject.orderBy)(possibleTransforms, block => itemsByName[block.name].frecency, 'desc'); + return possibleBlockTransformations; +}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, (0,external_wp_blocks_namespaceObject.getBlockTypes)()]); +/** + * Determines whether there are items to show in the inserter. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {boolean} Items that appear in inserter. + */ + +const hasInserterItems = rememo(function (state) { + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const hasBlockType = (0,external_lodash_namespaceObject.some)((0,external_wp_blocks_namespaceObject.getBlockTypes)(), blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)); + + if (hasBlockType) { + return true; + } + + const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && getReusableBlocks(state).length > 0; + return hasReusableBlock; +}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, getReusableBlocks(state), (0,external_wp_blocks_namespaceObject.getBlockTypes)()]); +/** + * Returns the list of allowed inserter blocks for inner blocks children + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {Array?} The list of allowed block types. + */ + +const __experimentalGetAllowedBlocks = rememo(function (state) { + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (!rootClientId) { + return; + } + + return (0,external_lodash_namespaceObject.filter)((0,external_wp_blocks_namespaceObject.getBlockTypes)(), blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)); +}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, (0,external_wp_blocks_namespaceObject.getBlockTypes)()]); +/** + * Returns the block to be directly inserted by the block appender. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {?Array} The block type to be directly inserted. + */ + +const __experimentalGetDirectInsertBlock = rememo(function (state) { + var _state$blockListSetti, _state$blockListSetti2; + + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (!rootClientId) { + return; + } + + const defaultBlock = (_state$blockListSetti = state.blockListSettings[rootClientId]) === null || _state$blockListSetti === void 0 ? void 0 : _state$blockListSetti.__experimentalDefaultBlock; + const directInsert = (_state$blockListSetti2 = state.blockListSettings[rootClientId]) === null || _state$blockListSetti2 === void 0 ? void 0 : _state$blockListSetti2.__experimentalDirectInsert; + + if (!defaultBlock || !directInsert) { + return; + } + + if (typeof directInsert === 'function') { + return directInsert(getBlock(state, rootClientId)) ? defaultBlock : null; + } + + return defaultBlock; +}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree[rootClientId]]); + +const checkAllowListRecursive = (blocks, allowedBlockTypes) => { + if ((0,external_lodash_namespaceObject.isBoolean)(allowedBlockTypes)) { + return allowedBlockTypes; + } + + const blocksQueue = [...blocks]; + + while (blocksQueue.length > 0) { + var _block$innerBlocks; + + const block = blocksQueue.shift(); + const isAllowed = checkAllowList(allowedBlockTypes, block.name || block.blockName, true); + + if (!isAllowed) { + return false; + } + + (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => { + blocksQueue.push(innerBlock); + }); + } + + return true; +}; + +const __experimentalGetParsedPattern = rememo((state, patternName) => { + const patterns = state.settings.__experimentalBlockPatterns; + const pattern = patterns.find(_ref6 => { + let { + name + } = _ref6; + return name === patternName; + }); + + if (!pattern) { + return null; + } + + return { ...pattern, + blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content) + }; +}, state => [state.settings.__experimentalBlockPatterns]); +const getAllAllowedPatterns = rememo(state => { + const patterns = state.settings.__experimentalBlockPatterns; + const { + allowedBlockTypes + } = getSettings(state); + const parsedPatterns = patterns.filter(_ref7 => { + let { + inserter = true + } = _ref7; + return !!inserter; + }).map(_ref8 => { + let { + name + } = _ref8; + return __experimentalGetParsedPattern(state, name); + }); + const allowedPatterns = parsedPatterns.filter(_ref9 => { + let { + blocks + } = _ref9; + return checkAllowListRecursive(blocks, allowedBlockTypes); + }); + return allowedPatterns; +}, state => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes]); +/** + * Returns the list of allowed patterns for inner blocks children. + * + * @param {Object} state Editor state. + * @param {?string} rootClientId Optional target root client ID. + * + * @return {Array?} The list of allowed patterns. + */ + +const __experimentalGetAllowedPatterns = rememo(function (state) { + let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const availableParsedPatterns = getAllAllowedPatterns(state); + const patternsAllowed = (0,external_lodash_namespaceObject.filter)(availableParsedPatterns, _ref10 => { + let { + blocks + } = _ref10; + return blocks.every(_ref11 => { + let { + name + } = _ref11; + return canInsertBlockType(state, name, rootClientId); + }); + }); + return patternsAllowed; +}, (state, rootClientId) => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes, state.settings.templateLock, state.blockListSettings[rootClientId], state.blocks.byClientId[rootClientId]]); +/** + * Returns the list of patterns based on their declared `blockTypes` + * and a block's name. + * Patterns can use `blockTypes` to integrate in work flows like + * suggesting appropriate patterns in a Placeholder state(during insertion) + * or blocks transformations. + * + * @param {Object} state Editor state. + * @param {string|string[]} blockNames Block's name or array of block names to find matching pattens. + * @param {?string} rootClientId Optional target root client ID. + * + * @return {Array} The list of matched block patterns based on declared `blockTypes` and block name. + */ + +const __experimentalGetPatternsByBlockTypes = rememo(function (state, blockNames) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + if (!blockNames) return EMPTY_ARRAY; + + const patterns = __experimentalGetAllowedPatterns(state, rootClientId); + + const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; + return patterns.filter(pattern => { + var _pattern$blockTypes, _pattern$blockTypes$s; + + return pattern === null || pattern === void 0 ? void 0 : (_pattern$blockTypes = pattern.blockTypes) === null || _pattern$blockTypes === void 0 ? void 0 : (_pattern$blockTypes$s = _pattern$blockTypes.some) === null || _pattern$blockTypes$s === void 0 ? void 0 : _pattern$blockTypes$s.call(_pattern$blockTypes, blockName => normalizedBlockNames.includes(blockName)); + }); +}, (state, rootClientId) => [...__experimentalGetAllowedPatterns.getDependants(state, rootClientId)]); +/** + * Determines the items that appear in the available pattern transforms list. + * + * For now we only handle blocks without InnerBlocks and take into account + * the `__experimentalRole` property of blocks' attributes for the transformation. + * + * We return the first set of possible eligible block patterns, + * by checking the `blockTypes` property. We still have to recurse through + * block pattern's blocks and try to find matches from the selected blocks. + * Now this happens in the consumer to avoid heavy operations in the selector. + * + * @param {Object} state Editor state. + * @param {Object[]} blocks The selected blocks. + * @param {?string} rootClientId Optional root client ID of block list. + * + * @return {WPBlockPattern[]} Items that are eligible for a pattern transformation. + */ + +const __experimentalGetPatternTransformItems = rememo(function (state, blocks) { + let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + if (!blocks) return EMPTY_ARRAY; + /** + * For now we only handle blocks without InnerBlocks and take into account + * the `__experimentalRole` property of blocks' attributes for the transformation. + * Note that the blocks have been retrieved through `getBlock`, which doesn't + * return the inner blocks of an inner block controller, so we still need + * to check for this case too. + */ + + if (blocks.some(_ref12 => { + let { + clientId, + innerBlocks + } = _ref12; + return innerBlocks.length || areInnerBlocksControlled(state, clientId); + })) { + return EMPTY_ARRAY; + } // Create a Set of the selected block names that is used in patterns filtering. + + + const selectedBlockNames = Array.from(new Set(blocks.map(_ref13 => { + let { + name + } = _ref13; + return name; + }))); + /** + * Here we will return first set of possible eligible block patterns, + * by checking the `blockTypes` property. We still have to recurse through + * block pattern's blocks and try to find matches from the selected blocks. + * Now this happens in the consumer to avoid heavy operations in the selector. + */ + + return __experimentalGetPatternsByBlockTypes(state, selectedBlockNames, rootClientId); +}, (state, rootClientId) => [...__experimentalGetPatternsByBlockTypes.getDependants(state, rootClientId)]); +/** + * Returns the Block List settings of a block, if any exist. + * + * @param {Object} state Editor state. + * @param {?string} clientId Block client ID. + * + * @return {?Object} Block settings of the block if set. + */ + +function getBlockListSettings(state, clientId) { + return state.blockListSettings[clientId]; +} +/** + * Returns the editor settings. + * + * @param {Object} state Editor state. + * + * @return {Object} The editor settings object. + */ + +function getSettings(state) { + return state.settings; +} +/** + * Returns true if the most recent block change is be considered persistent, or + * false otherwise. A persistent change is one committed by BlockEditorProvider + * via its `onChange` callback, in addition to `onInput`. + * + * @param {Object} state Block editor state. + * + * @return {boolean} Whether the most recent block change was persistent. + */ + +function isLastBlockChangePersistent(state) { + return state.blocks.isPersistentChange; +} +/** + * Returns the block list settings for an array of blocks, if any exist. + * + * @param {Object} state Editor state. + * @param {Array} clientIds Block client IDs. + * + * @return {Object} An object where the keys are client ids and the values are + * a block list setting object. + */ + +const __experimentalGetBlockListSettingsForBlocks = rememo(function (state) { + let clientIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + return clientIds.reduce((blockListSettingsForBlocks, clientId) => { + if (!state.blockListSettings[clientId]) { + return blockListSettingsForBlocks; + } + + return { ...blockListSettingsForBlocks, + [clientId]: state.blockListSettings[clientId] + }; + }, {}); +}, state => [state.blockListSettings]); +/** + * Returns the title of a given reusable block + * + * @param {Object} state Global application state. + * @param {number|string} ref The shared block's ID. + * + * @return {string} The reusable block saved title. + */ + +const __experimentalGetReusableBlockTitle = rememo((state, ref) => { + var _reusableBlock$title; + + const reusableBlock = (0,external_lodash_namespaceObject.find)(getReusableBlocks(state), block => block.id === ref); + + if (!reusableBlock) { + return null; + } + + return (_reusableBlock$title = reusableBlock.title) === null || _reusableBlock$title === void 0 ? void 0 : _reusableBlock$title.raw; +}, state => [getReusableBlocks(state)]); +/** + * Returns true if the most recent block change is be considered ignored, or + * false otherwise. An ignored change is one not to be committed by + * BlockEditorProvider, neither via `onChange` nor `onInput`. + * + * @param {Object} state Block editor state. + * + * @return {boolean} Whether the most recent block change was ignored. + */ + +function __unstableIsLastBlockChangeIgnored(state) { + // TODO: Removal Plan: Changes incurred by RECEIVE_BLOCKS should not be + // ignored if in-fact they result in a change in blocks state. The current + // need to ignore changes not a result of user interaction should be + // accounted for in the refactoring of reusable blocks as occurring within + // their own separate block editor / state (#7119). + return state.blocks.isIgnoredChange; +} +/** + * Returns the block attributes changed as a result of the last dispatched + * action. + * + * @param {Object} state Block editor state. + * + * @return {Object} Subsets of block attributes changed, keyed + * by block client ID. + */ + +function __experimentalGetLastBlockAttributeChanges(state) { + return state.lastBlockAttributesChange; +} +/** + * Returns the available reusable blocks + * + * @param {Object} state Global application state. + * + * @return {Array} Reusable blocks + */ + +function getReusableBlocks(state) { + var _state$settings$__exp, _state$settings; + + return (_state$settings$__exp = state === null || state === void 0 ? void 0 : (_state$settings = state.settings) === null || _state$settings === void 0 ? void 0 : _state$settings.__experimentalReusableBlocks) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : EMPTY_ARRAY; +} +/** + * Returns whether the navigation mode is enabled. + * + * @param {Object} state Editor state. + * + * @return {boolean} Is navigation mode enabled. + */ + + +function selectors_isNavigationMode(state) { + return state.isNavigationMode; +} +/** + * Returns whether block moving mode is enabled. + * + * @param {Object} state Editor state. + * + * @return {string} Client Id of moving block. + */ + +function selectors_hasBlockMovingClientId(state) { + return state.hasBlockMovingClientId; +} +/** + * Returns true if the last change was an automatic change, false otherwise. + * + * @param {Object} state Global application state. + * + * @return {boolean} Whether the last change was automatic. + */ + +function didAutomaticChange(state) { + return !!state.automaticChangeStatus; +} +/** + * Returns true if the current highlighted block matches the block clientId. + * + * @param {Object} state Global application state. + * @param {string} clientId The block to check. + * + * @return {boolean} Whether the block is currently highlighted. + */ + +function isBlockHighlighted(state, clientId) { + return state.highlightedBlock === clientId; +} +/** + * Checks if a given block has controlled inner blocks. + * + * @param {Object} state Global application state. + * @param {string} clientId The block to check. + * + * @return {boolean} True if the block has controlled inner blocks. + */ + +function areInnerBlocksControlled(state, clientId) { + return !!state.blocks.controlledInnerBlocks[clientId]; +} +/** + * Returns the clientId for the first 'active' block of a given array of block names. + * A block is 'active' if it (or a child) is the selected block. + * Returns the first match moving up the DOM from the selected block. + * + * @param {Object} state Global application state. + * @param {string[]} validBlocksNames The names of block types to check for. + * + * @return {string} The matching block's clientId. + */ + +const __experimentalGetActiveBlockIdByBlockNames = rememo((state, validBlockNames) => { + if (!validBlockNames.length) { + return null; + } // Check if selected block is a valid entity area. + + + const selectedBlockClientId = getSelectedBlockClientId(state); + + if (validBlockNames.includes(getBlockName(state, selectedBlockClientId))) { + return selectedBlockClientId; + } // Check if first selected block is a child of a valid entity area. + + + const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); + const entityAreaParents = getBlockParentsByBlockName(state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames); + + if (entityAreaParents) { + // Last parent closest/most interior. + return (0,external_lodash_namespaceObject.last)(entityAreaParents); + } + + return null; +}, (state, validBlockNames) => [state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId, validBlockNames]); +/** + * Tells if the block with the passed clientId was just inserted. + * + * @param {Object} state Global application state. + * @param {Object} clientId Client Id of the block. + * @param {?string} source Optional insertion source of the block. + * @return {boolean} True if the block matches the last block inserted from the specified source. + */ + +function wasBlockJustInserted(state, clientId, source) { + const { + lastBlockInserted + } = state; + return lastBlockInserted.clientId === clientId && lastBlockInserted.source === source; +} + +;// CONCATENATED MODULE: external ["wp","a11y"] +var external_wp_a11y_namespaceObject = window["wp"]["a11y"]; +;// CONCATENATED MODULE: external ["wp","richText"] +var external_wp_richText_namespaceObject = window["wp"]["richText"]; +;// CONCATENATED MODULE: external ["wp","deprecated"] +var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; +var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/actions.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Action which will insert a default block insert action if there + * are no other blocks at the root of the editor. This action should be used + * in actions which may result in no blocks remaining in the editor (removal, + * replacement, etc). + */ + +const ensureDefaultBlock = () => _ref => { + let { + select, + dispatch + } = _ref; + // To avoid a focus loss when removing the last block, assure there is + // always a default block if the last of the blocks have been removed. + const count = select.getBlockCount(); + + if (count > 0) { + return; + } // If there's an custom appender, don't insert default block. + // We have to remember to manually move the focus elsewhere to + // prevent it from being lost though. + + + const { + __unstableHasCustomAppender + } = select.getSettings(); + + if (__unstableHasCustomAppender) { + return; + } + + dispatch.insertDefaultBlock(); +}; +/** + * Action that resets blocks state to the specified array of blocks, taking precedence + * over any other content reflected as an edit in state. + * + * @param {Array} blocks Array of blocks. + */ + + +const resetBlocks = blocks => _ref2 => { + let { + dispatch + } = _ref2; + dispatch({ + type: 'RESET_BLOCKS', + blocks + }); + dispatch(validateBlocksToTemplate(blocks)); +}; +/** + * Block validity is a function of blocks state (at the point of a + * reset) and the template setting. As a compromise to its placement + * across distinct parts of state, it is implemented here as a side- + * effect of the block reset action. + * + * @param {Array} blocks Array of blocks. + */ + +const validateBlocksToTemplate = blocks => _ref3 => { + let { + select, + dispatch + } = _ref3; + const template = select.getTemplate(); + const templateLock = select.getTemplateLock(); // Unlocked templates are considered always valid because they act + // as default values only. + + const isBlocksValidToTemplate = !template || templateLock !== 'all' || (0,external_wp_blocks_namespaceObject.doBlocksMatchTemplate)(blocks, template); // Update if validity has changed. + + const isValidTemplate = select.isValidTemplate(); + + if (isBlocksValidToTemplate !== isValidTemplate) { + dispatch.setTemplateValidity(isBlocksValidToTemplate); + return isBlocksValidToTemplate; + } +}; +/** + * A block selection object. + * + * @typedef {Object} WPBlockSelection + * + * @property {string} clientId A block client ID. + * @property {string} attributeKey A block attribute key. + * @property {number} offset An attribute value offset, based on the rich + * text value. See `wp.richText.create`. + */ + +/* eslint-disable jsdoc/valid-types */ + +/** + * Returns an action object used in signalling that selection state should be + * reset to the specified selection. + * + * @param {WPBlockSelection} selectionStart The selection start. + * @param {WPBlockSelection} selectionEnd The selection end. + * @param {0|-1|null} initialPosition Initial block position. + * + * @return {Object} Action object. + */ + +function resetSelection(selectionStart, selectionEnd, initialPosition) { + /* eslint-enable jsdoc/valid-types */ + return { + type: 'RESET_SELECTION', + selectionStart, + selectionEnd, + initialPosition + }; +} +/** + * Returns an action object used in signalling that blocks have been received. + * Unlike resetBlocks, these should be appended to the existing known set, not + * replacing. + * + * @deprecated + * + * @param {Object[]} blocks Array of block objects. + * + * @return {Object} Action object. + */ + +function receiveBlocks(blocks) { + external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).receiveBlocks', { + since: '5.9', + alternative: 'resetBlocks or insertBlocks' + }); + return { + type: 'RECEIVE_BLOCKS', + blocks + }; +} +/** + * Action that updates attributes of multiple blocks with the specified client IDs. + * + * @param {string|string[]} clientIds Block client IDs. + * @param {Object} attributes Block attributes to be merged. Should be keyed by clientIds if + * uniqueByBlock is true. + * @param {boolean} uniqueByBlock true if each block in clientIds array has a unique set of attributes + * @return {Object} Action object. + */ + +function updateBlockAttributes(clientIds, attributes) { + let uniqueByBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + return { + type: 'UPDATE_BLOCK_ATTRIBUTES', + clientIds: (0,external_lodash_namespaceObject.castArray)(clientIds), + attributes, + uniqueByBlock + }; +} +/** + * Action that updates the block with the specified client ID. + * + * @param {string} clientId Block client ID. + * @param {Object} updates Block attributes to be merged. + * + * @return {Object} Action object. + */ + +function updateBlock(clientId, updates) { + return { + type: 'UPDATE_BLOCK', + clientId, + updates + }; +} +/* eslint-disable jsdoc/valid-types */ + +/** + * Returns an action object used in signalling that the block with the + * specified client ID has been selected, optionally accepting a position + * value reflecting its selection directionality. An initialPosition of -1 + * reflects a reverse selection. + * + * @param {string} clientId Block client ID. + * @param {0|-1|null} initialPosition Optional initial position. Pass as -1 to + * reflect reverse selection. + * + * @return {Object} Action object. + */ + +function selectBlock(clientId) { + let initialPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + /* eslint-enable jsdoc/valid-types */ + return { + type: 'SELECT_BLOCK', + initialPosition, + clientId + }; +} +/** + * Yields action objects used in signalling that the block preceding the given + * clientId should be selected. + * + * @param {string} clientId Block client ID. + */ + +const selectPreviousBlock = clientId => _ref4 => { + let { + select, + dispatch + } = _ref4; + const previousBlockClientId = select.getPreviousBlockClientId(clientId); + + if (previousBlockClientId) { + dispatch.selectBlock(previousBlockClientId, -1); + } +}; +/** + * Yields action objects used in signalling that the block following the given + * clientId should be selected. + * + * @param {string} clientId Block client ID. + */ + +const selectNextBlock = clientId => _ref5 => { + let { + select, + dispatch + } = _ref5; + const nextBlockClientId = select.getNextBlockClientId(clientId); + + if (nextBlockClientId) { + dispatch.selectBlock(nextBlockClientId); + } +}; +/** + * Action that starts block multi-selection. + * + * @return {Object} Action object. + */ + +function startMultiSelect() { + return { + type: 'START_MULTI_SELECT' + }; +} +/** + * Action that stops block multi-selection. + * + * @return {Object} Action object. + */ + +function stopMultiSelect() { + return { + type: 'STOP_MULTI_SELECT' + }; +} +/** + * Action that changes block multi-selection. + * + * @param {string} start First block of the multi selection. + * @param {string} end Last block of the multiselection. + */ + +const multiSelect = (start, end) => _ref6 => { + let { + select, + dispatch + } = _ref6; + const startBlockRootClientId = select.getBlockRootClientId(start); + const endBlockRootClientId = select.getBlockRootClientId(end); // Only allow block multi-selections at the same level. + + if (startBlockRootClientId !== endBlockRootClientId) { + return; + } + + dispatch({ + type: 'MULTI_SELECT', + start, + end + }); + const blockCount = select.getSelectedBlockCount(); + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: number of selected blocks */ + (0,external_wp_i18n_namespaceObject._n)('%s block selected.', '%s blocks selected.', blockCount), blockCount), 'assertive'); +}; +/** + * Action that clears the block selection. + * + * @return {Object} Action object. + */ + +function clearSelectedBlock() { + return { + type: 'CLEAR_SELECTED_BLOCK' + }; +} +/** + * Action that enables or disables block selection. + * + * @param {boolean} [isSelectionEnabled=true] Whether block selection should + * be enabled. + * + * @return {Object} Action object. + */ + +function toggleSelection() { + let isSelectionEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + return { + type: 'TOGGLE_SELECTION', + isSelectionEnabled + }; +} + +function getBlocksWithDefaultStylesApplied(blocks, blockEditorSettings) { + var _blockEditorSettings$, _blockEditorSettings$2; + + const preferredStyleVariations = (_blockEditorSettings$ = blockEditorSettings === null || blockEditorSettings === void 0 ? void 0 : (_blockEditorSettings$2 = blockEditorSettings.__experimentalPreferredStyleVariations) === null || _blockEditorSettings$2 === void 0 ? void 0 : _blockEditorSettings$2.value) !== null && _blockEditorSettings$ !== void 0 ? _blockEditorSettings$ : {}; + return blocks.map(block => { + var _block$attributes; + + const blockName = block.name; + + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'defaultStylePicker', true)) { + return block; + } + + if (!preferredStyleVariations[blockName]) { + return block; + } + + const className = (_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.className; + + if (className !== null && className !== void 0 && className.includes('is-style-')) { + return block; + } + + const { + attributes = {} + } = block; + const blockStyle = preferredStyleVariations[blockName]; + return { ...block, + attributes: { ...attributes, + className: `${className || ''} is-style-${blockStyle}`.trim() + } + }; + }); +} +/* eslint-disable jsdoc/valid-types */ + +/** + * Action that replaces given blocks with one or more replacement blocks. + * + * @param {(string|string[])} clientIds Block client ID(s) to replace. + * @param {(Object|Object[])} blocks Replacement block(s). + * @param {number} indexToSelect Index of replacement block to select. + * @param {0|-1|null} initialPosition Index of caret after in the selected block after the operation. + * @param {?Object} meta Optional Meta values to be passed to the action object. + * + * @return {Object} Action object. + */ + + +const replaceBlocks = function (clientIds, blocks, indexToSelect) { + let initialPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + let meta = arguments.length > 4 ? arguments[4] : undefined; + return _ref7 => { + let { + select, + dispatch + } = _ref7; + + /* eslint-enable jsdoc/valid-types */ + clientIds = (0,external_lodash_namespaceObject.castArray)(clientIds); + blocks = getBlocksWithDefaultStylesApplied((0,external_lodash_namespaceObject.castArray)(blocks), select.getSettings()); + const rootClientId = select.getBlockRootClientId((0,external_lodash_namespaceObject.first)(clientIds)); // Replace is valid if the new blocks can be inserted in the root block. + + for (let index = 0; index < blocks.length; index++) { + const block = blocks[index]; + const canInsertBlock = select.canInsertBlockType(block.name, rootClientId); + + if (!canInsertBlock) { + return; + } + } + + dispatch({ + type: 'REPLACE_BLOCKS', + clientIds, + blocks, + time: Date.now(), + indexToSelect, + initialPosition, + meta + }); + dispatch(ensureDefaultBlock()); + }; +}; +/** + * Action that replaces a single block with one or more replacement blocks. + * + * @param {(string|string[])} clientId Block client ID to replace. + * @param {(Object|Object[])} block Replacement block(s). + * + * @return {Object} Action object. + */ + +function replaceBlock(clientId, block) { + return replaceBlocks(clientId, block); +} +/** + * Higher-order action creator which, given the action type to dispatch creates + * an action creator for managing block movement. + * + * @param {string} type Action type to dispatch. + * + * @return {Function} Action creator. + */ + +const createOnMove = type => (clientIds, rootClientId) => _ref8 => { + let { + select, + dispatch + } = _ref8; + // If one of the blocks is locked or the parent is locked, we cannot move any block. + const canMoveBlocks = select.canMoveBlocks(clientIds, rootClientId); + + if (!canMoveBlocks) { + return; + } + + dispatch({ + type, + clientIds: (0,external_lodash_namespaceObject.castArray)(clientIds), + rootClientId + }); +}; + +const moveBlocksDown = createOnMove('MOVE_BLOCKS_DOWN'); +const moveBlocksUp = createOnMove('MOVE_BLOCKS_UP'); +/** + * Action that moves given blocks to a new position. + * + * @param {?string} clientIds The client IDs of the blocks. + * @param {?string} fromRootClientId Root client ID source. + * @param {?string} toRootClientId Root client ID destination. + * @param {number} index The index to move the blocks to. + */ + +const moveBlocksToPosition = function (clientIds) { + let fromRootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let toRootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + let index = arguments.length > 3 ? arguments[3] : undefined; + return _ref9 => { + let { + select, + dispatch + } = _ref9; + const canMoveBlocks = select.canMoveBlocks(clientIds, fromRootClientId); // If one of the blocks is locked or the parent is locked, we cannot move any block. + + if (!canMoveBlocks) { + return; + } // If moving inside the same root block the move is always possible. + + + if (fromRootClientId !== toRootClientId) { + const canRemoveBlocks = select.canRemoveBlocks(clientIds, fromRootClientId); // If we're moving to another block, it means we're deleting blocks from + // the original block, so we need to check if removing is possible. + + if (!canRemoveBlocks) { + return; + } + + const canInsertBlocks = select.canInsertBlocks(clientIds, toRootClientId); // If moving to other parent block, the move is possible if we can insert a block of the same type inside the new parent block. + + if (!canInsertBlocks) { + return; + } + } + + dispatch({ + type: 'MOVE_BLOCKS_TO_POSITION', + fromRootClientId, + toRootClientId, + clientIds, + index + }); + }; +}; +/** + * Action that moves given block to a new position. + * + * @param {?string} clientId The client ID of the block. + * @param {?string} fromRootClientId Root client ID source. + * @param {?string} toRootClientId Root client ID destination. + * @param {number} index The index to move the block to. + */ + +function moveBlockToPosition(clientId) { + let fromRootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let toRootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + let index = arguments.length > 3 ? arguments[3] : undefined; + return moveBlocksToPosition([clientId], fromRootClientId, toRootClientId, index); +} +/** + * Action that inserts a single block, optionally at a specific index respective a root block list. + * + * @param {Object} block Block object to insert. + * @param {?number} index Index at which block should be inserted. + * @param {?string} rootClientId Optional root client ID of block list on which to insert. + * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true. + * @param {?Object} meta Optional Meta values to be passed to the action object. + * + * @return {Object} Action object. + */ + +function insertBlock(block, index, rootClientId, updateSelection, meta) { + return insertBlocks([block], index, rootClientId, updateSelection, 0, meta); +} +/* eslint-disable jsdoc/valid-types */ + +/** + * Action that inserts an array of blocks, optionally at a specific index respective a root block list. + * + * @param {Object[]} blocks Block objects to insert. + * @param {?number} index Index at which block should be inserted. + * @param {?string} rootClientId Optional root client ID of block list on which to insert. + * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true. + * @param {0|-1|null} initialPosition Initial focus position. Setting it to null prevent focusing the inserted block. + * @param {?Object} meta Optional Meta values to be passed to the action object. + * @return {Object} Action object. + */ + +const insertBlocks = function (blocks, index, rootClientId) { + let updateSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + let initialPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; + let meta = arguments.length > 5 ? arguments[5] : undefined; + return _ref10 => { + let { + select, + dispatch + } = _ref10; + + /* eslint-enable jsdoc/valid-types */ + if ((0,external_lodash_namespaceObject.isObject)(initialPosition)) { + meta = initialPosition; + initialPosition = 0; + external_wp_deprecated_default()("meta argument in wp.data.dispatch('core/block-editor')", { + since: '10.1', + plugin: 'Gutenberg', + hint: 'The meta argument is now the 6th argument of the function' + }); + } + + blocks = getBlocksWithDefaultStylesApplied((0,external_lodash_namespaceObject.castArray)(blocks), select.getSettings()); + const allowedBlocks = []; + + for (const block of blocks) { + const isValid = select.canInsertBlockType(block.name, rootClientId); + + if (isValid) { + allowedBlocks.push(block); + } + } + + if (allowedBlocks.length) { + dispatch({ + type: 'INSERT_BLOCKS', + blocks: allowedBlocks, + index, + rootClientId, + time: Date.now(), + updateSelection, + initialPosition: updateSelection ? initialPosition : null, + meta + }); + } + }; +}; +/** + * Action that shows the insertion point. + * + * @param {?string} rootClientId Optional root client ID of block list on + * which to insert. + * @param {?number} index Index at which block should be inserted. + * @param {Object} __unstableOptions Wether or not to show an inserter button. + * + * @return {Object} Action object. + */ + +function showInsertionPoint(rootClientId, index) { + let __unstableOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + const { + __unstableWithInserter + } = __unstableOptions; + return { + type: 'SHOW_INSERTION_POINT', + rootClientId, + index, + __unstableWithInserter + }; +} +/** + * Action that hides the insertion point. + * + * @return {Object} Action object. + */ + +function hideInsertionPoint() { + return { + type: 'HIDE_INSERTION_POINT' + }; +} +/** + * Action that resets the template validity. + * + * @param {boolean} isValid template validity flag. + * + * @return {Object} Action object. + */ + +function setTemplateValidity(isValid) { + return { + type: 'SET_TEMPLATE_VALIDITY', + isValid + }; +} +/** + * Action that synchronizes the template with the list of blocks. + * + * @return {Object} Action object. + */ + +const synchronizeTemplate = () => _ref11 => { + let { + select, + dispatch + } = _ref11; + dispatch({ + type: 'SYNCHRONIZE_TEMPLATE' + }); + const blocks = select.getBlocks(); + const template = select.getTemplate(); + const updatedBlockList = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template); + dispatch.resetBlocks(updatedBlockList); +}; +/** + * Action that merges two blocks. + * + * @param {string} firstBlockClientId Client ID of the first block to merge. + * @param {string} secondBlockClientId Client ID of the second block to merge. + */ + +const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => { + let { + select, + dispatch + } = _ref12; + const blocks = [firstBlockClientId, secondBlockClientId]; + dispatch({ + type: 'MERGE_BLOCKS', + blocks + }); + const [clientIdA, clientIdB] = blocks; + const blockA = select.getBlock(clientIdA); + const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name); // Only focus the previous block if it's not mergeable + + if (blockAType && !blockAType.merge) { + dispatch.selectBlock(blockA.clientId); + return; + } + + const blockB = select.getBlock(clientIdB); + const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name); + const { + clientId, + attributeKey, + offset + } = select.getSelectionStart(); + const selectedBlockType = clientId === clientIdA ? blockAType : blockBType; + const attributeDefinition = selectedBlockType.attributes[attributeKey]; + const canRestoreTextSelection = (clientId === clientIdA || clientId === clientIdB) && attributeKey !== undefined && offset !== undefined && // We cannot restore text selection if the RichText identifier + // is not a defined block attribute key. This can be the case if the + // fallback intance ID is used to store selection (and no RichText + // identifier is set), or when the identifier is wrong. + !!attributeDefinition; + + if (!attributeDefinition) { + if (typeof attributeKey === 'number') { + window.console.error(`RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${typeof attributeKey}`); + } else { + window.console.error('The RichText identifier prop does not match any attributes defined by the block.'); + } + } // A robust way to retain selection position through various transforms + // is to insert a special character at the position and then recover it. + + + const START_OF_SELECTED_AREA = '\u0086'; // Clone the blocks so we don't insert the character in a "live" block. + + const cloneA = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockA); + const cloneB = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockB); + + if (canRestoreTextSelection) { + const selectedBlock = clientId === clientIdA ? cloneA : cloneB; + const html = selectedBlock.attributes[attributeKey]; + const { + multiline: multilineTag, + __unstableMultilineWrapperTags: multilineWrapperTags, + __unstablePreserveWhiteSpace: preserveWhiteSpace + } = attributeDefinition; + const value = (0,external_wp_richText_namespaceObject.insert)((0,external_wp_richText_namespaceObject.create)({ + html, + multilineTag, + multilineWrapperTags, + preserveWhiteSpace + }), START_OF_SELECTED_AREA, offset, offset); + selectedBlock.attributes[attributeKey] = (0,external_wp_richText_namespaceObject.toHTMLString)({ + value, + multilineTag, + preserveWhiteSpace + }); + } // We can only merge blocks with similar types + // thus, we transform the block to merge first + + + const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(cloneB, blockA.name); // If the block types can not match, do nothing + + if (!blocksWithTheSameType || !blocksWithTheSameType.length) { + return; + } // Calling the merge to update the attributes and remove the block to be merged + + + const updatedAttributes = blockAType.merge(cloneA.attributes, blocksWithTheSameType[0].attributes); + + if (canRestoreTextSelection) { + const newAttributeKey = (0,external_lodash_namespaceObject.findKey)(updatedAttributes, v => typeof v === 'string' && v.indexOf(START_OF_SELECTED_AREA) !== -1); + const convertedHtml = updatedAttributes[newAttributeKey]; + const { + multiline: multilineTag, + __unstableMultilineWrapperTags: multilineWrapperTags, + __unstablePreserveWhiteSpace: preserveWhiteSpace + } = blockAType.attributes[newAttributeKey]; + const convertedValue = (0,external_wp_richText_namespaceObject.create)({ + html: convertedHtml, + multilineTag, + multilineWrapperTags, + preserveWhiteSpace + }); + const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA); + const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1); + const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({ + value: newValue, + multilineTag, + preserveWhiteSpace + }); + updatedAttributes[newAttributeKey] = newHtml; + dispatch.selectionChange(blockA.clientId, newAttributeKey, newOffset, newOffset); + } + + dispatch.replaceBlocks([blockA.clientId, blockB.clientId], [{ ...blockA, + attributes: { ...blockA.attributes, + ...updatedAttributes + } + }, ...blocksWithTheSameType.slice(1)], 0 // If we don't pass the `indexToSelect` it will default to the last block. + ); +}; +/** + * Yields action objects used in signalling that the blocks corresponding to + * the set of specified client IDs are to be removed. + * + * @param {string|string[]} clientIds Client IDs of blocks to remove. + * @param {boolean} selectPrevious True if the previous block should be + * selected when a block is removed. + */ + +const removeBlocks = function (clientIds) { + let selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + return _ref13 => { + let { + select, + dispatch + } = _ref13; + + if (!clientIds || !clientIds.length) { + return; + } + + clientIds = (0,external_lodash_namespaceObject.castArray)(clientIds); + const rootClientId = select.getBlockRootClientId(clientIds[0]); + const canRemoveBlocks = select.canRemoveBlocks(clientIds, rootClientId); + + if (!canRemoveBlocks) { + return; + } + + if (selectPrevious) { + dispatch.selectPreviousBlock(clientIds[0]); + } + + dispatch({ + type: 'REMOVE_BLOCKS', + clientIds + }); // To avoid a focus loss when removing the last block, assure there is + // always a default block if the last of the blocks have been removed. + + dispatch(ensureDefaultBlock()); + }; +}; +/** + * Returns an action object used in signalling that the block with the + * specified client ID is to be removed. + * + * @param {string} clientId Client ID of block to remove. + * @param {boolean} selectPrevious True if the previous block should be + * selected when a block is removed. + * + * @return {Object} Action object. + */ + +function removeBlock(clientId, selectPrevious) { + return removeBlocks([clientId], selectPrevious); +} +/* eslint-disable jsdoc/valid-types */ + +/** + * Returns an action object used in signalling that the inner blocks with the + * specified client ID should be replaced. + * + * @param {string} rootClientId Client ID of the block whose InnerBlocks will re replaced. + * @param {Object[]} blocks Block objects to insert as new InnerBlocks + * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to false. + * @param {0|-1|null} initialPosition Initial block position. + * @return {Object} Action object. + */ + +function replaceInnerBlocks(rootClientId, blocks) { + let updateSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + let initialPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + /* eslint-enable jsdoc/valid-types */ + return { + type: 'REPLACE_INNER_BLOCKS', + rootClientId, + blocks, + updateSelection, + initialPosition: updateSelection ? initialPosition : null, + time: Date.now() + }; +} +/** + * Returns an action object used to toggle the block editing mode between + * visual and HTML modes. + * + * @param {string} clientId Block client ID. + * + * @return {Object} Action object. + */ + +function toggleBlockMode(clientId) { + return { + type: 'TOGGLE_BLOCK_MODE', + clientId + }; +} +/** + * Returns an action object used in signalling that the user has begun to type. + * + * @return {Object} Action object. + */ + +function startTyping() { + return { + type: 'START_TYPING' + }; +} +/** + * Returns an action object used in signalling that the user has stopped typing. + * + * @return {Object} Action object. + */ + +function stopTyping() { + return { + type: 'STOP_TYPING' + }; +} +/** + * Returns an action object used in signalling that the user has begun to drag blocks. + * + * @param {string[]} clientIds An array of client ids being dragged + * + * @return {Object} Action object. + */ + +function startDraggingBlocks() { + let clientIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return { + type: 'START_DRAGGING_BLOCKS', + clientIds + }; +} +/** + * Returns an action object used in signalling that the user has stopped dragging blocks. + * + * @return {Object} Action object. + */ + +function stopDraggingBlocks() { + return { + type: 'STOP_DRAGGING_BLOCKS' + }; +} +/** + * Returns an action object used in signalling that the caret has entered formatted text. + * + * @return {Object} Action object. + */ + +function enterFormattedText() { + return { + type: 'ENTER_FORMATTED_TEXT' + }; +} +/** + * Returns an action object used in signalling that the user caret has exited formatted text. + * + * @return {Object} Action object. + */ + +function exitFormattedText() { + return { + type: 'EXIT_FORMATTED_TEXT' + }; +} +/** + * Action that changes the position of the user caret. + * + * @param {string} clientId The selected block client ID. + * @param {string} attributeKey The selected block attribute key. + * @param {number} startOffset The start offset. + * @param {number} endOffset The end offset. + * + * @return {Object} Action object. + */ + +function selectionChange(clientId, attributeKey, startOffset, endOffset) { + return { + type: 'SELECTION_CHANGE', + clientId, + attributeKey, + startOffset, + endOffset + }; +} +/** + * Action that adds a new block of the default type to the block list. + * + * @param {?Object} attributes Optional attributes of the block to assign. + * @param {?string} rootClientId Optional root client ID of block list on which + * to append. + * @param {?number} index Optional index where to insert the default block + * + * @return {Object} Action object + */ + +function insertDefaultBlock(attributes, rootClientId, index) { + // Abort if there is no default block type (if it has been unregistered). + const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); + + if (!defaultBlockName) { + return; + } + + const block = (0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName, attributes); + return insertBlock(block, index, rootClientId); +} +/** + * Action that changes the nested settings of a given block. + * + * @param {string} clientId Client ID of the block whose nested setting are + * being received. + * @param {Object} settings Object with the new settings for the nested block. + * + * @return {Object} Action object + */ + +function updateBlockListSettings(clientId, settings) { + return { + type: 'UPDATE_BLOCK_LIST_SETTINGS', + clientId, + settings + }; +} +/** + * Action that updates the block editor settings. + * + * @param {Object} settings Updated settings + * + * @return {Object} Action object + */ + +function updateSettings(settings) { + return { + type: 'UPDATE_SETTINGS', + settings + }; +} +/** + * Action that signals that a temporary reusable block has been saved + * in order to switch its temporary id with the real id. + * + * @param {string} id Reusable block's id. + * @param {string} updatedId Updated block's id. + * + * @return {Object} Action object. + */ + +function __unstableSaveReusableBlock(id, updatedId) { + return { + type: 'SAVE_REUSABLE_BLOCK_SUCCESS', + id, + updatedId + }; +} +/** + * Action that marks the last block change explicitly as persistent. + * + * @return {Object} Action object. + */ + +function __unstableMarkLastChangeAsPersistent() { + return { + type: 'MARK_LAST_CHANGE_AS_PERSISTENT' + }; +} +/** + * Action that signals that the next block change should be marked explicitly as not persistent. + * + * @return {Object} Action object. + */ + +function __unstableMarkNextChangeAsNotPersistent() { + return { + type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT' + }; +} +/** + * Action that marks the last block change as an automatic change, meaning it was not + * performed by the user, and can be undone using the `Escape` and `Backspace` keys. + * This action must be called after the change was made, and any actions that are a + * consequence of it, so it is recommended to be called at the next idle period to ensure all + * selection changes have been recorded. + */ + +const __unstableMarkAutomaticChange = () => _ref14 => { + let { + dispatch + } = _ref14; + dispatch({ + type: 'MARK_AUTOMATIC_CHANGE' + }); + const { + requestIdleCallback = cb => setTimeout(cb, 100) + } = window; + requestIdleCallback(() => { + dispatch({ + type: 'MARK_AUTOMATIC_CHANGE_FINAL' + }); + }); +}; +/** + * Action that enables or disables the navigation mode. + * + * @param {string} isNavigationMode Enable/Disable navigation mode. + */ + +const setNavigationMode = function () { + let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + return _ref15 => { + let { + dispatch + } = _ref15; + dispatch({ + type: 'SET_NAVIGATION_MODE', + isNavigationMode + }); + + if (isNavigationMode) { + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.')); + } else { + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('You are currently in edit mode. To return to the navigation mode, press Escape.')); + } + }; +}; +/** + * Action that enables or disables the block moving mode. + * + * @param {string|null} hasBlockMovingClientId Enable/Disable block moving mode. + */ + +const setBlockMovingClientId = function () { + let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + return _ref16 => { + let { + dispatch + } = _ref16; + dispatch({ + type: 'SET_BLOCK_MOVING_MODE', + hasBlockMovingClientId + }); + + if (hasBlockMovingClientId) { + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block.')); + } + }; +}; +/** + * Action that duplicates a list of blocks. + * + * @param {string[]} clientIds + * @param {boolean} updateSelection + */ + +const duplicateBlocks = function (clientIds) { + let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + return _ref17 => { + let { + select, + dispatch + } = _ref17; + + if (!clientIds || !clientIds.length) { + return; + } // Return early if blocks don't exist. + + + const blocks = select.getBlocksByClientId(clientIds); + + if ((0,external_lodash_namespaceObject.some)(blocks, block => !block)) { + return; + } // Return early if blocks don't support multiple usage. + + + const blockNames = blocks.map(block => block.name); + + if (blockNames.some(blockName => !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'multiple', true))) { + return; + } + + const rootClientId = select.getBlockRootClientId(clientIds[0]); + const lastSelectedIndex = select.getBlockIndex((0,external_lodash_namespaceObject.last)((0,external_lodash_namespaceObject.castArray)(clientIds))); + const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.__experimentalCloneSanitizedBlock)(block)); + dispatch.insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection); + + if (clonedBlocks.length > 1 && updateSelection) { + dispatch.multiSelect((0,external_lodash_namespaceObject.first)(clonedBlocks).clientId, (0,external_lodash_namespaceObject.last)(clonedBlocks).clientId); + } + + return clonedBlocks.map(block => block.clientId); + }; +}; +/** + * Action that inserts an empty block before a given block. + * + * @param {string} clientId + */ + +const insertBeforeBlock = clientId => _ref18 => { + let { + select, + dispatch + } = _ref18; + + if (!clientId) { + return; + } + + const rootClientId = select.getBlockRootClientId(clientId); + const isLocked = select.getTemplateLock(rootClientId); + + if (isLocked) { + return; + } + + const firstSelectedIndex = select.getBlockIndex(clientId); + return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex); +}; +/** + * Action that inserts an empty block after a given block. + * + * @param {string} clientId + */ + +const insertAfterBlock = clientId => _ref19 => { + let { + select, + dispatch + } = _ref19; + + if (!clientId) { + return; + } + + const rootClientId = select.getBlockRootClientId(clientId); + const isLocked = select.getTemplateLock(rootClientId); + + if (isLocked) { + return; + } + + const firstSelectedIndex = select.getBlockIndex(clientId); + return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex + 1); +}; +/** + * Action that toggles the highlighted block state. + * + * @param {string} clientId The block's clientId. + * @param {boolean} isHighlighted The highlight state. + */ + +function toggleBlockHighlight(clientId, isHighlighted) { + return { + type: 'TOGGLE_BLOCK_HIGHLIGHT', + clientId, + isHighlighted + }; +} +/** + * Action that "flashes" the block with a given `clientId` by rhythmically highlighting it. + * + * @param {string} clientId Target block client ID. + */ + +const flashBlock = clientId => async _ref20 => { + let { + dispatch + } = _ref20; + dispatch(toggleBlockHighlight(clientId, true)); + await new Promise(resolve => setTimeout(resolve, 150)); + dispatch(toggleBlockHighlight(clientId, false)); +}; +/** + * Action that sets whether a block has controlled inner blocks. + * + * @param {string} clientId The block's clientId. + * @param {boolean} hasControlledInnerBlocks True if the block's inner blocks are controlled. + */ + +function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) { + return { + type: 'SET_HAS_CONTROLLED_INNER_BLOCKS', + hasControlledInnerBlocks, + clientId + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/constants.js +const STORE_NAME = 'core/block-editor'; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + + +/** + * Block editor data store configuration. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore + * + * @type {Object} + */ + +const storeConfig = { + reducer: reducer, + selectors: selectors_namespaceObject, + actions: actions_namespaceObject, + __experimentalUseThunks: true +}; +/** + * Store definition for the block editor namespace. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore + * + * @type {Object} + */ + +const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { ...storeConfig, + persist: ['preferences'] +}); // Ideally we'd use register instead of register stores. + +(0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, { ...storeConfig, + persist: ['preferences'] +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js +/** + * WordPress dependencies + */ + +const DEFAULT_BLOCK_EDIT_CONTEXT = { + name: '', + isSelected: false +}; +const Context = (0,external_wp_element_namespaceObject.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT); const { - Fill: __unstableInserterMenuExtension, - Slot -} = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('__unstableInserterMenuExtension'); -__unstableInserterMenuExtension.Slot = Slot; -/* harmony default export */ __webpack_exports__["a"] = (__unstableInserterMenuExtension); + Provider +} = Context; + +/** + * A hook that returns the block edit context. + * + * @return {Object} Block edit context + */ + +function useBlockEditContext() { + return (0,external_wp_element_namespaceObject.useContext)(Context); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-display-block-controls/index.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ -/***/ }), -/***/ "nEW0": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function useDisplayBlockControls() { + const { + isSelected, + clientId, + name + } = useBlockEditContext(); + return (0,external_wp_data_namespaceObject.useSelect)(select => { + if (isSelected) { + return true; + } -"use strict"; + const { + getBlockName, + isFirstMultiSelectedBlock, + getMultiSelectedBlockClientIds + } = select(store); -// EXPORTS -__webpack_require__.d(__webpack_exports__, "w", function() { return /* reexport */ raf; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ FluidValue; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ react_spring_shared_esm_globals; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ addFluidObserver; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ callFluidObservers; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ colors; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ createInterpolator; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* binding */ createStringInterpolator; }); -__webpack_require__.d(__webpack_exports__, "h", function() { return /* binding */ defineHidden; }); -__webpack_require__.d(__webpack_exports__, "i", function() { return /* binding */ deprecateDirectCall; }); -__webpack_require__.d(__webpack_exports__, "j", function() { return /* binding */ deprecateInterpolate; }); -__webpack_require__.d(__webpack_exports__, "k", function() { return /* binding */ each; }); -__webpack_require__.d(__webpack_exports__, "l", function() { return /* binding */ eachProp; }); -__webpack_require__.d(__webpack_exports__, "m", function() { return /* binding */ flush; }); -__webpack_require__.d(__webpack_exports__, "n", function() { return /* binding */ flushCalls; }); -__webpack_require__.d(__webpack_exports__, "o", function() { return /* binding */ frameLoop; }); -__webpack_require__.d(__webpack_exports__, "p", function() { return /* binding */ getFluidObservers; }); -__webpack_require__.d(__webpack_exports__, "q", function() { return /* binding */ getFluidValue; }); -__webpack_require__.d(__webpack_exports__, "r", function() { return /* binding */ hasFluidValue; }); -__webpack_require__.d(__webpack_exports__, "s", function() { return /* binding */ is; }); -__webpack_require__.d(__webpack_exports__, "t", function() { return /* binding */ isAnimatedString; }); -__webpack_require__.d(__webpack_exports__, "u", function() { return /* binding */ isEqual; }); -__webpack_require__.d(__webpack_exports__, "v", function() { return /* binding */ noop; }); -__webpack_require__.d(__webpack_exports__, "x", function() { return /* binding */ removeFluidObserver; }); -__webpack_require__.d(__webpack_exports__, "y", function() { return /* binding */ toArray; }); -__webpack_require__.d(__webpack_exports__, "z", function() { return /* binding */ useForceUpdate; }); -__webpack_require__.d(__webpack_exports__, "A", function() { return /* binding */ useLayoutEffect; }); -__webpack_require__.d(__webpack_exports__, "B", function() { return /* binding */ useMemoOne; }); -__webpack_require__.d(__webpack_exports__, "C", function() { return /* binding */ useOnce; }); -__webpack_require__.d(__webpack_exports__, "D", function() { return /* binding */ usePrev; }); + if (isFirstMultiSelectedBlock(clientId)) { + return getMultiSelectedBlockClientIds().every(id => getBlockName(id) === name); + } -// UNUSED EXPORTS: callFluidObserver, colorToRgba, hex3, hex4, hex6, hex8, hsl, hsla, isSSR, rgb, rgba, setFluidGetter + return false; + }, [clientId, isSelected, name]); +} -// CONCATENATED MODULE: ./node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/hook.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +function useBlockControlsFill(group, shareWithChildBlocks) { + const isDisplayed = useDisplayBlockControls(); + const { + clientId + } = useBlockEditContext(); + const isParentDisplayed = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockName, + hasSelectedInnerBlock + } = select(store); + const { + hasBlockSupport + } = select(external_wp_blocks_namespaceObject.store); + return shareWithChildBlocks && hasBlockSupport(getBlockName(clientId), '__experimentalExposeControlsToChildren', false) && hasSelectedInnerBlock(clientId); + }, [shareWithChildBlocks, clientId]); + + if (isDisplayed) { + var _groups$group; + + return (_groups$group = block_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Fill; + } + + if (isParentDisplayed) { + return block_controls_groups.parent.Fill; + } + + return null; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/fill.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function BlockControlsFill(_ref) { + let { + group = 'default', + controls, + children, + __experimentalShareWithChildBlocks = false + } = _ref; + const Fill = useBlockControlsFill(group, __experimentalShareWithChildBlocks); + + if (!Fill) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, { + document: document + }, (0,external_wp_element_namespaceObject.createElement)(Fill, null, fillProps => { + // Children passed to BlockControlsFill will not have access to any + // React Context whose Provider is part of the BlockControlsSlot tree. + // So we re-create the Provider in this subtree. + const value = !(0,external_lodash_namespaceObject.isEmpty)(fillProps) ? fillProps : null; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolbarContext.Provider, { + value: value + }, group === 'default' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, { + controls: controls + }), children); + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/slot.js + + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function BlockControlsSlot(_ref) { + let { + group = 'default', + ...props + } = _ref; + const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolbarContext); + const Slot = block_controls_groups[group].Slot; + const slot = (0,external_wp_components_namespaceObject.__experimentalUseSlot)(Slot.__unstableName); + const hasFills = Boolean(slot.fills && slot.fills.length); + + if (!hasFills) { + return null; + } + + if (group === 'default') { + return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, { + bubblesVirtually: true, + fillProps: accessibleToolbarState + })); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, { + bubblesVirtually: true, + fillProps: accessibleToolbarState + }))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js + + + +/** + * Internal dependencies + */ + + +const BlockControls = BlockControlsFill; +BlockControls.Slot = BlockControlsSlot; // This is just here for backward compatibility + +const BlockFormatControls = props => { + return (0,external_wp_element_namespaceObject.createElement)(BlockControlsFill, _extends({ + group: "inline" + }, props)); +}; + +BlockFormatControls.Slot = props => { + return (0,external_wp_element_namespaceObject.createElement)(BlockControlsSlot, _extends({ + group: "inline" + }, props)); +}; + +/* harmony default export */ var block_controls = (BlockControls); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-none.js + + +/** + * WordPress dependencies + */ + +const alignNone = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z" +})); +/* harmony default export */ var align_none = (alignNone); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-left.js + + +/** + * WordPress dependencies + */ + +const positionLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z" +})); +/* harmony default export */ var position_left = (positionLeft); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-center.js + + +/** + * WordPress dependencies + */ + +const positionCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z" +})); +/* harmony default export */ var position_center = (positionCenter); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-right.js + + +/** + * WordPress dependencies + */ + +const positionRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z" +})); +/* harmony default export */ var position_right = (positionRight); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js + + +/** + * WordPress dependencies + */ + +const stretchWide = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z" +})); +/* harmony default export */ var stretch_wide = (stretchWide); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-full-width.js + + +/** + * WordPress dependencies + */ + +const stretchFullWidth = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z" +})); +/* harmony default export */ var stretch_full_width = (stretchFullWidth); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-left.js + + +/** + * WordPress dependencies + */ + +const justifyLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M9 9v6h11V9H9zM4 20h1.5V4H4v16z" +})); +/* harmony default export */ var justify_left = (justifyLeft); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-center.js + + +/** + * WordPress dependencies + */ + +const justifyCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z" +})); +/* harmony default export */ var justify_center = (justifyCenter); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-right.js + + +/** + * WordPress dependencies + */ + +const justifyRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z" +})); +/* harmony default export */ var justify_right = (justifyRight); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-space-between.js + + +/** + * WordPress dependencies + */ + +const justifySpaceBetween = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z" +})); +/* harmony default export */ var justify_space_between = (justifySpaceBetween); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-right.js + + +/** + * WordPress dependencies + */ + +const arrowRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z" +})); +/* harmony default export */ var arrow_right = (arrowRight); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-down.js + + +/** + * WordPress dependencies + */ + +const arrowDown = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z" +})); +/* harmony default export */ var arrow_down = (arrowDown); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/utils.js +/** + * Utility to generate the proper CSS selector for layout styles. + * + * @param {string|string[]} selectors - CSS selectors + * @param {boolean} append - string to append. + * + * @return {string} - CSS selector. + */ +function appendSelectors(selectors) { + let append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + // Ideally we shouldn't need the `.editor-styles-wrapper` increased specificity here + // The problem though is that we have a `.editor-styles-wrapper p { margin: reset; }` style + // it's used to reset the default margin added by wp-admin to paragraphs + // so we need this to be higher speficity otherwise, it won't be applied to paragraphs inside containers + // When the post editor is fully iframed, this extra classname could be removed. + return selectors.split(',').map(subselector => `.editor-styles-wrapper ${subselector} ${append}`).join(','); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const blockedPaths = ['color', 'border', 'typography', 'spacing']; +const deprecatedFlags = { + 'color.palette': settings => settings.colors === undefined ? undefined : settings.colors, + 'color.gradients': settings => settings.gradients === undefined ? undefined : settings.gradients, + 'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors, + 'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients, + 'typography.fontSizes': settings => settings.fontSizes === undefined ? undefined : settings.fontSizes, + 'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes, + 'typography.lineHeight': settings => settings.enableCustomLineHeight, + 'spacing.units': settings => { + if (settings.enableCustomUnits === undefined) { + return; + } + + if (settings.enableCustomUnits === true) { + return ['px', 'em', 'rem', 'vh', 'vw', '%']; + } + + return settings.enableCustomUnits; + }, + 'spacing.padding': settings => settings.enableCustomSpacing +}; +const prefixedFlags = { + /* + * These were only available in the plugin + * and can be removed when the minimum WordPress version + * for the plugin is 5.9. + */ + 'border.customColor': 'border.color', + 'border.customStyle': 'border.style', + 'border.customWidth': 'border.width', + 'typography.customFontStyle': 'typography.fontStyle', + 'typography.customFontWeight': 'typography.fontWeight', + 'typography.customLetterSpacing': 'typography.letterSpacing', + 'typography.customTextDecorations': 'typography.textDecoration', + 'typography.customTextTransforms': 'typography.textTransform', + + /* + * These were part of WordPress 5.8 and we need to keep them. + */ + 'border.customRadius': 'border.radius', + 'spacing.customMargin': 'spacing.margin', + 'spacing.customPadding': 'spacing.padding', + 'typography.customLineHeight': 'typography.lineHeight' +}; +/** + * Remove `custom` prefixes for flags that did not land in 5.8. + * + * This provides continued support for `custom` prefixed properties. It will + * be removed once third party devs have had sufficient time to update themes, + * plugins, etc. + * + * @see https://github.com/WordPress/gutenberg/pull/34485 + * + * @param {string} path Path to desired value in settings. + * @return {string} The value for defined setting. + */ + +const removeCustomPrefixes = path => { + return prefixedFlags[path] || path; +}; +/** + * Hook that retrieves the editor setting. + * It works with nested objects using by finding the value at path. + * + * @param {string} path The path to the setting. + * @return {any} Returns the value defined for the setting. + * @example + * ```js + * const isEnabled = useSetting( 'typography.dropCap' ); + * ``` + */ + + +function useSetting(path) { + const { + name: blockName + } = useBlockEditContext(); + const setting = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _get; + + if (blockedPaths.includes(path)) { + // eslint-disable-next-line no-console + console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.'); + return undefined; + } + + const settings = select(store).getSettings(); // 1 - Use __experimental features, if available. + // We cascade to the all value if the block one is not available. + + const normalizedPath = removeCustomPrefixes(path); + const defaultsPath = `__experimentalFeatures.${normalizedPath}`; + const blockPath = `__experimentalFeatures.blocks.${blockName}.${normalizedPath}`; + const experimentalFeaturesResult = (_get = (0,external_lodash_namespaceObject.get)(settings, blockPath)) !== null && _get !== void 0 ? _get : (0,external_lodash_namespaceObject.get)(settings, defaultsPath); + + if (experimentalFeaturesResult !== undefined) { + if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_MERGE[normalizedPath]) { + var _ref, _experimentalFeatures; + + return (_ref = (_experimentalFeatures = experimentalFeaturesResult.custom) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.default; + } + + return experimentalFeaturesResult; + } // 2 - Use deprecated settings, otherwise. + + + const deprecatedSettingsValue = deprecatedFlags[normalizedPath] ? deprecatedFlags[normalizedPath](settings) : undefined; + + if (deprecatedSettingsValue !== undefined) { + return deprecatedSettingsValue; + } // 3 - Fall back for typography.dropCap: + // This is only necessary to support typography.dropCap. + // when __experimentalFeatures are not present (core without plugin). + // To remove when __experimentalFeatures are ported to core. + + + return normalizedPath === 'typography.dropCap' ? true : undefined; + }, [blockName, path]); + return setting; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/ui.js + + + +/** + * WordPress dependencies + */ + + + +const icons = { + left: justify_left, + center: justify_center, + right: justify_right, + 'space-between': justify_space_between +}; + +function JustifyContentUI(_ref) { + let { + allowedControls = ['left', 'center', 'right', 'space-between'], + isCollapsed = true, + onChange, + value, + popoverProps, + isToolbar + } = _ref; + + // If the control is already selected we want a click + // again on the control to deselect the item, so we + // call onChange( undefined ) + const handleClick = next => { + if (next === value) { + onChange(undefined); + } else { + onChange(next); + } + }; + + const icon = value ? icons[value] : icons.left; + const allControls = [{ + name: 'left', + icon: justify_left, + title: (0,external_wp_i18n_namespaceObject.__)('Justify items left'), + isActive: 'left' === value, + onClick: () => handleClick('left') + }, { + name: 'center', + icon: justify_center, + title: (0,external_wp_i18n_namespaceObject.__)('Justify items center'), + isActive: 'center' === value, + onClick: () => handleClick('center') + }, { + name: 'right', + icon: justify_right, + title: (0,external_wp_i18n_namespaceObject.__)('Justify items right'), + isActive: 'right' === value, + onClick: () => handleClick('right') + }, { + name: 'space-between', + icon: justify_space_between, + title: (0,external_wp_i18n_namespaceObject.__)('Space between items'), + isActive: 'space-between' === value, + onClick: () => handleClick('space-between') + }]; + const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; + const extraProps = isToolbar ? { + isCollapsed + } : {}; + return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({ + icon: icon, + popoverProps: popoverProps, + label: (0,external_wp_i18n_namespaceObject.__)('Change items justification'), + controls: allControls.filter(elem => allowedControls.includes(elem.name)) + }, extraProps)); +} + +/* harmony default export */ var ui = (JustifyContentUI); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/index.js + + + +/** + * Internal dependencies + */ + +function JustifyContentControl(props) { + return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, { + isToolbar: false + })); +} +function JustifyToolbar(props) { + return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, { + isToolbar: true + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/flex.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + // Used with the default, horizontal flex orientation. + +const justifyContentMap = { + left: 'flex-start', + right: 'flex-end', + center: 'center', + 'space-between': 'space-between' +}; // Used with the vertical (column) flex orientation. + +const alignItemsMap = { + left: 'flex-start', + right: 'flex-end', + center: 'center' +}; +const flexWrapOptions = ['wrap', 'nowrap']; +/* harmony default export */ var flex = ({ + name: 'flex', + label: (0,external_wp_i18n_namespaceObject.__)('Flex'), + inspectorControls: function FlexLayoutInspectorControls(_ref) { + let { + layout = {}, + onChange + } = _ref; + const { + allowOrientation = true + } = layout; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(FlexLayoutJustifyContentControl, { + layout: layout, + onChange: onChange + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, allowOrientation && (0,external_wp_element_namespaceObject.createElement)(OrientationControl, { + layout: layout, + onChange: onChange + }))), (0,external_wp_element_namespaceObject.createElement)(FlexWrapControl, { + layout: layout, + onChange: onChange + })); + }, + toolBarControls: function FlexLayoutToolbarControls(_ref2) { + let { + layout = {}, + onChange, + layoutBlockSupport + } = _ref2; + + if (layoutBlockSupport !== null && layoutBlockSupport !== void 0 && layoutBlockSupport.allowSwitching) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(block_controls, { + group: "block", + __experimentalShareWithChildBlocks: true + }, (0,external_wp_element_namespaceObject.createElement)(FlexLayoutJustifyContentControl, { + layout: layout, + onChange: onChange, + isToolbar: true + })); + }, + save: function FlexLayoutStyle(_ref3) { + var _style$spacing$blockG, _style$spacing; + + let { + selector, + layout, + style + } = _ref3; + const { + orientation = 'horizontal' + } = layout; + const blockGapSupport = useSetting('spacing.blockGap'); + const hasBlockGapStylesSupport = blockGapSupport !== null; + const blockGapValue = (_style$spacing$blockG = style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) !== null && _style$spacing$blockG !== void 0 ? _style$spacing$blockG : 'var( --wp--style--block-gap, 0.5em )'; + const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left; + const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap'; + const rowOrientation = ` + flex-direction: row; + align-items: center; + justify-content: ${justifyContent}; + `; + const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left; + const columnOrientation = ` + flex-direction: column; + align-items: ${alignItems}; + `; + return (0,external_wp_element_namespaceObject.createElement)("style", null, ` + ${appendSelectors(selector)} { + display: flex; + gap: ${hasBlockGapStylesSupport ? blockGapValue : '0.5em'}; + flex-wrap: ${flexWrap}; + ${orientation === 'horizontal' ? rowOrientation : columnOrientation} + } + + ${appendSelectors(selector, '> *')} { + margin: 0; + } + `); + }, + + getOrientation(layout) { + const { + orientation = 'horizontal' + } = layout; + return orientation; + }, + + getAlignments() { + return []; + } + +}); + +function FlexLayoutJustifyContentControl(_ref4) { + let { + layout, + onChange, + isToolbar = false + } = _ref4; + const { + justifyContent = 'left', + orientation = 'horizontal' + } = layout; + + const onJustificationChange = value => { + onChange({ ...layout, + justifyContent: value + }); + }; + + const allowedControls = ['left', 'center', 'right']; + + if (orientation === 'horizontal') { + allowedControls.push('space-between'); + } + + if (isToolbar) { + return (0,external_wp_element_namespaceObject.createElement)(JustifyContentControl, { + allowedControls: allowedControls, + value: justifyContent, + onChange: onJustificationChange, + popoverProps: { + position: 'bottom right', + isAlternate: true + } + }); + } + + const justificationOptions = [{ + value: 'left', + icon: justify_left, + label: (0,external_wp_i18n_namespaceObject.__)('Justify items left') + }, { + value: 'center', + icon: justify_center, + label: (0,external_wp_i18n_namespaceObject.__)('Justify items center') + }, { + value: 'right', + icon: justify_right, + label: (0,external_wp_i18n_namespaceObject.__)('Justify items right') + }]; + + if (orientation === 'horizontal') { + justificationOptions.push({ + value: 'space-between', + icon: justify_space_between, + label: (0,external_wp_i18n_namespaceObject.__)('Space between items') + }); + } + + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "block-editor-hooks__flex-layout-justification-controls" + }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Justification')), (0,external_wp_element_namespaceObject.createElement)("div", null, justificationOptions.map(_ref5 => { + let { + value, + icon, + label + } = _ref5; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: value, + label: label, + icon: icon, + isPressed: justifyContent === value, + onClick: () => onJustificationChange(value) + }); + }))); +} + +function FlexWrapControl(_ref6) { + let { + layout, + onChange + } = _ref6; + const { + flexWrap = 'wrap' + } = layout; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Allow to wrap to multiple lines'), + onChange: value => { + onChange({ ...layout, + flexWrap: value ? 'wrap' : 'nowrap' + }); + }, + checked: flexWrap === 'wrap' + }); +} + +function OrientationControl(_ref7) { + let { + layout, + onChange + } = _ref7; + const { + orientation = 'horizontal' + } = layout; + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "block-editor-hooks__flex-layout-orientation-controls" + }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Orientation')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + label: 'horizontal', + icon: arrow_right, + isPressed: orientation === 'horizontal', + onClick: () => onChange({ ...layout, + orientation: 'horizontal' + }) + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + label: 'vertical', + icon: arrow_down, + isPressed: orientation === 'vertical', + onClick: () => onChange({ ...layout, + orientation: 'vertical' + }) + })); +} + +;// CONCATENATED MODULE: ./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 + * + * @return {JSX.Element} Icon component + */ + +function Icon(_ref) { + let { + icon, + size = 24, + ...props + } = _ref; + return (0,external_wp_element_namespaceObject.cloneElement)(icon, { + width: size, + height: size, + ...props + }); +} + +/* harmony default export */ var build_module_icon = (Icon); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/flow.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +/* harmony default export */ var flow = ({ + name: 'default', + label: (0,external_wp_i18n_namespaceObject.__)('Flow'), + inspectorControls: function DefaultLayoutInspectorControls(_ref) { + let { + layout, + onChange + } = _ref; + const { + wideSize, + contentSize + } = layout; + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-hooks__layout-controls" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-hooks__layout-controls-unit" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Content'), + labelPosition: "top", + __unstableInputWidth: "80px", + value: contentSize || wideSize || '', + onChange: nextWidth => { + nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; + onChange({ ...layout, + contentSize: nextWidth + }); + }, + units: units + }), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: position_center + })), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-hooks__layout-controls-unit" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Wide'), + labelPosition: "top", + __unstableInputWidth: "80px", + value: wideSize || contentSize || '', + onChange: nextWidth => { + nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; + onChange({ ...layout, + wideSize: nextWidth + }); + }, + units: units + }), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: stretch_wide + }))), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-hooks__layout-controls-reset" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "secondary", + isSmall: true, + disabled: !contentSize && !wideSize, + onClick: () => onChange({ + contentSize: undefined, + wideSize: undefined, + inherit: false + }) + }, (0,external_wp_i18n_namespaceObject.__)('Reset'))), (0,external_wp_element_namespaceObject.createElement)("p", { + className: "block-editor-hooks__layout-controls-helptext" + }, (0,external_wp_i18n_namespaceObject.__)('Customize the width for all elements that are assigned to the center or wide columns.'))); + }, + toolBarControls: function DefaultLayoutToolbarControls() { + return null; + }, + save: function DefaultLayoutStyle(_ref2) { + var _style$spacing$blockG, _style$spacing; + + let { + selector, + layout = {}, + style + } = _ref2; + const { + contentSize, + wideSize + } = layout; + const blockGapSupport = useSetting('spacing.blockGap'); + const hasBlockGapStylesSupport = blockGapSupport !== null; + const blockGapValue = (_style$spacing$blockG = style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) !== null && _style$spacing$blockG !== void 0 ? _style$spacing$blockG : 'var( --wp--style--block-gap )'; + let output = !!contentSize || !!wideSize ? ` + ${appendSelectors(selector, '> *')} { + max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize}; + margin-left: auto !important; + margin-right: auto !important; + } + + ${appendSelectors(selector, '> [data-align="wide"]')} { + max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize}; + } + + ${appendSelectors(selector, '> [data-align="full"]')} { + max-width: none; + } + ` : ''; + output += ` + ${appendSelectors(selector, '> [data-align="left"]')} { + float: left; + margin-right: 2em; + } + + ${appendSelectors(selector, '> [data-align="right"]')} { + float: right; + margin-left: 2em; + } + + `; + + if (hasBlockGapStylesSupport) { + output += ` + ${appendSelectors(selector, '> *')} { + margin-top: 0; + margin-bottom: 0; + } + ${appendSelectors(selector, '> * + *')} { + margin-top: ${blockGapValue}; + } + `; + } + + return (0,external_wp_element_namespaceObject.createElement)("style", null, output); + }, + + getOrientation() { + return 'vertical'; + }, + + getAlignments(layout) { + const alignmentInfo = getAlignmentsInfo(layout); + + if (layout.alignments !== undefined) { + if (!layout.alignments.includes('none')) { + layout.alignments.unshift('none'); + } + + return layout.alignments.map(alignment => ({ + name: alignment, + info: alignmentInfo[alignment] + })); + } + + const { + contentSize, + wideSize + } = layout; + const alignments = [{ + name: 'left' + }, { + name: 'center' + }, { + name: 'right' + }]; + + if (contentSize) { + alignments.unshift({ + name: 'full' + }); + } + + if (wideSize) { + alignments.unshift({ + name: 'wide', + info: alignmentInfo.wide + }); + } + + alignments.unshift({ + name: 'none', + info: alignmentInfo.none + }); + return alignments; + } + +}); +/** + * Helper method to assign contextual info to clarify + * alignment settings. + * + * Besides checking if `contentSize` and `wideSize` have a + * value, we now show this information only if their values + * are not a `css var`. This needs to change when parsing + * css variables land. + * + * @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752 + * + * @param {Object} layout The layout object. + * @return {Object} An object with contextual info per alignment. + */ + +function getAlignmentsInfo(layout) { + const { + contentSize, + wideSize + } = layout; + const alignmentInfo = {}; + const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i; + + if (sizeRegex.test(contentSize)) { + // translators: %s: container size (i.e. 600px etc) + alignmentInfo.none = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), contentSize); + } + + if (sizeRegex.test(wideSize)) { + // translators: %s: container size (i.e. 600px etc) + alignmentInfo.wide = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), wideSize); + } + + return alignmentInfo; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/index.js +/** + * Internal dependencies + */ + + +const layoutTypes = [flow, flex]; +/** + * Retrieves a layout type by name. + * + * @param {string} name - The name of the layout type. + * @return {Object} Layout type. + */ + +function getLayoutType() { + let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default'; + return layoutTypes.find(layoutType => layoutType.name === name); +} +/** + * Retrieves the available layout types. + * + * @return {Array} Layout types. + */ + +function getLayoutTypes() { + return layoutTypes; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js + + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const defaultLayout = { + type: 'default' +}; +const Layout = (0,external_wp_element_namespaceObject.createContext)(defaultLayout); +/** + * Allows to define the layout. + */ + +const LayoutProvider = Layout.Provider; +/** + * React hook used to retrieve the layout config. + */ + +function useLayout() { + return (0,external_wp_element_namespaceObject.useContext)(Layout); +} +function LayoutStyle(_ref) { + let { + layout = {}, + ...props + } = _ref; + const layoutType = getLayoutType(layout.type); + + if (layoutType) { + return (0,external_wp_element_namespaceObject.createElement)(layoutType.save, _extends({ + layout: layout + }, props)); + } + + return null; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/use-available-alignments.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +const DEFAULT_CONTROLS = ['none', 'left', 'center', 'right', 'wide', 'full']; +const WIDE_CONTROLS = ['wide', 'full']; +function useAvailableAlignments() { + let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CONTROLS; + + // Always add the `none` option if not exists. + if (!controls.includes('none')) { + controls = ['none', ...controls]; + } + + const { + wideControlsEnabled = false, + themeSupportsLayout + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = select(store); + const settings = getSettings(); + return { + wideControlsEnabled: settings.alignWide, + themeSupportsLayout: settings.supportsLayout + }; + }, []); + const layout = useLayout(); + const layoutType = getLayoutType(layout === null || layout === void 0 ? void 0 : layout.type); + const layoutAlignments = layoutType.getAlignments(layout); + + if (themeSupportsLayout) { + const alignments = layoutAlignments.filter(_ref => { + let { + name: alignmentName + } = _ref; + return controls.includes(alignmentName); + }); // While we treat `none` as an alignment, we shouldn't return it if no + // other alignments exist. + + if (alignments.length === 1 && alignments[0].name === 'none') { + return []; + } + + return alignments; + } // Starting here, it's the fallback for themes not supporting the layout config. + + + if (layoutType.name !== 'default') { + return []; + } + + const { + alignments: availableAlignments = DEFAULT_CONTROLS + } = layout; + const enabledControls = controls.filter(control => (layout.alignments || // Ignore the global wideAlignment check if the layout explicitely defines alignments. + wideControlsEnabled || !WIDE_CONTROLS.includes(control)) && availableAlignments.includes(control)).map(enabledControl => ({ + name: enabledControl + })); // While we treat `none` as an alignment, we shouldn't return it if no + // other alignments exist. + + if (enabledControls.length === 1 && enabledControls[0].name === 'none') { + return []; + } + + return enabledControls; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/ui.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const BLOCK_ALIGNMENTS_CONTROLS = { + none: { + icon: align_none, + title: (0,external_wp_i18n_namespaceObject.__)('None') + }, + left: { + icon: position_left, + title: (0,external_wp_i18n_namespaceObject.__)('Align left') + }, + center: { + icon: position_center, + title: (0,external_wp_i18n_namespaceObject.__)('Align center') + }, + right: { + icon: position_right, + title: (0,external_wp_i18n_namespaceObject.__)('Align right') + }, + wide: { + icon: stretch_wide, + title: (0,external_wp_i18n_namespaceObject.__)('Wide width') + }, + full: { + icon: stretch_full_width, + title: (0,external_wp_i18n_namespaceObject.__)('Full width') + } +}; +const DEFAULT_CONTROL = 'none'; +const POPOVER_PROPS = { + isAlternate: true +}; + +function BlockAlignmentUI(_ref) { + let { + value, + onChange, + controls, + isToolbar, + isCollapsed = true + } = _ref; + const enabledControls = useAvailableAlignments(controls); + const hasEnabledControls = !!enabledControls.length; + + if (!hasEnabledControls) { + return null; + } + + function onChangeAlignment(align) { + onChange([value, 'none'].includes(align) ? undefined : align); + } + + const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[value]; + const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL]; + const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; + const commonProps = { + popoverProps: POPOVER_PROPS, + icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon, + label: (0,external_wp_i18n_namespaceObject.__)('Align'), + toggleProps: { + describedBy: (0,external_wp_i18n_namespaceObject.__)('Change alignment') + } + }; + const extraProps = isToolbar || external_wp_element_namespaceObject.Platform.isNative ? { + isCollapsed: isToolbar ? isCollapsed : undefined, + controls: enabledControls.map(_ref2 => { + let { + name: controlName + } = _ref2; + return { ...BLOCK_ALIGNMENTS_CONTROLS[controlName], + isActive: value === controlName || !value && controlName === 'none', + role: isCollapsed ? 'menuitemradio' : undefined, + onClick: () => onChangeAlignment(controlName) + }; + }) + } : { + children: _ref3 => { + let { + onClose + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { + className: "block-editor-block-alignment-control__menu-group" + }, enabledControls.map(_ref4 => { + let { + name: controlName, + info + } = _ref4; + const { + icon, + title + } = BLOCK_ALIGNMENTS_CONTROLS[controlName]; // If no value is provided, mark as selected the `none` option. + + const isSelected = controlName === value || !value && controlName === 'none'; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + key: controlName, + icon: icon, + iconPosition: "left", + className: classnames_default()('components-dropdown-menu__menu-item', { + 'is-active': isSelected + }), + isSelected: isSelected, + onClick: () => { + onChangeAlignment(controlName); + onClose(); + }, + role: "menuitemradio", + info: info + }, title); + }))); + } + }; + return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({}, commonProps, extraProps)); +} + +/* harmony default export */ var block_alignment_control_ui = (BlockAlignmentUI); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js + + + +/** + * Internal dependencies + */ + +function BlockAlignmentControl(props) { + return (0,external_wp_element_namespaceObject.createElement)(block_alignment_control_ui, _extends({}, props, { + isToolbar: false + })); +} +function BlockAlignmentToolbar(props) { + return (0,external_wp_element_namespaceObject.createElement)(block_alignment_control_ui, _extends({}, props, { + isToolbar: true + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/align.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +/** + * An array which includes all possible valid alignments, + * used to validate if an alignment is valid or not. + * + * @constant + * @type {string[]} + */ + +const ALL_ALIGNMENTS = ['left', 'center', 'right', 'wide', 'full']; +/** + * An array which includes all wide alignments. + * In order for this alignments to be valid they need to be supported by the block, + * and by the theme. + * + * @constant + * @type {string[]} + */ + +const WIDE_ALIGNMENTS = ['wide', 'full']; +/** + * Returns the valid alignments. + * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not. + * Exported just for testing purposes, not exported outside the module. + * + * @param {?boolean|string[]} blockAlign Aligns supported by the block. + * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise. + * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise. + * + * @return {string[]} Valid alignments. + */ + +function getValidAlignments(blockAlign) { + let hasWideBlockSupport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + let hasWideEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + let validAlignments; + + if (Array.isArray(blockAlign)) { + validAlignments = ALL_ALIGNMENTS.filter(value => blockAlign.includes(value)); + } else if (blockAlign === true) { + // `true` includes all alignments... + validAlignments = [...ALL_ALIGNMENTS]; + } else { + validAlignments = []; + } + + if (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) { + return (0,external_lodash_namespaceObject.without)(validAlignments, ...WIDE_ALIGNMENTS); + } + + return validAlignments; +} +/** + * Filters registered block settings, extending attributes to include `align`. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + +function addAttribute(settings) { + // allow blocks to specify their own attribute definition with default values if needed. + if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['align', 'type'])) { + return settings; + } + + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'align')) { + // Gracefully handle if settings.attributes is undefined. + settings.attributes = { ...settings.attributes, + align: { + type: 'string', + // Allow for '' since it is used by updateAlignment function + // in withToolbarControls for special cases with defined default values. + enum: [...ALL_ALIGNMENTS, ''] + } + }; + } + + return settings; +} +/** + * Override the default edit UI to include new toolbar controls for block + * alignment, if block defines support. + * + * @param {Function} BlockEdit Original component. + * + * @return {Function} Wrapped component. + */ + +const withToolbarControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { + const { + name: blockName + } = props; // Compute the block valid alignments by taking into account, + // if the theme supports wide alignments or not and the layout's + // availble alignments. We do that for conditionally rendering + // Slot. + + const blockAllowedAlignments = getValidAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'align'), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'alignWide', true)); + const validAlignments = useAvailableAlignments(blockAllowedAlignments).map(_ref => { + let { + name + } = _ref; + return name; + }); + + const updateAlignment = nextAlign => { + if (!nextAlign) { + var _blockType$attributes, _blockType$attributes2; + + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(props.name); + const blockDefaultAlign = blockType === null || blockType === void 0 ? void 0 : (_blockType$attributes = blockType.attributes) === null || _blockType$attributes === void 0 ? void 0 : (_blockType$attributes2 = _blockType$attributes.align) === null || _blockType$attributes2 === void 0 ? void 0 : _blockType$attributes2.default; + + if (blockDefaultAlign) { + nextAlign = ''; + } + } + + props.setAttributes({ + align: nextAlign + }); + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !!validAlignments.length && (0,external_wp_element_namespaceObject.createElement)(block_controls, { + group: "block", + __experimentalShareWithChildBlocks: true + }, (0,external_wp_element_namespaceObject.createElement)(BlockAlignmentControl, { + value: props.attributes.align, + onChange: updateAlignment, + controls: validAlignments + })), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props)); +}, 'withToolbarControls'); +/** + * Override the default block element to add alignment wrapper props. + * + * @param {Function} BlockListBlock Original component. + * + * @return {Function} Wrapped component. + */ + +const withDataAlign = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { + const { + name, + attributes + } = props; + const { + align + } = attributes; + const blockAllowedAlignments = getValidAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'align'), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'alignWide', true)); + const validAlignments = useAvailableAlignments(blockAllowedAlignments); // If an alignment is not assigned, there's no need to go through the + // effort to validate or assign its value. + + if (align === undefined) { + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props); + } + + let wrapperProps = props.wrapperProps; + + if (validAlignments.some(alignment => alignment.name === align)) { + wrapperProps = { ...wrapperProps, + 'data-align': align + }; + } + + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, { + wrapperProps: wrapperProps + })); +}); +/** + * Override props assigned to save component to inject alignment class name if + * block supports it. + * + * @param {Object} props Additional props applied to save element. + * @param {Object} blockType Block type. + * @param {Object} attributes Block attributes. + * + * @return {Object} Filtered props applied to save element. + */ + +function addAssignedAlign(props, blockType, attributes) { + const { + align + } = attributes; + const blockAlign = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, 'align'); + const hasWideBlockSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'alignWide', true); // Compute valid alignments without taking into account if + // the theme supports wide alignments or not. + // This way changing themes does not impact the block save. + + const isAlignValid = getValidAlignments(blockAlign, hasWideBlockSupport).includes(align); + + if (isAlignValid) { + props.className = classnames_default()(`align${align}`, props.className); + } + + return props; +} +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/align/addAttribute', addAttribute); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/align/with-data-align', withDataAlign); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/align/with-toolbar-controls', withToolbarControls); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/align/addAssignedAlign', addAssignedAlign); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/lock.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Filters registered block settings, extending attributes to include `lock`. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + +function lock_addAttribute(settings) { + // allow blocks to specify their own attribute definition with default values if needed. + if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['lock', 'type'])) { + return settings; + } // Gracefully handle if settings.attributes is undefined. + + + settings.attributes = { ...settings.attributes, + lock: { + type: 'object' + } + }; + return settings; +} +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/lock/addAttribute', lock_addAttribute); + +;// CONCATENATED MODULE: external ["wp","warning"] +var external_wp_warning_namespaceObject = window["wp"]["warning"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/groups.js +/** + * WordPress dependencies + */ + +const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControls'); +const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorAdvancedControls'); +const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsDimensions'); +const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsTypography'); +const groups_groups = { + default: InspectorControlsDefault, + advanced: InspectorControlsAdvanced, + dimensions: InspectorControlsDimensions, + typography: InspectorControlsTypography +}; +/* harmony default export */ var inspector_controls_groups = (groups_groups); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/fill.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function InspectorControlsFill(_ref) { + var _groups$group; + + let { + __experimentalGroup: group = 'default', + children + } = _ref; + const isDisplayed = useDisplayBlockControls(); + const Fill = (_groups$group = inspector_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Fill; + + if (!Fill) { + typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0; + return null; + } + + if (!isDisplayed) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, { + document: document + }, (0,external_wp_element_namespaceObject.createElement)(Fill, null, fillProps => { + // Children passed to InspectorControlsFill will not have + // access to any React Context whose Provider is part of + // the InspectorControlsSlot tree. So we re-create the + // Provider in this subtree. + const value = !(0,external_lodash_namespaceObject.isEmpty)(fillProps) ? fillProps : null; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelContext.Provider, { + value: value + }, children); + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/utils.js +/** + * External dependencies + */ + +/** + * Removed falsy values from nested object. + * + * @param {*} object + * @return {*} Object cleaned from falsy values + */ + +const cleanEmptyObject = object => { + if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) { + return object; + } + + const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity); + return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects; +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function BlockSupportToolsPanel(_ref) { + let { + children, + group, + label + } = _ref; + const { + attributes, + clientIds, + panelId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockAttributes, + getMultiSelectedBlockClientIds, + getSelectedBlockClientId, + hasMultiSelection + } = select(store); // When we currently have a multi-selection, the value returned from + // `getSelectedBlockClientId()` is `null`. When a `null` value is used + // for the `panelId`, a `ToolsPanel` will still allow panel items to + // register themselves despite their panelIds not matching. + + const selectedBlockClientId = getSelectedBlockClientId(); + + if (hasMultiSelection()) { + const selectedBlockClientIds = getMultiSelectedBlockClientIds(); + const selectedBlockAttributes = selectedBlockClientIds.reduce((blockAttributes, blockId) => { + blockAttributes[blockId] = getBlockAttributes(blockId); + return blockAttributes; + }, {}); + return { + panelId: selectedBlockClientId, + clientIds: selectedBlockClientIds, + attributes: selectedBlockAttributes + }; + } + + return { + panelId: selectedBlockClientId, + clientIds: [selectedBlockClientId], + attributes: { + [selectedBlockClientId]: getBlockAttributes(selectedBlockClientId) + } + }; + }, []); + const { + updateBlockAttributes + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + + const resetAll = function () { + let resetFilters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + const newAttributes = {}; + clientIds.forEach(clientId => { + const { + style + } = attributes[clientId]; + let newBlockAttributes = { + style + }; + resetFilters.forEach(resetFilter => { + newBlockAttributes = { ...newBlockAttributes, + ...resetFilter(newBlockAttributes) + }; + }); // Enforce a cleaned style object. + + newBlockAttributes = { ...newBlockAttributes, + style: cleanEmptyObject(newBlockAttributes.style) + }; + newAttributes[clientId] = newBlockAttributes; + }); + updateBlockAttributes(clientIds, newAttributes, true); + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, { + className: `${group}-block-support-panel`, + label: label, + resetAll: resetAll, + key: panelId, + panelId: panelId, + hasInnerWrapper: true, + shouldRenderPlaceholderItems: true // Required to maintain fills ordering. + + }, children); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-slot-container.js + + + +/** + * WordPress dependencies + */ + + +function BlockSupportSlotContainer(_ref) { + let { + Slot, + ...props + } = _ref; + const toolsPanelContext = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext); + return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, { + fillProps: toolsPanelContext + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/slot.js + + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +function InspectorControlsSlot(_ref) { + var _groups$group; + + let { + __experimentalGroup: group = 'default', + bubblesVirtually = true, + label, + ...props + } = _ref; + const Slot = (_groups$group = inspector_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Slot; + const slot = (0,external_wp_components_namespaceObject.__experimentalUseSlot)(Slot === null || Slot === void 0 ? void 0 : Slot.__unstableName); + + if (!Slot || !slot) { + typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0; + return null; + } + + const hasFills = Boolean(slot.fills && slot.fills.length); + + if (!hasFills) { + return null; + } + + if (label) { + return (0,external_wp_element_namespaceObject.createElement)(BlockSupportToolsPanel, { + group: group, + label: label + }, (0,external_wp_element_namespaceObject.createElement)(BlockSupportSlotContainer, _extends({}, props, { + bubblesVirtually: bubblesVirtually, + Slot: Slot + }))); + } + + return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, { + bubblesVirtually: bubblesVirtually + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/index.js + + + +/** + * Internal dependencies + */ + + +const InspectorControls = InspectorControlsFill; +InspectorControls.Slot = InspectorControlsSlot; // This is just here for backward compatibility. + +const InspectorAdvancedControls = props => { + return (0,external_wp_element_namespaceObject.createElement)(InspectorControlsFill, _extends({}, props, { + __experimentalGroup: "advanced" + })); +}; + +InspectorAdvancedControls.Slot = props => { + return (0,external_wp_element_namespaceObject.createElement)(InspectorControlsSlot, _extends({}, props, { + __experimentalGroup: "advanced" + })); +}; + +InspectorAdvancedControls.slotName = 'InspectorAdvancedControls'; +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md + */ + +/* harmony default export */ var inspector_controls = (InspectorControls); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/anchor.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + +/** + * Regular expression matching invalid anchor characters for replacement. + * + * @type {RegExp} + */ + +const ANCHOR_REGEX = /[\s#]/g; +/** + * Filters registered block settings, extending attributes with anchor using ID + * of the first node. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + +function anchor_addAttribute(settings) { + // allow blocks to specify their own attribute definition with default values if needed. + if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['anchor', 'type'])) { + return settings; + } + + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'anchor')) { + // Gracefully handle if settings.attributes is undefined. + settings.attributes = { ...settings.attributes, + anchor: { + type: 'string', + source: 'attribute', + attribute: 'id', + selector: '*' + } + }; + } + + return settings; +} +/** + * Override the default edit UI to include a new block inspector control for + * assigning the anchor ID, if block supports anchor. + * + * @param {WPComponent} BlockEdit Original component. + * + * @return {WPComponent} Wrapped component. + */ + +const withInspectorControl = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => { + return props => { + const hasAnchor = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(props.name, 'anchor'); + + if (hasAnchor && props.isSelected) { + const isWeb = external_wp_element_namespaceObject.Platform.OS === 'web'; + const textControl = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + className: "html-anchor-control", + label: (0,external_wp_i18n_namespaceObject.__)('HTML anchor'), + help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'), isWeb && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { + href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/page-jumps/') + }, (0,external_wp_i18n_namespaceObject.__)('Learn more about anchors'))), + value: props.attributes.anchor || '', + placeholder: !isWeb ? (0,external_wp_i18n_namespaceObject.__)('Add an anchor') : null, + onChange: nextValue => { + nextValue = nextValue.replace(ANCHOR_REGEX, '-'); + props.setAttributes({ + anchor: nextValue + }); + }, + autoCapitalize: "none", + autoComplete: "off" + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props), isWeb && (0,external_wp_element_namespaceObject.createElement)(inspector_controls, { + __experimentalGroup: "advanced" + }, textControl), !isWeb && props.name === 'core/heading' && (0,external_wp_element_namespaceObject.createElement)(inspector_controls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Heading settings') + }, textControl))); + } + + return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props); + }; +}, 'withInspectorControl'); +/** + * Override props assigned to save component to inject anchor ID, if block + * supports anchor. This is only applied if the block's save result is an + * element and not a markup string. + * + * @param {Object} extraProps Additional props applied to save element. + * @param {Object} blockType Block type. + * @param {Object} attributes Current block attributes. + * + * @return {Object} Filtered props applied to save element. + */ + +function addSaveProps(extraProps, blockType, attributes) { + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'anchor')) { + extraProps.id = attributes.anchor === '' ? null : attributes.anchor; + } + + return extraProps; +} +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/anchor/attribute', anchor_addAttribute); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/anchor/with-inspector-control', withInspectorControl); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/anchor/save-props', addSaveProps); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/custom-class-name.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + +/** + * Filters registered block settings, extending attributes with anchor using ID + * of the first node. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + +function custom_class_name_addAttribute(settings) { + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'customClassName', true)) { + // Gracefully handle if settings.attributes is undefined. + settings.attributes = { ...settings.attributes, + className: { + type: 'string' + } + }; + } + + return settings; +} +/** + * Override the default edit UI to include a new block inspector control for + * assigning the custom class name, if block supports custom class name. + * + * @param {WPComponent} BlockEdit Original component. + * + * @return {WPComponent} Wrapped component. + */ + +const custom_class_name_withInspectorControl = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => { + return props => { + const hasCustomClassName = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(props.name, 'customClassName', true); + + if (hasCustomClassName && props.isSelected) { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props), (0,external_wp_element_namespaceObject.createElement)(inspector_controls, { + __experimentalGroup: "advanced" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + autoComplete: "off", + label: (0,external_wp_i18n_namespaceObject.__)('Additional CSS class(es)'), + value: props.attributes.className || '', + onChange: nextValue => { + props.setAttributes({ + className: nextValue !== '' ? nextValue : undefined + }); + }, + help: (0,external_wp_i18n_namespaceObject.__)('Separate multiple classes with spaces.') + }))); + } + + return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props); + }; +}, 'withInspectorControl'); +/** + * Override props assigned to save component to inject anchor ID, if block + * supports anchor. This is only applied if the block's save result is an + * element and not a markup string. + * + * @param {Object} extraProps Additional props applied to save element. + * @param {Object} blockType Block type. + * @param {Object} attributes Current block attributes. + * + * @return {Object} Filtered props applied to save element. + */ + +function custom_class_name_addSaveProps(extraProps, blockType, attributes) { + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'customClassName', true) && attributes.className) { + extraProps.className = classnames_default()(extraProps.className, attributes.className); + } + + return extraProps; +} +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/custom-class-name/attribute', custom_class_name_addAttribute); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/custom-class-name/with-inspector-control', custom_class_name_withInspectorControl); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/custom-class-name/save-props', custom_class_name_addSaveProps); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/generated-class-name.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Override props assigned to save component to inject generated className if + * block supports it. This is only applied if the block's save result is an + * element and not a markup string. + * + * @param {Object} extraProps Additional props applied to save element. + * @param {Object} blockType Block type. + * + * @return {Object} Filtered props applied to save element. + */ + +function addGeneratedClassName(extraProps, blockType) { + // Adding the generated className + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true)) { + if (typeof extraProps.className === 'string') { + // We have some extra classes and want to add the default classname + // We use uniq to prevent duplicate classnames + extraProps.className = (0,external_lodash_namespaceObject.uniq)([(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name), ...extraProps.className.split(' ')]).join(' ').trim(); + } else { + // There is no string in the className variable, + // so we just dump the default name in there + extraProps.className = (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name); + } + } + + return extraProps; +} +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/generated-class-name/save-props', addGeneratedClassName); + +;// CONCATENATED MODULE: external ["wp","dom"] +var external_wp_dom_namespaceObject = window["wp"]["dom"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-context/index.js + + +/** + * WordPress dependencies + */ + +/** @typedef {import('react').ReactNode} ReactNode */ + +/** + * @typedef BlockContextProviderProps + * + * @property {Record} value Context value to merge with current + * value. + * @property {ReactNode} children Component children. + */ + +/** @type {import('react').Context>} */ + +const block_context_Context = (0,external_wp_element_namespaceObject.createContext)({}); +/** + * Component which merges passed value with current consumed block context. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-context/README.md + * + * @param {BlockContextProviderProps} props + */ + +function BlockContextProvider(_ref) { + let { + value, + children + } = _ref; + const context = (0,external_wp_element_namespaceObject.useContext)(block_context_Context); + const nextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...context, + ...value + }), [context, value]); + return (0,external_wp_element_namespaceObject.createElement)(block_context_Context.Provider, { + value: nextValue, + children: children + }); +} +/* harmony default export */ var block_context = (block_context_Context); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/edit.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * Default value used for blocks which do not define their own context needs, + * used to guarantee that a block's `context` prop will always be an object. It + * is assigned as a constant since it is always expected to be an empty object, + * and in order to avoid unnecessary React reconciliations of a changing object. + * + * @type {{}} + */ + +const DEFAULT_BLOCK_CONTEXT = {}; +const Edit = props => { + const { + attributes = {}, + name + } = props; + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); + const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context); // Assign context values using the block type's declared context needs. + + const context = (0,external_wp_element_namespaceObject.useMemo)(() => { + return blockType && blockType.usesContext ? (0,external_lodash_namespaceObject.pick)(blockContext, blockType.usesContext) : DEFAULT_BLOCK_CONTEXT; + }, [blockType, blockContext]); + + if (!blockType) { + return null; + } // `edit` and `save` are functions or components describing the markup + // with which a block is displayed. If `blockType` is valid, assign + // them preferentially as the render value for the block. + + + const Component = blockType.edit || blockType.save; + + if (blockType.apiVersion > 1) { + return (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, { + context: context + })); + } // Generate a class name for the block's editable form + + + const generatedClassName = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true) ? (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name) : null; + const className = classnames_default()(generatedClassName, attributes.className); + return (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, { + context: context, + className: className + })); +}; +/* harmony default export */ var edit = ((0,external_wp_components_namespaceObject.withFilters)('editor.BlockEdit')(Edit)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +function BlockEdit(props) { + const { + name, + isSelected, + clientId + } = props; + const context = { + name, + isSelected, + clientId + }; + return (0,external_wp_element_namespaceObject.createElement)(Provider // It is important to return the same object if props haven't + // changed to avoid unnecessary rerenders. + // See https://reactjs.org/docs/context.html#caveats. + , { + value: (0,external_wp_element_namespaceObject.useMemo)(() => context, Object.values(context)) + }, (0,external_wp_element_namespaceObject.createElement)(edit, props)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-horizontal.js + + +/** + * WordPress dependencies + */ + +const moreHorizontal = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" +})); +/* harmony default export */ var more_horizontal = (moreHorizontal); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/warning/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +function Warning(_ref) { + let { + className, + actions, + children, + secondaryActions + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: classnames_default()(className, 'block-editor-warning') + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-warning__contents" + }, (0,external_wp_element_namespaceObject.createElement)("p", { + className: "block-editor-warning__message" + }, children), (external_wp_element_namespaceObject.Children.count(actions) > 0 || secondaryActions) && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-warning__actions" + }, external_wp_element_namespaceObject.Children.count(actions) > 0 && external_wp_element_namespaceObject.Children.map(actions, (action, i) => (0,external_wp_element_namespaceObject.createElement)("span", { + key: i, + className: "block-editor-warning__action" + }, action)), secondaryActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { + className: "block-editor-warning__secondary", + icon: more_horizontal, + label: (0,external_wp_i18n_namespaceObject.__)('More options'), + popoverProps: { + position: 'bottom left', + className: 'block-editor-warning__dropdown' + }, + noIcons: true + }, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, secondaryActions.map((item, pos) => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: item.onClick, + key: pos + }, item.title))))))); +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md + */ + + +/* harmony default export */ var warning = (Warning); + +// EXTERNAL MODULE: ./node_modules/diff/lib/diff/character.js +var character = __webpack_require__(1973); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-compare/block-view.js + + +/** + * WordPress dependencies + */ + + + +function BlockView(_ref) { + let { + title, + rawContent, + renderedContent, + action, + actionText, + className + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: className + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-compare__content" + }, (0,external_wp_element_namespaceObject.createElement)("h2", { + className: "block-editor-block-compare__heading" + }, title), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-compare__html" + }, rawContent), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-compare__preview edit-post-visual-editor" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(renderedContent)))), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-compare__action" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "secondary", + tabIndex: "0", + onClick: action + }, actionText))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-compare/index.js + + +/** + * External dependencies + */ + + // diff doesn't tree-shake correctly, so we import from the individual +// module here, to avoid including too much of the library + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function BlockCompare(_ref) { + let { + block, + onKeep, + onConvert, + convertor, + convertButtonText + } = _ref; + + function getDifference(originalContent, newContent) { + const difference = (0,character/* diffChars */.Kx)(originalContent, newContent); + return difference.map((item, pos) => { + const classes = classnames_default()({ + 'block-editor-block-compare__added': item.added, + 'block-editor-block-compare__removed': item.removed + }); + return (0,external_wp_element_namespaceObject.createElement)("span", { + key: pos, + className: classes + }, item.value); + }); + } + + function getConvertedContent(convertedBlock) { + // The convertor may return an array of items or a single item + const newBlocks = (0,external_lodash_namespaceObject.castArray)(convertedBlock); // Get converted block details + + const newContent = newBlocks.map(item => (0,external_wp_blocks_namespaceObject.getSaveContent)(item.name, item.attributes, item.innerBlocks)); + return newContent.join(''); + } + + const converted = getConvertedContent(convertor(block)); + const difference = getDifference(block.originalContent, converted); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-compare__wrapper" + }, (0,external_wp_element_namespaceObject.createElement)(BlockView, { + title: (0,external_wp_i18n_namespaceObject.__)('Current'), + className: "block-editor-block-compare__current", + action: onKeep, + actionText: (0,external_wp_i18n_namespaceObject.__)('Convert to HTML'), + rawContent: block.originalContent, + renderedContent: block.originalContent + }), (0,external_wp_element_namespaceObject.createElement)(BlockView, { + title: (0,external_wp_i18n_namespaceObject.__)('After Conversion'), + className: "block-editor-block-compare__converted", + action: onConvert, + actionText: convertButtonText, + rawContent: difference, + renderedContent: converted + })); +} + +/* harmony default export */ var block_compare = (BlockCompare); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-invalid-warning.js + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +function BlockInvalidWarning(_ref) { + let { + convertToHTML, + convertToBlocks, + convertToClassic, + attemptBlockRecovery, + block + } = _ref; + const hasHTMLBlock = !!(0,external_wp_blocks_namespaceObject.getBlockType)('core/html'); + const [compare, setCompare] = (0,external_wp_element_namespaceObject.useState)(false); + const onCompare = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(true), []); + const onCompareClose = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(false), []); // We memo the array here to prevent the children components from being updated unexpectedly + + const hiddenActions = (0,external_wp_element_namespaceObject.useMemo)(() => [{ + // translators: Button to fix block content + title: (0,external_wp_i18n_namespaceObject._x)('Resolve', 'imperative verb'), + onClick: onCompare + }, hasHTMLBlock && { + title: (0,external_wp_i18n_namespaceObject.__)('Convert to HTML'), + onClick: convertToHTML + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Convert to Classic Block'), + onClick: convertToClassic + }].filter(Boolean), [onCompare, convertToHTML, convertToClassic]); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(warning, { + actions: [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: "recover", + onClick: attemptBlockRecovery, + variant: "primary" + }, (0,external_wp_i18n_namespaceObject.__)('Attempt Block Recovery'))], + secondaryActions: hiddenActions + }, (0,external_wp_i18n_namespaceObject.__)('This block contains unexpected or invalid content.')), compare && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { + title: // translators: Dialog title to fix block content + (0,external_wp_i18n_namespaceObject.__)('Resolve Block'), + onRequestClose: onCompareClose, + className: "block-editor-block-compare" + }, (0,external_wp_element_namespaceObject.createElement)(block_compare, { + block: block, + onKeep: convertToHTML, + onConvert: convertToBlocks, + convertor: blockToBlocks, + convertButtonText: (0,external_wp_i18n_namespaceObject.__)('Convert to Blocks') + }))); +} + +const blockToClassic = block => (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', { + content: block.originalContent +}); + +const blockToHTML = block => (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { + content: block.originalContent +}); + +const blockToBlocks = block => (0,external_wp_blocks_namespaceObject.rawHandler)({ + HTML: block.originalContent +}); + +const recoverBlock = _ref2 => { + let { + name, + attributes, + innerBlocks + } = _ref2; + return (0,external_wp_blocks_namespaceObject.createBlock)(name, attributes, innerBlocks); +}; + +/* harmony default export */ var block_invalid_warning = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, _ref3) => { + let { + clientId + } = _ref3; + return { + block: select(store).getBlock(clientId) + }; +}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref4) => { + let { + block + } = _ref4; + const { + replaceBlock + } = dispatch(store); + return { + convertToClassic() { + replaceBlock(block.clientId, blockToClassic(block)); + }, + + convertToHTML() { + replaceBlock(block.clientId, blockToHTML(block)); + }, + + convertToBlocks() { + replaceBlock(block.clientId, blockToBlocks(block)); + }, + + attemptBlockRecovery() { + replaceBlock(block.clientId, recoverBlock(block)); + } + + }; +})])(BlockInvalidWarning)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-warning.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const block_crash_warning_warning = (0,external_wp_element_namespaceObject.createElement)(warning, { + className: "block-editor-block-list__block-crash-warning" +}, (0,external_wp_i18n_namespaceObject.__)('This block has encountered an error and cannot be previewed.')); +/* harmony default export */ var block_crash_warning = (() => block_crash_warning_warning); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-boundary.js +/** + * WordPress dependencies + */ + + +class BlockCrashBoundary extends external_wp_element_namespaceObject.Component { + constructor() { + super(...arguments); + this.state = { + hasError: false + }; + } + + componentDidCatch() { + this.setState({ + hasError: true + }); + } + + render() { + if (this.state.hasError) { + return this.props.fallback; + } + + return this.props.children; + } + +} + +/* harmony default export */ var block_crash_boundary = (BlockCrashBoundary); + +// EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js +var lib = __webpack_require__(773); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-html.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +function BlockHTML(_ref) { + let { + clientId + } = _ref; + const [html, setHtml] = (0,external_wp_element_namespaceObject.useState)(''); + const block = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlock(clientId), [clientId]); + const { + updateBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + + const onChange = () => { + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); + + if (!blockType) { + return; + } + + const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(blockType, html, block.attributes); // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error + + const content = html ? html : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes); + const isValid = html ? (0,external_wp_blocks_namespaceObject.isValidBlockContent)(blockType, attributes, content) : true; + updateBlock(clientId, { + attributes, + originalContent: content, + isValid + }); // Ensure the state is updated if we reset so it displays the default content + + if (!html) { + setHtml({ + content + }); + } + }; + + (0,external_wp_element_namespaceObject.useEffect)(() => { + setHtml((0,external_wp_blocks_namespaceObject.getBlockContent)(block)); + }, [block]); + return (0,external_wp_element_namespaceObject.createElement)(lib/* default */.Z, { + className: "block-editor-block-list__block-html-textarea", + value: html, + onBlur: onChange, + onChange: event => setHtml(event.target.value) + }); +} + +/* harmony default export */ var block_html = (BlockHTML); + +;// CONCATENATED MODULE: ./node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js let updateQueue = makeQueue(); const raf = fn => schedule(fn, updateQueue); let writeQueue = makeQueue(); @@ -37539,7 +11747,7 @@ raf.advance = () => { if (raf.frameLoop !== 'demand') { console.warn('Cannot call the manual advancement of rafz whilst frameLoop is not set as demand'); } else { - react_spring_rafz_esm_update(); + update(); } }; @@ -37574,11 +11782,11 @@ function stop() { function loop() { if (~ts) { nativeRaf(loop); - raf.batchedUpdates(react_spring_rafz_esm_update); + raf.batchedUpdates(update); } } -function react_spring_rafz_esm_update() { +function update() { let prevTs = ts; ts = raf.now(); let count = findTimeout(ts); @@ -37661,9 +11869,9 @@ const __raf = { // EXTERNAL MODULE: external "React" -var external_React_ = __webpack_require__("cDcd"); - -// CONCATENATED MODULE: ./node_modules/@react-spring/shared/dist/react-spring-shared.esm.js +var external_React_ = __webpack_require__(9196); +var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); +;// CONCATENATED MODULE: ./node_modules/@react-spring/shared/dist/react-spring-shared.esm.js @@ -37675,7 +11883,7 @@ const defineHidden = (obj, key, value) => Object.defineProperty(obj, key, { writable: true, configurable: true }); -const is = { +const react_spring_shared_esm_is = { arr: Array.isArray, obj: a => !!a && a.constructor.name === 'Object', fun: a => typeof a === 'function', @@ -37684,8 +11892,8 @@ const is = { und: a => a === undefined }; function isEqual(a, b) { - if (is.arr(a)) { - if (!is.arr(b) || a.length !== b.length) return false; + if (react_spring_shared_esm_is.arr(a)) { + if (!react_spring_shared_esm_is.arr(b) || a.length !== b.length) return false; for (let i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; @@ -37696,9 +11904,9 @@ function isEqual(a, b) { return a === b; } -const each = (obj, fn) => obj.forEach(fn); +const react_spring_shared_esm_each = (obj, fn) => obj.forEach(fn); function eachProp(obj, fn, ctx) { - if (is.arr(obj)) { + if (react_spring_shared_esm_is.arr(obj)) { for (let i = 0; i < obj.length; i++) { fn.call(ctx, obj[i], `${i}`); } @@ -37712,12 +11920,12 @@ function eachProp(obj, fn, ctx) { } } } -const toArray = a => is.und(a) ? [] : is.arr(a) ? a : [a]; +const react_spring_shared_esm_toArray = a => react_spring_shared_esm_is.und(a) ? [] : react_spring_shared_esm_is.arr(a) ? a : [a]; function flush(queue, iterator) { if (queue.size) { const items = Array.from(queue); queue.clear(); - each(items, iterator); + react_spring_shared_esm_each(items, iterator); } } const flushCalls = (queue, ...args) => flush(queue, fn => fn(...args)); @@ -37740,7 +11948,7 @@ const react_spring_shared_esm_assign = globals => { if (globals.frameLoop) raf.frameLoop = globals.frameLoop; }; -var react_spring_shared_esm_globals = /*#__PURE__*/Object.freeze({ +var globals = /*#__PURE__*/Object.freeze({ __proto__: null, get createStringInterpolator () { return createStringInterpolator$1; }, get to () { return to; }, @@ -38101,11 +12309,11 @@ function colorToRgba(input) { } const createInterpolator = (range, output, extrapolate) => { - if (is.fun(range)) { + if (react_spring_shared_esm_is.fun(range)) { return range; } - if (is.arr(range)) { + if (react_spring_shared_esm_is.arr(range)) { return createInterpolator({ range, output: output, @@ -38113,7 +12321,7 @@ const createInterpolator = (range, output, extrapolate) => { }); } - if (is.str(range.output[0])) { + if (react_spring_shared_esm_is.str(range.output[0])) { return createStringInterpolator$1(range); } @@ -38156,8 +12364,8 @@ function findRange(input, inputRange) { return i - 1; } -function _extends() { - _extends = Object.assign || function (target) { +function react_spring_shared_esm_extends() { + react_spring_shared_esm_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; @@ -38171,7 +12379,7 @@ function _extends() { return target; }; - return _extends.apply(this, arguments); + return react_spring_shared_esm_extends.apply(this, arguments); } const $get = Symbol.for('FluidValue.get'); @@ -38319,7 +12527,7 @@ const createStringInterpolator = config => { return values[i]; })); - const interpolators = outputRanges.map(output => createInterpolator(_extends({}, config, { + const interpolators = outputRanges.map(output => createInterpolator(react_spring_shared_esm_extends({}, config, { output }))); return input => { @@ -38350,7 +12558,7 @@ const once = fn => { }; const warnInterpolate = once(console.warn); -function deprecateInterpolate() { +function react_spring_shared_esm_deprecateInterpolate() { warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`); } const warnDirectCall = once(console.warn); @@ -38359,16 +12567,16 @@ function deprecateDirectCall() { } function isAnimatedString(value) { - return is.str(value) && (value[0] == '#' || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {})); + return react_spring_shared_esm_is.str(value) && (value[0] == '#' || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {})); } -const useOnce = effect => Object(external_React_["useEffect"])(effect, emptyDeps); +const react_spring_shared_esm_useOnce = effect => (0,external_React_.useEffect)(effect, emptyDeps); const emptyDeps = []; -function useForceUpdate() { - const update = Object(external_React_["useState"])()[1]; - const mounted = Object(external_React_["useState"])(makeMountedRef)[0]; - useOnce(mounted.unmount); +function react_spring_shared_esm_useForceUpdate() { + const update = (0,external_React_.useState)()[1]; + const mounted = (0,external_React_.useState)(makeMountedRef)[0]; + react_spring_shared_esm_useOnce(mounted.unmount); return () => { if (mounted.current) { update({}); @@ -38387,11 +12595,11 @@ function makeMountedRef() { } function useMemoOne(getResult, inputs) { - const [initial] = Object(external_React_["useState"])(() => ({ + const [initial] = (0,external_React_.useState)(() => ({ inputs, result: getResult() })); - const committed = Object(external_React_["useRef"])(); + const committed = (0,external_React_.useRef)(); const prevCache = committed.current; let cache = prevCache; @@ -38408,7 +12616,7 @@ function useMemoOne(getResult, inputs) { cache = initial; } - Object(external_React_["useEffect"])(() => { + (0,external_React_.useEffect)(() => { committed.current = cache; if (prevCache == initial) { @@ -38432,38 +12640,3215 @@ function areInputsEqual(next, prev) { return true; } -function usePrev(value) { - const prevRef = Object(external_React_["useRef"])(); - Object(external_React_["useEffect"])(() => { +function react_spring_shared_esm_usePrev(value) { + const prevRef = (0,external_React_.useRef)(); + (0,external_React_.useEffect)(() => { prevRef.current = value; }); return prevRef.current; } -const useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_["useLayoutEffect"] : external_React_["useEffect"]; +const react_spring_shared_esm_useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_.useLayoutEffect : external_React_.useEffect; + + + +;// CONCATENATED MODULE: ./node_modules/@react-spring/animated/dist/react-spring-animated.esm.js -/***/ }), +const $node = Symbol.for('Animated:node'); +const isAnimated = value => !!value && value[$node] === value; +const getAnimated = owner => owner && owner[$node]; +const setAnimated = (owner, node) => defineHidden(owner, $node, node); +const getPayload = owner => owner && owner[$node] && owner[$node].getPayload(); +class Animated { + constructor() { + this.payload = void 0; + setAnimated(this, this); + } -/***/ "nQUx": -/***/ (function(module, __webpack_exports__, __webpack_require__) { + getPayload() { + return this.payload || []; + } -"use strict"; -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("onLe"); -/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_notices__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("BhPs"); +} + +class AnimatedValue extends Animated { + constructor(_value) { + super(); + this.done = true; + this.elapsedTime = void 0; + this.lastPosition = void 0; + this.lastVelocity = void 0; + this.v0 = void 0; + this.durationProgress = 0; + this._value = _value; + + if (react_spring_shared_esm_is.num(this._value)) { + this.lastPosition = this._value; + } + } + + static create(value) { + return new AnimatedValue(value); + } + + getPayload() { + return [this]; + } + + getValue() { + return this._value; + } + + setValue(value, step) { + if (react_spring_shared_esm_is.num(value)) { + this.lastPosition = value; + + if (step) { + value = Math.round(value / step) * step; + + if (this.done) { + this.lastPosition = value; + } + } + } + + if (this._value === value) { + return false; + } + + this._value = value; + return true; + } + + reset() { + const { + done + } = this; + this.done = false; + + if (react_spring_shared_esm_is.num(this._value)) { + this.elapsedTime = 0; + this.durationProgress = 0; + this.lastPosition = this._value; + if (done) this.lastVelocity = null; + this.v0 = null; + } + } + +} + +class AnimatedString extends AnimatedValue { + constructor(value) { + super(0); + this._string = null; + this._toString = void 0; + this._toString = createInterpolator({ + output: [value, value] + }); + } + + static create(value) { + return new AnimatedString(value); + } + + getValue() { + let value = this._string; + return value == null ? this._string = this._toString(this._value) : value; + } + + setValue(value) { + if (react_spring_shared_esm_is.str(value)) { + if (value == this._string) { + return false; + } + + this._string = value; + this._value = 1; + } else if (super.setValue(value)) { + this._string = null; + } else { + return false; + } + + return true; + } + + reset(goal) { + if (goal) { + this._toString = createInterpolator({ + output: [this.getValue(), goal] + }); + } + + this._value = 0; + super.reset(); + } + +} + +const TreeContext = { + dependencies: null +}; + +class AnimatedObject extends Animated { + constructor(source) { + super(); + this.source = source; + this.setValue(source); + } + + getValue(animated) { + const values = {}; + eachProp(this.source, (source, key) => { + if (isAnimated(source)) { + values[key] = source.getValue(animated); + } else if (hasFluidValue(source)) { + values[key] = getFluidValue(source); + } else if (!animated) { + values[key] = source; + } + }); + return values; + } + + setValue(source) { + this.source = source; + this.payload = this._makePayload(source); + } + + reset() { + if (this.payload) { + react_spring_shared_esm_each(this.payload, node => node.reset()); + } + } + + _makePayload(source) { + if (source) { + const payload = new Set(); + eachProp(source, this._addToPayload, payload); + return Array.from(payload); + } + } + + _addToPayload(source) { + if (TreeContext.dependencies && hasFluidValue(source)) { + TreeContext.dependencies.add(source); + } + + const payload = getPayload(source); + + if (payload) { + react_spring_shared_esm_each(payload, node => this.add(node)); + } + } + +} + +class AnimatedArray extends AnimatedObject { + constructor(source) { + super(source); + } + + static create(source) { + return new AnimatedArray(source); + } + + getValue() { + return this.source.map(node => node.getValue()); + } + + setValue(source) { + const payload = this.getPayload(); + + if (source.length == payload.length) { + return payload.map((node, i) => node.setValue(source[i])).some(Boolean); + } + + super.setValue(source.map(makeAnimated)); + return true; + } + +} + +function makeAnimated(value) { + const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue; + return nodeType.create(value); +} + +function getAnimatedType(value) { + const parentNode = getAnimated(value); + return parentNode ? parentNode.constructor : react_spring_shared_esm_is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue; +} + +function react_spring_animated_esm_extends() { + react_spring_animated_esm_extends = Object.assign || 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 target; + }; + + return react_spring_animated_esm_extends.apply(this, arguments); +} + +const withAnimated = (Component, host) => { + const hasInstance = !react_spring_shared_esm_is.fun(Component) || Component.prototype && Component.prototype.isReactComponent; + return (0,external_React_.forwardRef)((givenProps, givenRef) => { + const instanceRef = (0,external_React_.useRef)(null); + const ref = hasInstance && (0,external_React_.useCallback)(value => { + instanceRef.current = updateRef(givenRef, value); + }, [givenRef]); + const [props, deps] = getAnimatedState(givenProps, host); + const forceUpdate = react_spring_shared_esm_useForceUpdate(); + + const callback = () => { + const instance = instanceRef.current; + + if (hasInstance && !instance) { + return; + } + + const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false; + + if (didUpdate === false) { + forceUpdate(); + } + }; + + const observer = new PropsObserver(callback, deps); + const observerRef = (0,external_React_.useRef)(); + react_spring_shared_esm_useLayoutEffect(() => { + const lastObserver = observerRef.current; + observerRef.current = observer; + react_spring_shared_esm_each(deps, dep => addFluidObserver(dep, observer)); + + if (lastObserver) { + react_spring_shared_esm_each(lastObserver.deps, dep => removeFluidObserver(dep, lastObserver)); + raf.cancel(lastObserver.update); + } + }); + (0,external_React_.useEffect)(callback, []); + react_spring_shared_esm_useOnce(() => () => { + const observer = observerRef.current; + react_spring_shared_esm_each(observer.deps, dep => removeFluidObserver(dep, observer)); + }); + const usedProps = host.getComponentProps(props.getValue()); + return external_React_.createElement(Component, react_spring_animated_esm_extends({}, usedProps, { + ref: ref + })); + }); +}; + +class PropsObserver { + constructor(update, deps) { + this.update = update; + this.deps = deps; + } + + eventObserved(event) { + if (event.type == 'change') { + raf.write(this.update); + } + } + +} + +function getAnimatedState(props, host) { + const dependencies = new Set(); + TreeContext.dependencies = dependencies; + if (props.style) props = react_spring_animated_esm_extends({}, props, { + style: host.createAnimatedStyle(props.style) + }); + props = new AnimatedObject(props); + TreeContext.dependencies = null; + return [props, dependencies]; +} + +function updateRef(ref, value) { + if (ref) { + if (react_spring_shared_esm_is.fun(ref)) ref(value);else ref.current = value; + } + + return value; +} + +const cacheKey = Symbol.for('AnimatedComponent'); +const createHost = (components, { + applyAnimatedValues: _applyAnimatedValues = () => false, + createAnimatedStyle: _createAnimatedStyle = style => new AnimatedObject(style), + getComponentProps: _getComponentProps = props => props +} = {}) => { + const hostConfig = { + applyAnimatedValues: _applyAnimatedValues, + createAnimatedStyle: _createAnimatedStyle, + getComponentProps: _getComponentProps + }; + + const animated = Component => { + const displayName = getDisplayName(Component) || 'Anonymous'; + + if (react_spring_shared_esm_is.str(Component)) { + Component = animated[Component] || (animated[Component] = withAnimated(Component, hostConfig)); + } else { + Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig)); + } + + Component.displayName = `Animated(${displayName})`; + return Component; + }; + + eachProp(components, (Component, key) => { + if (react_spring_shared_esm_is.arr(components)) { + key = getDisplayName(Component); + } + + animated[key] = animated(Component); + }); + return { + animated + }; +}; + +const getDisplayName = arg => react_spring_shared_esm_is.str(arg) ? arg : arg && react_spring_shared_esm_is.str(arg.displayName) ? arg.displayName : react_spring_shared_esm_is.fun(arg) && arg.name || null; + + + +;// CONCATENATED MODULE: ./node_modules/@react-spring/core/dist/react-spring-core.esm.js + + + + + + + + +function react_spring_core_esm_extends() { + react_spring_core_esm_extends = Object.assign || 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 target; + }; + + return react_spring_core_esm_extends.apply(this, arguments); +} + +function callProp(value, ...args) { + return react_spring_shared_esm_is.fun(value) ? value(...args) : value; +} +const matchProp = (value, key) => value === true || !!(key && value && (react_spring_shared_esm_is.fun(value) ? value(key) : react_spring_shared_esm_toArray(value).includes(key))); +const resolveProp = (prop, key) => react_spring_shared_esm_is.obj(prop) ? key && prop[key] : prop; +const getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : undefined; + +const noopTransform = value => value; + +const getDefaultProps = (props, transform = noopTransform) => { + let keys = DEFAULT_PROPS; + + if (props.default && props.default !== true) { + props = props.default; + keys = Object.keys(props); + } + + const defaults = {}; + + for (const key of keys) { + const value = transform(props[key], key); + + if (!react_spring_shared_esm_is.und(value)) { + defaults[key] = value; + } + } + + return defaults; +}; +const DEFAULT_PROPS = ['config', 'onProps', 'onStart', 'onChange', 'onPause', 'onResume', 'onRest']; +const RESERVED_PROPS = { + 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 getForwardProps(props) { + const forward = {}; + let count = 0; + eachProp(props, (value, prop) => { + if (!RESERVED_PROPS[prop]) { + forward[prop] = value; + count++; + } + }); + + if (count) { + return forward; + } +} + +function inferTo(props) { + const to = getForwardProps(props); + + if (to) { + const out = { + to + }; + eachProp(props, (val, key) => key in to || (out[key] = val)); + return out; + } + + return react_spring_core_esm_extends({}, props); +} +function computeGoal(value) { + value = getFluidValue(value); + return react_spring_shared_esm_is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) ? globals.createStringInterpolator({ + range: [0, 1], + output: [value, value] + })(1) : value; +} +function hasProps(props) { + for (const _ in props) return true; + + return false; +} +function isAsyncTo(to) { + return react_spring_shared_esm_is.fun(to) || react_spring_shared_esm_is.arr(to) && react_spring_shared_esm_is.obj(to[0]); +} +function detachRefs(ctrl, ref) { + var _ctrl$ref; + + (_ctrl$ref = ctrl.ref) == null ? void 0 : _ctrl$ref.delete(ctrl); + ref == null ? void 0 : ref.delete(ctrl); +} +function replaceRef(ctrl, ref) { + if (ref && ctrl.ref !== ref) { + var _ctrl$ref2; + + (_ctrl$ref2 = ctrl.ref) == null ? void 0 : _ctrl$ref2.delete(ctrl); + ref.add(ctrl); + ctrl.ref = ref; + } +} + +function useChain(refs, timeSteps, timeFrame = 1000) { + useLayoutEffect(() => { + if (timeSteps) { + let prevDelay = 0; + each(refs, (ref, i) => { + const controllers = ref.current; + + if (controllers.length) { + let delay = timeFrame * timeSteps[i]; + if (isNaN(delay)) delay = prevDelay;else prevDelay = delay; + each(controllers, ctrl => { + each(ctrl.queue, props => { + const memoizedDelayProp = props.delay; + + props.delay = key => delay + callProp(memoizedDelayProp || 0, key); + }); + }); + ref.start(); + } + }); + } else { + let p = Promise.resolve(); + each(refs, ref => { + const controllers = ref.current; + + if (controllers.length) { + const queues = controllers.map(ctrl => { + const q = ctrl.queue; + ctrl.queue = []; + return q; + }); + p = p.then(() => { + each(controllers, (ctrl, i) => each(queues[i] || [], update => ctrl.queue.push(update))); + return Promise.all(ref.start()); + }); + } + }); + } + }); +} + +const config = { + default: { + tension: 170, + friction: 26 + }, + gentle: { + tension: 120, + friction: 14 + }, + wobbly: { + tension: 180, + friction: 12 + }, + stiff: { + tension: 210, + friction: 20 + }, + slow: { + tension: 280, + friction: 60 + }, + molasses: { + tension: 280, + friction: 120 + } +}; +const c1 = 1.70158; +const c2 = c1 * 1.525; +const c3 = c1 + 1; +const c4 = 2 * Math.PI / 3; +const c5 = 2 * Math.PI / 4.5; + +const bounceOut = x => { + const n1 = 7.5625; + const d1 = 2.75; + + if (x < 1 / d1) { + return n1 * x * x; + } else if (x < 2 / d1) { + return n1 * (x -= 1.5 / d1) * x + 0.75; + } else if (x < 2.5 / d1) { + return n1 * (x -= 2.25 / d1) * x + 0.9375; + } else { + return n1 * (x -= 2.625 / d1) * x + 0.984375; + } +}; + +const easings = { + linear: x => x, + easeInQuad: x => x * x, + easeOutQuad: x => 1 - (1 - x) * (1 - x), + easeInOutQuad: x => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2, + easeInCubic: x => x * x * x, + easeOutCubic: x => 1 - Math.pow(1 - x, 3), + easeInOutCubic: x => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2, + easeInQuart: x => x * x * x * x, + easeOutQuart: x => 1 - Math.pow(1 - x, 4), + easeInOutQuart: x => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2, + easeInQuint: x => x * x * x * x * x, + easeOutQuint: x => 1 - Math.pow(1 - x, 5), + easeInOutQuint: x => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2, + easeInSine: x => 1 - Math.cos(x * Math.PI / 2), + easeOutSine: x => Math.sin(x * Math.PI / 2), + easeInOutSine: x => -(Math.cos(Math.PI * x) - 1) / 2, + easeInExpo: x => x === 0 ? 0 : Math.pow(2, 10 * x - 10), + easeOutExpo: x => x === 1 ? 1 : 1 - Math.pow(2, -10 * x), + easeInOutExpo: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2, + easeInCirc: x => 1 - Math.sqrt(1 - Math.pow(x, 2)), + easeOutCirc: x => Math.sqrt(1 - Math.pow(x - 1, 2)), + easeInOutCirc: x => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2, + easeInBack: x => c3 * x * x * x - c1 * x * x, + easeOutBack: x => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2), + easeInOutBack: x => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2, + easeInElastic: x => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4), + easeOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1, + easeInOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1, + easeInBounce: x => 1 - bounceOut(1 - x), + easeOutBounce: bounceOut, + easeInOutBounce: x => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2 +}; + +const defaults = react_spring_core_esm_extends({}, config.default, { + mass: 1, + damping: 1, + easing: easings.linear, + clamp: false +}); + +class AnimationConfig { + constructor() { + this.tension = void 0; + this.friction = void 0; + this.frequency = void 0; + this.damping = void 0; + this.mass = void 0; + this.velocity = 0; + this.restVelocity = void 0; + this.precision = void 0; + this.progress = void 0; + this.duration = void 0; + this.easing = void 0; + this.clamp = void 0; + this.bounce = void 0; + this.decay = void 0; + this.round = void 0; + Object.assign(this, defaults); + } + +} +function mergeConfig(config, newConfig, defaultConfig) { + if (defaultConfig) { + defaultConfig = react_spring_core_esm_extends({}, defaultConfig); + sanitizeConfig(defaultConfig, newConfig); + newConfig = react_spring_core_esm_extends({}, defaultConfig, newConfig); + } + + sanitizeConfig(config, newConfig); + Object.assign(config, newConfig); + + for (const key in defaults) { + if (config[key] == null) { + config[key] = defaults[key]; + } + } + + let { + mass, + frequency, + damping + } = config; + + if (!react_spring_shared_esm_is.und(frequency)) { + if (frequency < 0.01) frequency = 0.01; + if (damping < 0) damping = 0; + config.tension = Math.pow(2 * Math.PI / frequency, 2) * mass; + config.friction = 4 * Math.PI * damping * mass / frequency; + } + + return config; +} + +function sanitizeConfig(config, props) { + if (!react_spring_shared_esm_is.und(props.decay)) { + config.duration = undefined; + } else { + const isTensionConfig = !react_spring_shared_esm_is.und(props.tension) || !react_spring_shared_esm_is.und(props.friction); + + if (isTensionConfig || !react_spring_shared_esm_is.und(props.frequency) || !react_spring_shared_esm_is.und(props.damping) || !react_spring_shared_esm_is.und(props.mass)) { + config.duration = undefined; + config.decay = undefined; + } + + if (isTensionConfig) { + config.frequency = undefined; + } + } +} + +const emptyArray = []; +class Animation { + constructor() { + this.changed = false; + this.values = emptyArray; + this.toValues = null; + this.fromValues = emptyArray; + this.to = void 0; + this.from = void 0; + this.config = new AnimationConfig(); + this.immediate = false; + } + +} + +function scheduleProps(callId, { + key, + props, + defaultProps, + state, + actions +}) { + return new Promise((resolve, reject) => { + var _props$cancel; + + let delay; + let timeout; + let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key); + + if (cancel) { + onStart(); + } else { + if (!react_spring_shared_esm_is.und(props.pause)) { + state.paused = matchProp(props.pause, key); + } + + let pause = defaultProps == null ? void 0 : defaultProps.pause; + + if (pause !== true) { + pause = state.paused || matchProp(pause, key); + } + + delay = callProp(props.delay || 0, key); + + if (pause) { + state.resumeQueue.add(onResume); + actions.pause(); + } else { + actions.resume(); + onResume(); + } + } + + function onPause() { + state.resumeQueue.add(onResume); + state.timeouts.delete(timeout); + timeout.cancel(); + delay = timeout.time - raf.now(); + } + + function onResume() { + if (delay > 0 && !globals.skipAnimation) { + state.delayed = true; + timeout = raf.setTimeout(onStart, delay); + state.pauseQueue.add(onPause); + state.timeouts.add(timeout); + } else { + onStart(); + } + } + + function onStart() { + if (state.delayed) { + state.delayed = false; + } + + state.pauseQueue.delete(onPause); + state.timeouts.delete(timeout); + + if (callId <= (state.cancelId || 0)) { + cancel = true; + } + + try { + actions.start(react_spring_core_esm_extends({}, props, { + callId, + cancel + }), resolve); + } catch (err) { + reject(err); + } + } + }); +} + +const getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some(result => result.cancelled) ? getCancelledResult(target.get()) : results.every(result => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every(result => result.finished)); +const getNoopResult = value => ({ + value, + noop: true, + finished: true, + cancelled: false +}); +const getFinishedResult = (value, finished, cancelled = false) => ({ + value, + finished, + cancelled +}); +const getCancelledResult = value => ({ + value, + cancelled: true, + finished: false +}); + +function runAsync(to, props, state, target) { + const { + callId, + parentId, + onRest + } = props; + const { + asyncTo: prevTo, + promise: prevPromise + } = state; + + if (!parentId && to === prevTo && !props.reset) { + return prevPromise; + } + + return state.promise = (async () => { + state.asyncId = callId; + state.asyncTo = to; + const defaultProps = getDefaultProps(props, (value, key) => key === 'onRest' ? undefined : value); + let preventBail; + let bail; + const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject)); + + const bailIfEnded = bailSignal => { + const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false); + + if (bailResult) { + bailSignal.result = bailResult; + bail(bailSignal); + throw bailSignal; + } + }; + + const animate = (arg1, arg2) => { + const bailSignal = new BailSignal(); + const skipAnimationSignal = new SkipAniamtionSignal(); + return (async () => { + if (globals.skipAnimation) { + stopAsync(state); + skipAnimationSignal.result = getFinishedResult(target, false); + bail(skipAnimationSignal); + throw skipAnimationSignal; + } + + bailIfEnded(bailSignal); + const props = react_spring_shared_esm_is.obj(arg1) ? react_spring_core_esm_extends({}, arg1) : react_spring_core_esm_extends({}, arg2, { + to: arg1 + }); + props.parentId = callId; + eachProp(defaultProps, (value, key) => { + if (react_spring_shared_esm_is.und(props[key])) { + props[key] = value; + } + }); + const result = await target.start(props); + bailIfEnded(bailSignal); + + if (state.paused) { + await new Promise(resume => { + state.resumeQueue.add(resume); + }); + } + + return result; + })(); + }; + + let result; + + if (globals.skipAnimation) { + stopAsync(state); + return getFinishedResult(target, false); + } + + try { + let animating; + + if (react_spring_shared_esm_is.arr(to)) { + animating = (async queue => { + for (const props of queue) { + await animate(props); + } + })(to); + } else { + animating = Promise.resolve(to(animate, target.stop.bind(target))); + } + + await Promise.all([animating.then(preventBail), bailPromise]); + result = getFinishedResult(target.get(), true, false); + } catch (err) { + if (err instanceof BailSignal) { + result = err.result; + } else if (err instanceof SkipAniamtionSignal) { + result = err.result; + } else { + throw err; + } + } finally { + if (callId == state.asyncId) { + state.asyncId = parentId; + state.asyncTo = parentId ? prevTo : undefined; + state.promise = parentId ? prevPromise : undefined; + } + } + + if (react_spring_shared_esm_is.fun(onRest)) { + raf.batchedUpdates(() => { + onRest(result, target, target.item); + }); + } + + return result; + })(); +} +function stopAsync(state, cancelId) { + flush(state.timeouts, t => t.cancel()); + state.pauseQueue.clear(); + state.resumeQueue.clear(); + state.asyncId = state.asyncTo = state.promise = undefined; + if (cancelId) state.cancelId = cancelId; +} +class BailSignal extends Error { + constructor() { + super('An async animation has been interrupted. You see this error because you ' + 'forgot to use `await` or `.catch(...)` on its returned promise.'); + this.result = void 0; + } + +} +class SkipAniamtionSignal extends Error { + constructor() { + super('SkipAnimationSignal'); + this.result = void 0; + } + +} + +const isFrameValue = value => value instanceof FrameValue; +let nextId$1 = 1; +class FrameValue extends FluidValue { + constructor(...args) { + super(...args); + this.id = nextId$1++; + this.key = void 0; + this._priority = 0; + } + + get priority() { + return this._priority; + } + + set priority(priority) { + if (this._priority != priority) { + this._priority = priority; + + this._onPriorityChange(priority); + } + } + + get() { + const node = getAnimated(this); + return node && node.getValue(); + } + + to(...args) { + return globals.to(this, args); + } + + interpolate(...args) { + react_spring_shared_esm_deprecateInterpolate(); + return globals.to(this, args); + } + + toJSON() { + return this.get(); + } + + observerAdded(count) { + if (count == 1) this._attach(); + } + + observerRemoved(count) { + if (count == 0) this._detach(); + } + + _attach() {} + + _detach() {} + + _onChange(value, idle = false) { + callFluidObservers(this, { + type: 'change', + parent: this, + value, + idle + }); + } + + _onPriorityChange(priority) { + if (!this.idle) { + frameLoop.sort(this); + } + + callFluidObservers(this, { + type: 'priority', + parent: this, + priority + }); + } + +} + +const $P = Symbol.for('SpringPhase'); +const HAS_ANIMATED = 1; +const IS_ANIMATING = 2; +const IS_PAUSED = 4; +const hasAnimated = target => (target[$P] & HAS_ANIMATED) > 0; +const isAnimating = target => (target[$P] & IS_ANIMATING) > 0; +const isPaused = target => (target[$P] & IS_PAUSED) > 0; +const setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING; +const setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED; + +class SpringValue extends FrameValue { + constructor(arg1, arg2) { + super(); + this.key = void 0; + this.animation = new Animation(); + this.queue = void 0; + this.defaultProps = {}; + this._state = { + paused: false, + delayed: false, + pauseQueue: new Set(), + resumeQueue: new Set(), + timeouts: new Set() + }; + this._pendingCalls = new Set(); + this._lastCallId = 0; + this._lastToId = 0; + this._memoizedDuration = 0; + + if (!react_spring_shared_esm_is.und(arg1) || !react_spring_shared_esm_is.und(arg2)) { + const props = react_spring_shared_esm_is.obj(arg1) ? react_spring_core_esm_extends({}, arg1) : react_spring_core_esm_extends({}, arg2, { + from: arg1 + }); + + if (react_spring_shared_esm_is.und(props.default)) { + props.default = true; + } + + this.start(props); + } + } + + get idle() { + return !(isAnimating(this) || this._state.asyncTo) || isPaused(this); + } + + get goal() { + return getFluidValue(this.animation.to); + } + + get velocity() { + const node = getAnimated(this); + return node instanceof AnimatedValue ? node.lastVelocity || 0 : node.getPayload().map(node => node.lastVelocity || 0); + } + + get hasAnimated() { + return hasAnimated(this); + } + + get isAnimating() { + return isAnimating(this); + } + + get isPaused() { + return isPaused(this); + } + + get isDelayed() { + return this._state.delayed; + } + + advance(dt) { + let idle = true; + let changed = false; + const anim = this.animation; + let { + config, + toValues + } = anim; + const payload = getPayload(anim.to); + + if (!payload && hasFluidValue(anim.to)) { + toValues = react_spring_shared_esm_toArray(getFluidValue(anim.to)); + } + + anim.values.forEach((node, i) => { + if (node.done) return; + const to = node.constructor == AnimatedString ? 1 : payload ? payload[i].lastPosition : toValues[i]; + let finished = anim.immediate; + let position = to; + + if (!finished) { + position = node.lastPosition; + + if (config.tension <= 0) { + node.done = true; + return; + } + + let elapsed = node.elapsedTime += dt; + const from = anim.fromValues[i]; + const v0 = node.v0 != null ? node.v0 : node.v0 = react_spring_shared_esm_is.arr(config.velocity) ? config.velocity[i] : config.velocity; + let velocity; + + if (!react_spring_shared_esm_is.und(config.duration)) { + let p = 1; + + if (config.duration > 0) { + if (this._memoizedDuration !== config.duration) { + this._memoizedDuration = config.duration; + + if (node.durationProgress > 0) { + node.elapsedTime = config.duration * node.durationProgress; + elapsed = node.elapsedTime += dt; + } + } + + p = (config.progress || 0) + elapsed / this._memoizedDuration; + p = p > 1 ? 1 : p < 0 ? 0 : p; + node.durationProgress = p; + } + + position = from + config.easing(p) * (to - from); + velocity = (position - node.lastPosition) / dt; + finished = p == 1; + } else if (config.decay) { + const decay = config.decay === true ? 0.998 : config.decay; + const e = Math.exp(-(1 - decay) * elapsed); + position = from + v0 / (1 - decay) * (1 - e); + finished = Math.abs(node.lastPosition - position) < 0.1; + velocity = v0 * e; + } else { + velocity = node.lastVelocity == null ? v0 : node.lastVelocity; + const precision = config.precision || (from == to ? 0.005 : Math.min(1, Math.abs(to - from) * 0.001)); + const restVelocity = config.restVelocity || precision / 10; + const bounceFactor = config.clamp ? 0 : config.bounce; + const canBounce = !react_spring_shared_esm_is.und(bounceFactor); + const isGrowing = from == to ? node.v0 > 0 : from < to; + let isMoving; + let isBouncing = false; + const step = 1; + const numSteps = Math.ceil(dt / step); + + for (let n = 0; n < numSteps; ++n) { + isMoving = Math.abs(velocity) > restVelocity; + + if (!isMoving) { + finished = Math.abs(to - position) <= precision; + + if (finished) { + break; + } + } + + if (canBounce) { + isBouncing = position == to || position > to == isGrowing; + + if (isBouncing) { + velocity = -velocity * bounceFactor; + position = to; + } + } + + const springForce = -config.tension * 0.000001 * (position - to); + const dampingForce = -config.friction * 0.001 * velocity; + const acceleration = (springForce + dampingForce) / config.mass; + velocity = velocity + acceleration * step; + position = position + velocity * step; + } + } + + node.lastVelocity = velocity; + + if (Number.isNaN(position)) { + console.warn(`Got NaN while animating:`, this); + finished = true; + } + } + + if (payload && !payload[i].done) { + finished = false; + } + + if (finished) { + node.done = true; + } else { + idle = false; + } + + if (node.setValue(position, config.round)) { + changed = true; + } + }); + const node = getAnimated(this); + const currVal = node.getValue(); + + if (idle) { + const finalVal = getFluidValue(anim.to); + + if ((currVal !== finalVal || changed) && !config.decay) { + node.setValue(finalVal); + + this._onChange(finalVal); + } else if (changed && config.decay) { + this._onChange(currVal); + } + + this._stop(); + } else if (changed) { + this._onChange(currVal); + } + } + + set(value) { + raf.batchedUpdates(() => { + this._stop(); + + this._focus(value); + + this._set(value); + }); + return this; + } + + pause() { + this._update({ + pause: true + }); + } + + resume() { + this._update({ + pause: false + }); + } + + finish() { + if (isAnimating(this)) { + const { + to, + config + } = this.animation; + raf.batchedUpdates(() => { + this._onStart(); + + if (!config.decay) { + this._set(to, false); + } + + this._stop(); + }); + } + + return this; + } + + update(props) { + const queue = this.queue || (this.queue = []); + queue.push(props); + return this; + } + + start(to, arg2) { + let queue; + + if (!react_spring_shared_esm_is.und(to)) { + queue = [react_spring_shared_esm_is.obj(to) ? to : react_spring_core_esm_extends({}, arg2, { + to + })]; + } else { + queue = this.queue || []; + this.queue = []; + } + + return Promise.all(queue.map(props => { + const up = this._update(props); + + return up; + })).then(results => getCombinedResult(this, results)); + } + + stop(cancel) { + const { + to + } = this.animation; + + this._focus(this.get()); + + stopAsync(this._state, cancel && this._lastCallId); + raf.batchedUpdates(() => this._stop(to, cancel)); + return this; + } + + reset() { + this._update({ + reset: true + }); + } + + eventObserved(event) { + if (event.type == 'change') { + this._start(); + } else if (event.type == 'priority') { + this.priority = event.priority + 1; + } + } + + _prepareNode(props) { + const key = this.key || ''; + let { + to, + from + } = props; + to = react_spring_shared_esm_is.obj(to) ? to[key] : to; + + if (to == null || isAsyncTo(to)) { + to = undefined; + } + + from = react_spring_shared_esm_is.obj(from) ? from[key] : from; + + if (from == null) { + from = undefined; + } + + const range = { + to, + from + }; + + if (!hasAnimated(this)) { + if (props.reverse) [to, from] = [from, to]; + from = getFluidValue(from); + + if (!react_spring_shared_esm_is.und(from)) { + this._set(from); + } else if (!getAnimated(this)) { + this._set(to); + } + } + + return range; + } + + _update(_ref, isLoop) { + let props = react_spring_core_esm_extends({}, _ref); + + const { + key, + defaultProps + } = this; + if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value)); + mergeActiveFn(this, props, 'onProps'); + sendEvent(this, 'onProps', props, this); + + const range = this._prepareNode(props); + + 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?'); + } + + const state = this._state; + return scheduleProps(++this._lastCallId, { + key, + props, + defaultProps, + state, + actions: { + pause: () => { + if (!isPaused(this)) { + setPausedBit(this, true); + flushCalls(state.pauseQueue); + sendEvent(this, 'onPause', getFinishedResult(this, checkFinished(this, this.animation.to)), this); + } + }, + resume: () => { + if (isPaused(this)) { + setPausedBit(this, false); + + if (isAnimating(this)) { + this._resume(); + } + + flushCalls(state.resumeQueue); + sendEvent(this, 'onResume', getFinishedResult(this, checkFinished(this, this.animation.to)), this); + } + }, + start: this._merge.bind(this, range) + } + }).then(result => { + if (props.loop && result.finished && !(isLoop && result.noop)) { + const nextProps = createLoopUpdate(props); + + if (nextProps) { + return this._update(nextProps, true); + } + } + + return result; + }); + } + + _merge(range, props, resolve) { + if (props.cancel) { + this.stop(true); + return resolve(getCancelledResult(this)); + } + + const hasToProp = !react_spring_shared_esm_is.und(range.to); + const hasFromProp = !react_spring_shared_esm_is.und(range.from); + + if (hasToProp || hasFromProp) { + if (props.callId > this._lastToId) { + this._lastToId = props.callId; + } else { + return resolve(getCancelledResult(this)); + } + } + + const { + key, + defaultProps, + animation: anim + } = this; + const { + to: prevTo, + from: prevFrom + } = anim; + let { + to = prevTo, + from = prevFrom + } = range; + + if (hasFromProp && !hasToProp && (!props.default || react_spring_shared_esm_is.und(to))) { + to = from; + } + + if (props.reverse) [to, from] = [from, to]; + const hasFromChanged = !isEqual(from, prevFrom); + + if (hasFromChanged) { + anim.from = from; + } + + from = getFluidValue(from); + const hasToChanged = !isEqual(to, prevTo); + + if (hasToChanged) { + this._focus(to); + } + + const hasAsyncTo = isAsyncTo(props.to); + const { + config + } = anim; + const { + decay, + velocity + } = config; + + if (hasToProp || hasFromProp) { + config.velocity = 0; + } + + if (props.config && !hasAsyncTo) { + mergeConfig(config, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0); + } + + let node = getAnimated(this); + + if (!node || react_spring_shared_esm_is.und(to)) { + return resolve(getFinishedResult(this, true)); + } + + const reset = react_spring_shared_esm_is.und(props.reset) ? hasFromProp && !props.default : !react_spring_shared_esm_is.und(from) && matchProp(props.reset, key); + const value = reset ? from : this.get(); + const goal = computeGoal(to); + const isAnimatable = react_spring_shared_esm_is.num(goal) || react_spring_shared_esm_is.arr(goal) || isAnimatedString(goal); + const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key)); + + if (hasToChanged) { + const nodeType = getAnimatedType(to); + + if (nodeType !== node.constructor) { + if (immediate) { + node = this._set(goal); + } else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`); + } + } + + const goalType = node.constructor; + let started = hasFluidValue(to); + let finished = false; + + if (!started) { + const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged; + + if (hasToChanged || hasValueChanged) { + finished = isEqual(computeGoal(value), goal); + started = !finished; + } + + if (!isEqual(anim.immediate, immediate) && !immediate || !isEqual(config.decay, decay) || !isEqual(config.velocity, velocity)) { + started = true; + } + } + + if (finished && isAnimating(this)) { + if (anim.changed && !reset) { + started = true; + } else if (!started) { + this._stop(prevTo); + } + } + + if (!hasAsyncTo) { + if (started || hasFluidValue(prevTo)) { + anim.values = node.getPayload(); + anim.toValues = hasFluidValue(to) ? null : goalType == AnimatedString ? [1] : react_spring_shared_esm_toArray(goal); + } + + if (anim.immediate != immediate) { + anim.immediate = immediate; + + if (!immediate && !reset) { + this._set(prevTo); + } + } + + if (started) { + const { + onRest + } = anim; + react_spring_shared_esm_each(ACTIVE_EVENTS, type => mergeActiveFn(this, props, type)); + const result = getFinishedResult(this, checkFinished(this, prevTo)); + flushCalls(this._pendingCalls, result); + + this._pendingCalls.add(resolve); + + if (anim.changed) raf.batchedUpdates(() => { + anim.changed = !reset; + onRest == null ? void 0 : onRest(result, this); + + if (reset) { + callProp(defaultProps.onRest, result); + } else { + anim.onStart == null ? void 0 : anim.onStart(result, this); + } + }); + } + } + + if (reset) { + this._set(value); + } + + if (hasAsyncTo) { + resolve(runAsync(props.to, props, this._state, this)); + } else if (started) { + this._start(); + } else if (isAnimating(this) && !hasToChanged) { + this._pendingCalls.add(resolve); + } else { + resolve(getNoopResult(value)); + } + } + + _focus(value) { + const anim = this.animation; + + if (value !== anim.to) { + if (getFluidObservers(this)) { + this._detach(); + } + + anim.to = value; + + if (getFluidObservers(this)) { + this._attach(); + } + } + } + + _attach() { + let priority = 0; + const { + to + } = this.animation; + + if (hasFluidValue(to)) { + addFluidObserver(to, this); + + if (isFrameValue(to)) { + priority = to.priority + 1; + } + } + + this.priority = priority; + } + + _detach() { + const { + to + } = this.animation; + + if (hasFluidValue(to)) { + removeFluidObserver(to, this); + } + } + + _set(arg, idle = true) { + const value = getFluidValue(arg); + + if (!react_spring_shared_esm_is.und(value)) { + const oldNode = getAnimated(this); + + if (!oldNode || !isEqual(value, oldNode.getValue())) { + const nodeType = getAnimatedType(value); + + if (!oldNode || oldNode.constructor != nodeType) { + setAnimated(this, nodeType.create(value)); + } else { + oldNode.setValue(value); + } + + if (oldNode) { + raf.batchedUpdates(() => { + this._onChange(value, idle); + }); + } + } + } + + return getAnimated(this); + } + + _onStart() { + const anim = this.animation; + + if (!anim.changed) { + anim.changed = true; + sendEvent(this, 'onStart', getFinishedResult(this, checkFinished(this, anim.to)), this); + } + } + + _onChange(value, idle) { + if (!idle) { + this._onStart(); + + callProp(this.animation.onChange, value, this); + } + + callProp(this.defaultProps.onChange, value, this); + + super._onChange(value, idle); + } + + _start() { + const anim = this.animation; + getAnimated(this).reset(getFluidValue(anim.to)); + + if (!anim.immediate) { + anim.fromValues = anim.values.map(node => node.lastPosition); + } + + if (!isAnimating(this)) { + setActiveBit(this, true); + + if (!isPaused(this)) { + this._resume(); + } + } + } + + _resume() { + if (globals.skipAnimation) { + this.finish(); + } else { + frameLoop.start(this); + } + } + + _stop(goal, cancel) { + if (isAnimating(this)) { + setActiveBit(this, false); + const anim = this.animation; + react_spring_shared_esm_each(anim.values, node => { + node.done = true; + }); + + if (anim.toValues) { + anim.onChange = anim.onPause = anim.onResume = undefined; + } + + callFluidObservers(this, { + type: 'idle', + parent: this + }); + const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to)); + flushCalls(this._pendingCalls, result); + + if (anim.changed) { + anim.changed = false; + sendEvent(this, 'onRest', result, this); + } + } + } + +} + +function checkFinished(target, to) { + const goal = computeGoal(to); + const value = computeGoal(target.get()); + return isEqual(value, goal); +} + +function createLoopUpdate(props, loop = props.loop, to = props.to) { + let loopRet = callProp(loop); + + if (loopRet) { + const overrides = loopRet !== true && inferTo(loopRet); + const reverse = (overrides || props).reverse; + const reset = !overrides || overrides.reset; + return createUpdate(react_spring_core_esm_extends({}, props, { + loop, + default: false, + pause: undefined, + to: !reverse || isAsyncTo(to) ? to : undefined, + from: reset ? props.from : undefined, + reset + }, overrides)); + } +} +function createUpdate(props) { + const { + to, + from + } = props = inferTo(props); + const keys = new Set(); + if (react_spring_shared_esm_is.obj(to)) findDefined(to, keys); + if (react_spring_shared_esm_is.obj(from)) findDefined(from, keys); + props.keys = keys.size ? Array.from(keys) : null; + return props; +} +function declareUpdate(props) { + const update = createUpdate(props); + + if (react_spring_shared_esm_is.und(update.default)) { + update.default = getDefaultProps(update); + } + + return update; +} + +function findDefined(values, keys) { + eachProp(values, (value, key) => value != null && keys.add(key)); +} + +const ACTIVE_EVENTS = ['onStart', 'onRest', 'onChange', 'onPause', 'onResume']; + +function mergeActiveFn(target, props, type) { + target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : undefined; +} + +function sendEvent(target, type, ...args) { + var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps; + + (_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args); + (_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args); +} + +const BATCHED_EVENTS = ['onStart', 'onChange', 'onRest']; +let nextId = 1; +class Controller { + constructor(props, flush) { + this.id = nextId++; + this.springs = {}; + this.queue = []; + this.ref = void 0; + this._flush = void 0; + this._initialProps = void 0; + this._lastAsyncId = 0; + this._active = new Set(); + this._changed = new Set(); + this._started = false; + this._item = void 0; + this._state = { + paused: false, + pauseQueue: new Set(), + resumeQueue: new Set(), + timeouts: new Set() + }; + this._events = { + onStart: new Map(), + onChange: new Map(), + onRest: new Map() + }; + this._onFrame = this._onFrame.bind(this); + + if (flush) { + this._flush = flush; + } + + if (props) { + this.start(react_spring_core_esm_extends({ + default: true + }, props)); + } + } + + get idle() { + return !this._state.asyncTo && Object.values(this.springs).every(spring => { + return spring.idle && !spring.isDelayed && !spring.isPaused; + }); + } + + get item() { + return this._item; + } + + set item(item) { + this._item = item; + } + + get() { + const values = {}; + this.each((spring, key) => values[key] = spring.get()); + return values; + } + + set(values) { + for (const key in values) { + const value = values[key]; + + if (!react_spring_shared_esm_is.und(value)) { + this.springs[key].set(value); + } + } + } + + update(props) { + if (props) { + this.queue.push(createUpdate(props)); + } + + return this; + } + + start(props) { + let { + queue + } = this; + + if (props) { + queue = react_spring_shared_esm_toArray(props).map(createUpdate); + } else { + this.queue = []; + } + + if (this._flush) { + return this._flush(this, queue); + } + + prepareKeys(this, queue); + return flushUpdateQueue(this, queue); + } + + stop(arg, keys) { + if (arg !== !!arg) { + keys = arg; + } + + if (keys) { + const springs = this.springs; + react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys), key => springs[key].stop(!!arg)); + } else { + stopAsync(this._state, this._lastAsyncId); + this.each(spring => spring.stop(!!arg)); + } + + return this; + } + + pause(keys) { + if (react_spring_shared_esm_is.und(keys)) { + this.start({ + pause: true + }); + } else { + const springs = this.springs; + react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys), key => springs[key].pause()); + } + + return this; + } + + resume(keys) { + if (react_spring_shared_esm_is.und(keys)) { + this.start({ + pause: false + }); + } else { + const springs = this.springs; + react_spring_shared_esm_each(react_spring_shared_esm_toArray(keys), key => springs[key].resume()); + } + + return this; + } + + each(iterator) { + eachProp(this.springs, iterator); + } + + _onFrame() { + const { + onStart, + onChange, + onRest + } = this._events; + const active = this._active.size > 0; + const changed = this._changed.size > 0; + + if (active && !this._started || changed && !this._started) { + this._started = true; + flush(onStart, ([onStart, result]) => { + result.value = this.get(); + onStart(result, this, this._item); + }); + } + + const idle = !active && this._started; + const values = changed || idle && onRest.size ? this.get() : null; + + if (changed && onChange.size) { + flush(onChange, ([onChange, result]) => { + result.value = values; + onChange(result, this, this._item); + }); + } + + if (idle) { + this._started = false; + flush(onRest, ([onRest, result]) => { + result.value = values; + onRest(result, this, this._item); + }); + } + } + + eventObserved(event) { + if (event.type == 'change') { + this._changed.add(event.parent); + + if (!event.idle) { + this._active.add(event.parent); + } + } else if (event.type == 'idle') { + this._active.delete(event.parent); + } else return; + + raf.onFrame(this._onFrame); + } + +} +function flushUpdateQueue(ctrl, queue) { + return Promise.all(queue.map(props => flushUpdate(ctrl, props))).then(results => getCombinedResult(ctrl, results)); +} +async function flushUpdate(ctrl, props, isLoop) { + const { + keys, + to, + from, + loop, + onRest, + onResolve + } = props; + const defaults = react_spring_shared_esm_is.obj(props.default) && props.default; + + if (loop) { + props.loop = false; + } + + if (to === false) props.to = null; + if (from === false) props.from = null; + const asyncTo = react_spring_shared_esm_is.arr(to) || react_spring_shared_esm_is.fun(to) ? to : undefined; + + if (asyncTo) { + props.to = undefined; + props.onRest = undefined; + + if (defaults) { + defaults.onRest = undefined; + } + } else { + react_spring_shared_esm_each(BATCHED_EVENTS, key => { + const handler = props[key]; + + if (react_spring_shared_esm_is.fun(handler)) { + const queue = ctrl['_events'][key]; + + props[key] = ({ + finished, + cancelled + }) => { + const result = queue.get(handler); + + if (result) { + if (!finished) result.finished = false; + if (cancelled) result.cancelled = true; + } else { + queue.set(handler, { + value: null, + finished: finished || false, + cancelled: cancelled || false + }); + } + }; + + if (defaults) { + defaults[key] = props[key]; + } + } + }); + } + + const state = ctrl['_state']; + + if (props.pause === !state.paused) { + state.paused = props.pause; + flushCalls(props.pause ? state.pauseQueue : state.resumeQueue); + } else if (state.paused) { + props.pause = true; + } + + const promises = (keys || Object.keys(ctrl.springs)).map(key => ctrl.springs[key].start(props)); + const cancel = props.cancel === true || getDefaultProp(props, 'cancel') === true; + + if (asyncTo || cancel && state.asyncId) { + promises.push(scheduleProps(++ctrl['_lastAsyncId'], { + props, + state, + actions: { + pause: noop, + resume: noop, + + start(props, resolve) { + if (cancel) { + stopAsync(state, ctrl['_lastAsyncId']); + resolve(getCancelledResult(ctrl)); + } else { + props.onRest = onRest; + resolve(runAsync(asyncTo, props, state, ctrl)); + } + } + + } + })); + } + + if (state.paused) { + await new Promise(resume => { + state.resumeQueue.add(resume); + }); + } + + const result = getCombinedResult(ctrl, await Promise.all(promises)); + + if (loop && result.finished && !(isLoop && result.noop)) { + const nextProps = createLoopUpdate(props, loop, to); + + if (nextProps) { + prepareKeys(ctrl, [nextProps]); + return flushUpdate(ctrl, nextProps, true); + } + } + + if (onResolve) { + raf.batchedUpdates(() => onResolve(result, ctrl, ctrl.item)); + } + + return result; +} +function getSprings(ctrl, props) { + const springs = react_spring_core_esm_extends({}, ctrl.springs); + + if (props) { + react_spring_shared_esm_each(react_spring_shared_esm_toArray(props), props => { + if (react_spring_shared_esm_is.und(props.keys)) { + props = createUpdate(props); + } + + if (!react_spring_shared_esm_is.obj(props.to)) { + props = react_spring_core_esm_extends({}, props, { + to: undefined + }); + } + + prepareSprings(springs, props, key => { + return createSpring(key); + }); + }); + } + + setSprings(ctrl, springs); + return springs; +} +function setSprings(ctrl, springs) { + eachProp(springs, (spring, key) => { + if (!ctrl.springs[key]) { + ctrl.springs[key] = spring; + addFluidObserver(spring, ctrl); + } + }); +} + +function createSpring(key, observer) { + const spring = new SpringValue(); + spring.key = key; + + if (observer) { + addFluidObserver(spring, observer); + } + + return spring; +} + +function prepareSprings(springs, props, create) { + if (props.keys) { + react_spring_shared_esm_each(props.keys, key => { + const spring = springs[key] || (springs[key] = create(key)); + spring['_prepareNode'](props); + }); + } +} + +function prepareKeys(ctrl, queue) { + react_spring_shared_esm_each(queue, props => { + prepareSprings(ctrl.springs, props, key => { + return createSpring(key, ctrl); + }); + }); +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const _excluded$3 = ["children"]; +const SpringContext = _ref => { + let { + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded$3); + + const inherited = (0,external_React_.useContext)(ctx); + const pause = props.pause || !!inherited.pause, + immediate = props.immediate || !!inherited.immediate; + props = useMemoOne(() => ({ + pause, + immediate + }), [pause, immediate]); + const { + Provider + } = ctx; + return external_React_.createElement(Provider, { + value: props + }, children); +}; +const ctx = makeContext(SpringContext, {}); +SpringContext.Provider = ctx.Provider; +SpringContext.Consumer = ctx.Consumer; + +function makeContext(target, init) { + Object.assign(target, external_React_.createContext(init)); + target.Provider._context = target; + target.Consumer._context = target; + return target; +} + +const SpringRef = () => { + const current = []; + + const SpringRef = function SpringRef(props) { + deprecateDirectCall(); + const results = []; + react_spring_shared_esm_each(current, (ctrl, i) => { + if (react_spring_shared_esm_is.und(props)) { + results.push(ctrl.start()); + } else { + const update = _getProps(props, ctrl, i); + + if (update) { + results.push(ctrl.start(update)); + } + } + }); + return results; + }; + + SpringRef.current = current; + + SpringRef.add = function (ctrl) { + if (!current.includes(ctrl)) { + current.push(ctrl); + } + }; + + SpringRef.delete = function (ctrl) { + const i = current.indexOf(ctrl); + if (~i) current.splice(i, 1); + }; + + SpringRef.pause = function () { + react_spring_shared_esm_each(current, ctrl => ctrl.pause(...arguments)); + return this; + }; + + SpringRef.resume = function () { + react_spring_shared_esm_each(current, ctrl => ctrl.resume(...arguments)); + return this; + }; + + SpringRef.set = function (values) { + react_spring_shared_esm_each(current, ctrl => ctrl.set(values)); + }; + + SpringRef.start = function (props) { + const results = []; + react_spring_shared_esm_each(current, (ctrl, i) => { + if (react_spring_shared_esm_is.und(props)) { + results.push(ctrl.start()); + } else { + const update = this._getProps(props, ctrl, i); + + if (update) { + results.push(ctrl.start(update)); + } + } + }); + return results; + }; + + SpringRef.stop = function () { + react_spring_shared_esm_each(current, ctrl => ctrl.stop(...arguments)); + return this; + }; + + SpringRef.update = function (props) { + react_spring_shared_esm_each(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i))); + return this; + }; + + const _getProps = function _getProps(arg, ctrl, index) { + return react_spring_shared_esm_is.fun(arg) ? arg(index, ctrl) : arg; + }; + + SpringRef._getProps = _getProps; + return SpringRef; +}; + +function useSprings(length, props, deps) { + const propsFn = react_spring_shared_esm_is.fun(props) && props; + if (propsFn && !deps) deps = []; + const ref = (0,external_React_.useMemo)(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []); + const layoutId = (0,external_React_.useRef)(0); + const forceUpdate = react_spring_shared_esm_useForceUpdate(); + const state = (0,external_React_.useMemo)(() => ({ + ctrls: [], + queue: [], + + flush(ctrl, updates) { + const springs = getSprings(ctrl, updates); + const canFlushSync = layoutId.current > 0 && !state.queue.length && !Object.keys(springs).some(key => !ctrl.springs[key]); + return canFlushSync ? flushUpdateQueue(ctrl, updates) : new Promise(resolve => { + setSprings(ctrl, springs); + state.queue.push(() => { + resolve(flushUpdateQueue(ctrl, updates)); + }); + forceUpdate(); + }); + } + + }), []); + const ctrls = (0,external_React_.useRef)([...state.ctrls]); + const updates = []; + const prevLength = react_spring_shared_esm_usePrev(length) || 0; + (0,external_React_.useMemo)(() => { + react_spring_shared_esm_each(ctrls.current.slice(length, prevLength), ctrl => { + detachRefs(ctrl, ref); + ctrl.stop(true); + }); + ctrls.current.length = length; + declareUpdates(prevLength, length); + }, [length]); + (0,external_React_.useMemo)(() => { + declareUpdates(0, Math.min(prevLength, length)); + }, deps); + + function declareUpdates(startIndex, endIndex) { + for (let i = startIndex; i < endIndex; i++) { + const ctrl = ctrls.current[i] || (ctrls.current[i] = new Controller(null, state.flush)); + const update = propsFn ? propsFn(i, ctrl) : props[i]; + + if (update) { + updates[i] = declareUpdate(update); + } + } + } + + const springs = ctrls.current.map((ctrl, i) => getSprings(ctrl, updates[i])); + const context = (0,external_React_.useContext)(SpringContext); + const prevContext = react_spring_shared_esm_usePrev(context); + const hasContext = context !== prevContext && hasProps(context); + react_spring_shared_esm_useLayoutEffect(() => { + layoutId.current++; + state.ctrls = ctrls.current; + const { + queue + } = state; + + if (queue.length) { + state.queue = []; + react_spring_shared_esm_each(queue, cb => cb()); + } + + react_spring_shared_esm_each(ctrls.current, (ctrl, i) => { + ref == null ? void 0 : ref.add(ctrl); + + if (hasContext) { + ctrl.start({ + default: context + }); + } + + const update = updates[i]; + + if (update) { + replaceRef(ctrl, update.ref); + + if (ctrl.ref) { + ctrl.queue.push(update); + } else { + ctrl.start(update); + } + } + }); + }); + react_spring_shared_esm_useOnce(() => () => { + react_spring_shared_esm_each(state.ctrls, ctrl => ctrl.stop(true)); + }); + const values = springs.map(x => react_spring_core_esm_extends({}, x)); + return ref ? [values, ref] : values; +} + +function useSpring(props, deps) { + const isFn = react_spring_shared_esm_is.fun(props); + const [[values], ref] = useSprings(1, isFn ? props : [props], isFn ? deps || [] : deps); + return isFn || arguments.length == 2 ? [values, ref] : values; +} + +const initSpringRef = () => SpringRef(); + +const useSpringRef = () => useState(initSpringRef)[0]; + +function useTrail(length, propsArg, deps) { + var _passedRef; + + const propsFn = is.fun(propsArg) && propsArg; + if (propsFn && !deps) deps = []; + let reverse = true; + let passedRef = undefined; + const result = useSprings(length, (i, ctrl) => { + const props = propsFn ? propsFn(i, ctrl) : propsArg; + passedRef = props.ref; + reverse = reverse && props.reverse; + return props; + }, deps || [{}]); + const ref = (_passedRef = passedRef) != null ? _passedRef : result[1]; + useLayoutEffect(() => { + each(ref.current, (ctrl, i) => { + const parent = ref.current[i + (reverse ? 1 : -1)]; + + if (parent) { + ctrl.start({ + to: parent.springs + }); + } else { + ctrl.start(); + } + }); + }, deps); + + if (propsFn || arguments.length == 3) { + ref['_getProps'] = (propsArg, ctrl, i) => { + const props = is.fun(propsArg) ? propsArg(i, ctrl) : propsArg; + + if (props) { + const parent = ref.current[i + (props.reverse ? 1 : -1)]; + if (parent) props.to = parent.springs; + return props; + } + }; + + return result; + } + + ref['start'] = propsArg => { + const results = []; + each(ref.current, (ctrl, i) => { + const props = is.fun(propsArg) ? propsArg(i, ctrl) : propsArg; + const parent = ref.current[i + (reverse ? 1 : -1)]; + + if (parent) { + results.push(ctrl.start(react_spring_core_esm_extends({}, props, { + to: parent.springs + }))); + } else { + results.push(ctrl.start(react_spring_core_esm_extends({}, props))); + } + }); + return results; + }; + + return result[0]; +} + +let TransitionPhase; + +(function (TransitionPhase) { + TransitionPhase["MOUNT"] = "mount"; + TransitionPhase["ENTER"] = "enter"; + TransitionPhase["UPDATE"] = "update"; + TransitionPhase["LEAVE"] = "leave"; +})(TransitionPhase || (TransitionPhase = {})); + +function useTransition(data, props, deps) { + const propsFn = is.fun(props) && props; + const { + reset, + sort, + trail = 0, + expires = true, + exitBeforeEnter = false, + onDestroyed, + ref: propsRef, + config: propsConfig + } = propsFn ? propsFn() : props; + const ref = useMemo(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []); + const items = toArray(data); + const transitions = []; + const usedTransitions = useRef(null); + const prevTransitions = reset ? null : usedTransitions.current; + useLayoutEffect(() => { + usedTransitions.current = transitions; + }); + useOnce(() => () => { + each(usedTransitions.current, t => { + if (t.expired) { + clearTimeout(t.expirationId); + } + + detachRefs(t.ctrl, ref); + t.ctrl.stop(true); + }); + }); + const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions); + const expired = reset && usedTransitions.current || []; + useLayoutEffect(() => each(expired, ({ + ctrl, + item, + key + }) => { + detachRefs(ctrl, ref); + callProp(onDestroyed, item, key); + })); + const reused = []; + if (prevTransitions) each(prevTransitions, (t, i) => { + if (t.expired) { + clearTimeout(t.expirationId); + expired.push(t); + } else { + i = reused[i] = keys.indexOf(t.key); + if (~i) transitions[i] = t; + } + }); + each(items, (item, i) => { + if (!transitions[i]) { + transitions[i] = { + key: keys[i], + item, + phase: TransitionPhase.MOUNT, + ctrl: new Controller() + }; + transitions[i].ctrl.item = item; + } + }); + + if (reused.length) { + let i = -1; + const { + leave + } = propsFn ? propsFn() : props; + each(reused, (keyIndex, prevIndex) => { + const t = prevTransitions[prevIndex]; + + if (~keyIndex) { + i = transitions.indexOf(t); + transitions[i] = react_spring_core_esm_extends({}, t, { + item: items[keyIndex] + }); + } else if (leave) { + transitions.splice(++i, 0, t); + } + }); + } + + if (is.fun(sort)) { + transitions.sort((a, b) => sort(a.item, b.item)); + } + + let delay = -trail; + const forceUpdate = useForceUpdate(); + const defaultProps = getDefaultProps(props); + const changes = new Map(); + const exitingTransitions = useRef(new Map()); + const forceChange = useRef(false); + each(transitions, (t, i) => { + const key = t.key; + const prevPhase = t.phase; + const p = propsFn ? propsFn() : props; + let to; + let phase; + let propsDelay = callProp(p.delay || 0, key); + + if (prevPhase == TransitionPhase.MOUNT) { + to = p.enter; + phase = TransitionPhase.ENTER; + } else { + const isLeave = keys.indexOf(key) < 0; + + if (prevPhase != TransitionPhase.LEAVE) { + if (isLeave) { + to = p.leave; + phase = TransitionPhase.LEAVE; + } else if (to = p.update) { + phase = TransitionPhase.UPDATE; + } else return; + } else if (!isLeave) { + to = p.enter; + phase = TransitionPhase.ENTER; + } else return; + } + + to = callProp(to, t.item, i); + to = is.obj(to) ? inferTo(to) : { + to + }; + + if (!to.config) { + const config = propsConfig || defaultProps.config; + to.config = callProp(config, t.item, i, phase); + } + + delay += trail; + + const payload = react_spring_core_esm_extends({}, defaultProps, { + delay: propsDelay + delay, + ref: propsRef, + immediate: p.immediate, + reset: false + }, to); + + if (phase == TransitionPhase.ENTER && is.und(payload.from)) { + const _p = propsFn ? propsFn() : props; + + const from = is.und(_p.initial) || prevTransitions ? _p.from : _p.initial; + payload.from = callProp(from, t.item, i); + } + + const { + onResolve + } = payload; + + payload.onResolve = result => { + callProp(onResolve, result); + const transitions = usedTransitions.current; + const t = transitions.find(t => t.key === key); + if (!t) return; + + if (result.cancelled && t.phase != TransitionPhase.UPDATE) { + return; + } + + if (t.ctrl.idle) { + const idle = transitions.every(t => t.ctrl.idle); + + if (t.phase == TransitionPhase.LEAVE) { + const expiry = callProp(expires, t.item); + + if (expiry !== false) { + const expiryMs = expiry === true ? 0 : expiry; + t.expired = true; + + if (!idle && expiryMs > 0) { + if (expiryMs <= 0x7fffffff) t.expirationId = setTimeout(forceUpdate, expiryMs); + return; + } + } + } + + if (idle && transitions.some(t => t.expired)) { + exitingTransitions.current.delete(t); + + if (exitBeforeEnter) { + forceChange.current = true; + } + + forceUpdate(); + } + } + }; + + const springs = getSprings(t.ctrl, payload); + + if (phase === TransitionPhase.LEAVE && exitBeforeEnter) { + exitingTransitions.current.set(t, { + phase, + springs, + payload + }); + } else { + changes.set(t, { + phase, + springs, + payload + }); + } + }); + const context = useContext(SpringContext); + const prevContext = usePrev(context); + const hasContext = context !== prevContext && hasProps(context); + useLayoutEffect(() => { + if (hasContext) { + each(transitions, t => { + t.ctrl.start({ + default: context + }); + }); + } + }, [context]); + each(changes, (_, t) => { + if (exitingTransitions.current.size) { + const ind = transitions.findIndex(state => state.key === t.key); + transitions.splice(ind, 1); + } + }); + useLayoutEffect(() => { + each(exitingTransitions.current.size ? exitingTransitions.current : changes, ({ + phase, + payload + }, t) => { + const { + ctrl + } = t; + t.phase = phase; + ref == null ? void 0 : ref.add(ctrl); + + if (hasContext && phase == TransitionPhase.ENTER) { + ctrl.start({ + default: context + }); + } + + if (payload) { + replaceRef(ctrl, payload.ref); + + if (ctrl.ref && !forceChange.current) { + ctrl.update(payload); + } else { + ctrl.start(payload); + + if (forceChange.current) { + forceChange.current = false; + } + } + } + }); + }, reset ? void 0 : deps); + + const renderTransitions = render => React.createElement(React.Fragment, null, transitions.map((t, i) => { + const { + springs + } = changes.get(t) || t.ctrl; + const elem = render(react_spring_core_esm_extends({}, springs), t.item, t, i); + return elem && elem.type ? React.createElement(elem.type, react_spring_core_esm_extends({}, elem.props, { + key: is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id, + ref: elem.ref + })) : elem; + })); + + return ref ? [renderTransitions, ref] : renderTransitions; +} +let nextKey = 1; + +function getKeys(items, { + key, + keys = key +}, prevTransitions) { + if (keys === null) { + const reused = new Set(); + return items.map(item => { + const t = prevTransitions && prevTransitions.find(t => t.item === item && t.phase !== TransitionPhase.LEAVE && !reused.has(t)); + + if (t) { + reused.add(t); + return t.key; + } + + return nextKey++; + }); + } + + return is.und(keys) ? items : is.fun(keys) ? items.map(keys) : toArray(keys); +} + +const _excluded$2 = (/* unused pure expression or super */ null && (["children"])); +function Spring(_ref) { + let { + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded$2); + + return children(useSpring(props)); +} + +const _excluded$1 = (/* unused pure expression or super */ null && (["items", "children"])); +function Trail(_ref) { + let { + items, + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded$1); + + const trails = useTrail(items.length, props); + return items.map((item, index) => { + const result = children(item, index); + return is.fun(result) ? result(trails[index]) : result; + }); +} + +const _excluded = (/* unused pure expression or super */ null && (["items", "children"])); +function Transition(_ref) { + let { + items, + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded); + + return useTransition(items, props)(children); +} + +class Interpolation extends FrameValue { + constructor(source, args) { + super(); + this.key = void 0; + this.idle = true; + this.calc = void 0; + this._active = new Set(); + this.source = source; + this.calc = createInterpolator(...args); + + const value = this._get(); + + const nodeType = getAnimatedType(value); + setAnimated(this, nodeType.create(value)); + } + + advance(_dt) { + const value = this._get(); + + const oldValue = this.get(); + + if (!isEqual(value, oldValue)) { + getAnimated(this).setValue(value); + + this._onChange(value, this.idle); + } + + if (!this.idle && checkIdle(this._active)) { + becomeIdle(this); + } + } + + _get() { + const inputs = react_spring_shared_esm_is.arr(this.source) ? this.source.map(getFluidValue) : react_spring_shared_esm_toArray(getFluidValue(this.source)); + return this.calc(...inputs); + } + + _start() { + if (this.idle && !checkIdle(this._active)) { + this.idle = false; + react_spring_shared_esm_each(getPayload(this), node => { + node.done = false; + }); + + if (globals.skipAnimation) { + raf.batchedUpdates(() => this.advance()); + becomeIdle(this); + } else { + frameLoop.start(this); + } + } + } + + _attach() { + let priority = 1; + react_spring_shared_esm_each(react_spring_shared_esm_toArray(this.source), source => { + if (hasFluidValue(source)) { + addFluidObserver(source, this); + } + + if (isFrameValue(source)) { + if (!source.idle) { + this._active.add(source); + } + + priority = Math.max(priority, source.priority + 1); + } + }); + this.priority = priority; + + this._start(); + } + + _detach() { + react_spring_shared_esm_each(react_spring_shared_esm_toArray(this.source), source => { + if (hasFluidValue(source)) { + removeFluidObserver(source, this); + } + }); + + this._active.clear(); + + becomeIdle(this); + } + + eventObserved(event) { + if (event.type == 'change') { + if (event.idle) { + this.advance(); + } else { + this._active.add(event.parent); + + this._start(); + } + } else if (event.type == 'idle') { + this._active.delete(event.parent); + } else if (event.type == 'priority') { + this.priority = react_spring_shared_esm_toArray(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0); + } + } + +} + +function isIdle(source) { + return source.idle !== false; +} + +function checkIdle(active) { + return !active.size || Array.from(active).every(isIdle); +} + +function becomeIdle(self) { + if (!self.idle) { + self.idle = true; + react_spring_shared_esm_each(getPayload(self), node => { + node.done = true; + }); + callFluidObservers(self, { + type: 'idle', + parent: self + }); + } +} + +const react_spring_core_esm_to = (source, ...args) => new Interpolation(source, args); +const react_spring_core_esm_interpolate = (source, ...args) => (deprecateInterpolate(), new Interpolation(source, args)); + +globals.assign({ + createStringInterpolator: createStringInterpolator, + to: (source, args) => new Interpolation(source, args) +}); +const react_spring_core_esm_update = frameLoop.advance; + + + +;// CONCATENATED MODULE: external "ReactDOM" +var external_ReactDOM_namespaceObject = window["ReactDOM"]; +;// CONCATENATED MODULE: ./node_modules/@react-spring/web/dist/react-spring-web.esm.js + + + + + + +function react_spring_web_esm_objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const react_spring_web_esm_excluded$2 = ["style", "children", "scrollTop", "scrollLeft"]; +const isCustomPropRE = /^--/; + +function dangerousStyleValue(name, value) { + if (value == null || typeof value === 'boolean' || value === '') return ''; + if (typeof value === 'number' && value !== 0 && !isCustomPropRE.test(name) && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; + return ('' + value).trim(); +} + +const attributeCache = {}; +function applyAnimatedValues(instance, props) { + if (!instance.nodeType || !instance.setAttribute) { + return false; + } + + const isFilterElement = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter'; + + const _ref = props, + { + style, + children, + scrollTop, + scrollLeft + } = _ref, + attributes = react_spring_web_esm_objectWithoutPropertiesLoose(_ref, react_spring_web_esm_excluded$2); + + const values = Object.values(attributes); + const names = Object.keys(attributes).map(name => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, n => '-' + n.toLowerCase()))); + + if (children !== void 0) { + instance.textContent = children; + } + + for (let name in style) { + if (style.hasOwnProperty(name)) { + const value = dangerousStyleValue(name, style[name]); + + if (isCustomPropRE.test(name)) { + instance.style.setProperty(name, value); + } else { + instance.style[name] = value; + } + } + } + + names.forEach((name, i) => { + instance.setAttribute(name, values[i]); + }); + + if (scrollTop !== void 0) { + instance.scrollTop = scrollTop; + } + + if (scrollLeft !== void 0) { + instance.scrollLeft = scrollLeft; + } +} +let isUnitlessNumber = { + animationIterationCount: true, + borderImageOutset: true, + borderImageSlice: true, + borderImageWidth: true, + boxFlex: true, + boxFlexGroup: true, + boxOrdinalGroup: true, + columnCount: true, + columns: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + flexOrder: true, + gridRow: true, + gridRowEnd: true, + gridRowSpan: true, + gridRowStart: true, + gridColumn: true, + gridColumnEnd: true, + gridColumnSpan: true, + gridColumnStart: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + fillOpacity: true, + floodOpacity: true, + stopOpacity: true, + strokeDasharray: true, + strokeDashoffset: true, + strokeMiterlimit: true, + strokeOpacity: true, + strokeWidth: true +}; + +const prefixKey = (prefix, key) => prefix + key.charAt(0).toUpperCase() + key.substring(1); + +const prefixes = ['Webkit', 'Ms', 'Moz', 'O']; +isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => { + prefixes.forEach(prefix => acc[prefixKey(prefix, prop)] = acc[prop]); + return acc; +}, isUnitlessNumber); + +const react_spring_web_esm_excluded$1 = ["x", "y", "z"]; +const domTransforms = /^(matrix|translate|scale|rotate|skew)/; +const pxTransforms = /^(translate)/; +const degTransforms = /^(rotate|skew)/; + +const addUnit = (value, unit) => react_spring_shared_esm_is.num(value) && value !== 0 ? value + unit : value; + +const isValueIdentity = (value, id) => react_spring_shared_esm_is.arr(value) ? value.every(v => isValueIdentity(v, id)) : react_spring_shared_esm_is.num(value) ? value === id : parseFloat(value) === id; + +class AnimatedStyle extends AnimatedObject { + constructor(_ref) { + let { + x, + y, + z + } = _ref, + style = react_spring_web_esm_objectWithoutPropertiesLoose(_ref, react_spring_web_esm_excluded$1); + + const inputs = []; + const transforms = []; + + if (x || y || z) { + inputs.push([x || 0, y || 0, z || 0]); + transforms.push(xyz => [`translate3d(${xyz.map(v => addUnit(v, 'px')).join(',')})`, isValueIdentity(xyz, 0)]); + } + + eachProp(style, (value, key) => { + if (key === 'transform') { + inputs.push([value || '']); + transforms.push(transform => [transform, transform === '']); + } else if (domTransforms.test(key)) { + delete style[key]; + if (react_spring_shared_esm_is.und(value)) return; + const unit = pxTransforms.test(key) ? 'px' : degTransforms.test(key) ? 'deg' : ''; + inputs.push(react_spring_shared_esm_toArray(value)); + transforms.push(key === 'rotate3d' ? ([x, y, z, deg]) => [`rotate3d(${x},${y},${z},${addUnit(deg, unit)})`, isValueIdentity(deg, 0)] : input => [`${key}(${input.map(v => addUnit(v, unit)).join(',')})`, isValueIdentity(input, key.startsWith('scale') ? 1 : 0)]); + } + }); + + if (inputs.length) { + style.transform = new FluidTransform(inputs, transforms); + } + + super(style); + } + +} + +class FluidTransform extends FluidValue { + constructor(inputs, transforms) { + super(); + this._value = null; + this.inputs = inputs; + this.transforms = transforms; + } + + get() { + return this._value || (this._value = this._get()); + } + + _get() { + let transform = ''; + let identity = true; + react_spring_shared_esm_each(this.inputs, (input, i) => { + const arg1 = getFluidValue(input[0]); + const [t, id] = this.transforms[i](react_spring_shared_esm_is.arr(arg1) ? arg1 : input.map(getFluidValue)); + transform += ' ' + t; + identity = identity && id; + }); + return identity ? 'none' : transform; + } + + observerAdded(count) { + if (count == 1) react_spring_shared_esm_each(this.inputs, input => react_spring_shared_esm_each(input, value => hasFluidValue(value) && addFluidObserver(value, this))); + } + + observerRemoved(count) { + if (count == 0) react_spring_shared_esm_each(this.inputs, input => react_spring_shared_esm_each(input, value => hasFluidValue(value) && removeFluidObserver(value, this))); + } + + eventObserved(event) { + if (event.type == 'change') { + this._value = null; + } + + callFluidObservers(this, event); + } + +} + +const primitives = ['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']; + +const react_spring_web_esm_excluded = ["scrollTop", "scrollLeft"]; +globals.assign({ + batchedUpdates: external_ReactDOM_namespaceObject.unstable_batchedUpdates, + createStringInterpolator: createStringInterpolator, + colors: colors +}); +const host = createHost(primitives, { + applyAnimatedValues, + createAnimatedStyle: style => new AnimatedStyle(style), + getComponentProps: _ref => { + let props = react_spring_web_esm_objectWithoutPropertiesLoose(_ref, react_spring_web_esm_excluded); + + return props; + } +}); +const animated = host.animated; + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-moving-animation/index.js /** * External dependencies */ @@ -38475,6 +15860,384 @@ const useLayoutEffect = typeof window !== 'undefined' && window.document && wind +/** + * Simple reducer used to increment a counter. + * + * @param {number} state Previous counter value. + * @return {number} New state value. + */ + +const counterReducer = state => state + 1; + +const getAbsolutePosition = element => { + return { + top: element.offsetTop, + left: element.offsetLeft + }; +}; +/** + * Hook used to compute the styles required to move a div into a new position. + * + * The way this animation works is the following: + * - It first renders the element as if there was no animation. + * - It takes a snapshot of the position of the block to use it + * as a destination point for the animation. + * - It restores the element to the previous position using a CSS transform + * - It uses the "resetAnimation" flag to reset the animation + * from the beginning in order to animate to the new destination point. + * + * @param {Object} $1 Options + * @param {boolean} $1.isSelected Whether it's the current block or not. + * @param {boolean} $1.adjustScrolling Adjust the scroll position to the current block. + * @param {boolean} $1.enableAnimation Enable/Disable animation. + * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes. + */ + + +function useMovingAnimation(_ref) { + let { + isSelected, + adjustScrolling, + enableAnimation, + triggerAnimationOnChange + } = _ref; + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)() || !enableAnimation; + const [triggeredAnimation, triggerAnimation] = (0,external_wp_element_namespaceObject.useReducer)(counterReducer, 0); + const [finishedAnimation, endAnimation] = (0,external_wp_element_namespaceObject.useReducer)(counterReducer, 0); + const [transform, setTransform] = (0,external_wp_element_namespaceObject.useState)({ + x: 0, + y: 0 + }); + const previous = (0,external_wp_element_namespaceObject.useMemo)(() => ref.current ? getAbsolutePosition(ref.current) : null, [triggerAnimationOnChange]); // Calculate the previous position of the block relative to the viewport and + // return a function to maintain that position by scrolling. + + const preserveScrollPosition = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!adjustScrolling || !ref.current) { + return () => {}; + } + + const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(ref.current); + + if (!scrollContainer) { + return () => {}; + } + + const prevRect = ref.current.getBoundingClientRect(); + return () => { + const blockRect = ref.current.getBoundingClientRect(); + const diff = blockRect.top - prevRect.top; + + if (diff) { + scrollContainer.scrollTop += diff; + } + }; + }, [triggerAnimationOnChange, adjustScrolling]); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (triggeredAnimation) { + endAnimation(); + } + }, [triggeredAnimation]); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (!previous) { + return; + } + + if (prefersReducedMotion) { + // if the animation is disabled and the scroll needs to be adjusted, + // just move directly to the final scroll position. + preserveScrollPosition(); + return; + } + + ref.current.style.transform = ''; + const destination = getAbsolutePosition(ref.current); + triggerAnimation(); + setTransform({ + x: Math.round(previous.left - destination.left), + y: Math.round(previous.top - destination.top) + }); + }, [triggerAnimationOnChange]); // Only called when either the x or y value changes. + + function onFrameChange(_ref2) { + let { + x, + y + } = _ref2; + + if (!ref.current) { + return; + } + + const isMoving = x === 0 && y === 0; + ref.current.style.transformOrigin = isMoving ? '' : 'center'; + ref.current.style.transform = isMoving ? '' : `translate3d(${x}px,${y}px,0)`; + ref.current.style.zIndex = !isSelected || isMoving ? '' : '1'; + preserveScrollPosition(); + } // Called for every frame computed by useSpring. + + + function onChange(_ref3) { + let { + value + } = _ref3; + let { + x, + y + } = value; + x = Math.round(x); + y = Math.round(y); + + if (x !== onChange.x || y !== onChange.y) { + onFrameChange({ + x, + y + }); + onChange.x = x; + onChange.y = y; + } + } + + onChange.x = 0; + onChange.y = 0; + useSpring({ + from: { + x: transform.x, + y: transform.y + }, + to: { + x: 0, + y: 0 + }, + reset: triggeredAnimation !== finishedAnimation, + config: { + mass: 5, + tension: 2000, + friction: 200 + }, + immediate: prefersReducedMotion, + onChange + }); + return ref; +} + +/* harmony default export */ var use_moving_animation = (useMovingAnimation); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/dom.js +const BLOCK_SELECTOR = '.block-editor-block-list__block'; +const APPENDER_SELECTOR = '.block-list-appender'; +/** + * Returns true if two elements are contained within the same block. + * + * @param {Element} a First element. + * @param {Element} b Second element. + * + * @return {boolean} Whether elements are in the same block. + */ + +function isInSameBlock(a, b) { + return a.closest(BLOCK_SELECTOR) === b.closest(BLOCK_SELECTOR); +} +/** + * Returns true if an element is considered part of the block and not its inner + * blocks or appender. + * + * @param {Element} blockElement Block container element. + * @param {Element} element Element. + * + * @return {boolean} Whether an element is considered part of the block and not + * its inner blocks or appender. + */ + +function isInsideRootBlock(blockElement, element) { + const parentBlock = element.closest([BLOCK_SELECTOR, APPENDER_SELECTOR].join(',')); + return parentBlock === blockElement; +} +/** + * Finds the block client ID given any DOM node inside the block. + * + * @param {Node?} node DOM node. + * + * @return {string|undefined} Client ID or undefined if the node is not part of + * a block. + */ + +function getBlockClientId(node) { + while (node && node.nodeType !== node.ELEMENT_NODE) { + node = node.parentNode; + } + + if (!node) { + return; + } + + const elementNode = + /** @type {Element} */ + node; + const blockNode = elementNode.closest(BLOCK_SELECTOR); + + if (!blockNode) { + return; + } + + return blockNode.id.slice('block-'.length); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +/** @typedef {import('@wordpress/element').RefObject} RefObject */ + +/** + * Returns the initial position if the block needs to be focussed, `undefined` + * otherwise. The initial position is either 0 (start) or -1 (end). + * + * @param {string} clientId Block client ID. + * + * @return {number} The initial position, either 0 (start) or -1 (end). + */ + +function useInitialPosition(clientId) { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSelectedBlocksInitialCaretPosition, + isMultiSelecting, + isNavigationMode, + isBlockSelected + } = select(store); + + if (!isBlockSelected(clientId)) { + return; + } + + if (isMultiSelecting() || isNavigationMode()) { + return; + } // If there's no initial position, return 0 to focus the start. + + + return getSelectedBlocksInitialCaretPosition(); + }, [clientId]); +} +/** + * Transitions focus to the block or inner tabbable when the block becomes + * selected and an initial position is set. + * + * @param {string} clientId Block client ID. + * + * @return {RefObject} React ref with the block element. + */ + + +function useFocusFirstElement(clientId) { + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const initialPosition = useInitialPosition(clientId); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (initialPosition === undefined || initialPosition === null) { + return; + } + + if (!ref.current) { + return; + } + + const { + ownerDocument + } = ref.current; // Do not focus the block if it already contains the active element. + + if (ref.current.contains(ownerDocument.activeElement)) { + return; + } // Find all tabbables within node. + + + const textInputs = external_wp_dom_namespaceObject.focus.tabbable.find(ref.current).filter(node => (0,external_wp_dom_namespaceObject.isTextField)(node)); // If reversed (e.g. merge via backspace), use the last in the set of + // tabbables. + + const isReverse = -1 === initialPosition; + const target = (isReverse ? external_lodash_namespaceObject.last : external_lodash_namespaceObject.first)(textInputs) || ref.current; + + if (!isInsideRootBlock(ref.current, target)) { + ref.current.focus(); + return; + } + + (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, isReverse); + }, [initialPosition]); + return ref; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-is-hovered.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function listener(event) { + if (event.defaultPrevented) { + return; + } + + const action = event.type === 'mouseover' ? 'add' : 'remove'; + event.preventDefault(); + event.currentTarget.classList[action]('is-hovered'); +} +/** + * Adds `is-hovered` class when the block is hovered and in navigation or + * outline mode. + */ + + +function useIsHovered() { + const isEnabled = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isNavigationMode, + getSettings + } = select(store); + return isNavigationMode() || getSettings().outlineMode; + }, []); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + if (isEnabled) { + node.addEventListener('mouseout', listener); + node.addEventListener('mouseover', listener); + return () => { + node.removeEventListener('mouseout', listener); + node.removeEventListener('mouseover', listener); // Remove class in case it lingers. + + node.classList.remove('is-hovered'); + }; + } + }, [isEnabled]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-class-names.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + /** @@ -38483,83 +16246,806 @@ const useLayoutEffect = typeof window !== 'undefined' && window.document && wind /** - * Retrieves the block patterns inserter state. + * Returns the class names used for the different states of the block. * - * @param {Function} onInsert function called when inserter a list of blocks. - * @param {string=} rootClientId Insertion's root client ID. + * @param {string} clientId The block client ID. * - * @return {Array} Returns the patterns state. (patterns, categories, onSelect handler) + * @return {string} The class names. */ -const usePatternsState = (onInsert, rootClientId) => { - const { - patternCategories, - patterns - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["useSelect"])(select => { +function useBlockClassNames(clientId) { + return (0,external_wp_data_namespaceObject.useSelect)(select => { const { - __experimentalGetAllowedPatterns, - getSettings - } = select(_store__WEBPACK_IMPORTED_MODULE_6__[/* store */ "a"]); - return { - patterns: __experimentalGetAllowedPatterns(rootClientId), - patternCategories: getSettings().__experimentalBlockPatternCategories - }; - }, [rootClientId]); - const { - createSuccessNotice - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["useDispatch"])(_wordpress_notices__WEBPACK_IMPORTED_MODULE_5__["store"]); - const onClickPattern = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])((pattern, blocks) => { - onInsert(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["map"])(blocks, block => Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["cloneBlock"])(block)), pattern.name); - createSuccessNotice(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["sprintf"])( - /* translators: %s: block pattern title. */ - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Block pattern "%s" inserted.'), pattern.title), { - type: 'snackbar' + isBlockBeingDragged, + isBlockHighlighted, + isBlockSelected, + isBlockMultiSelected, + getBlockName, + getSettings, + hasSelectedInnerBlock, + isTyping, + __experimentalGetActiveBlockIdByBlockNames: getActiveBlockIdByBlockNames + } = select(store); + const { + __experimentalSpotlightEntityBlocks: spotlightEntityBlocks, + outlineMode + } = getSettings(); + const isDragging = isBlockBeingDragged(clientId); + const isSelected = isBlockSelected(clientId); + const name = getBlockName(clientId); + const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check + + const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep); + const activeEntityBlockId = getActiveBlockIdByBlockNames(spotlightEntityBlocks); + return classnames_default()({ + 'is-selected': isSelected, + 'is-highlighted': isBlockHighlighted(clientId), + 'is-multi-selected': isBlockMultiSelected(clientId), + 'is-reusable': (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(name)), + 'is-dragging': isDragging, + 'has-child-selected': isAncestorOfSelectedBlock, + 'has-active-entity': activeEntityBlockId, + // Determine if there is an active entity area to spotlight. + 'is-active-entity': activeEntityBlockId === clientId, + 'remove-outline': isSelected && outlineMode && isTyping() }); - }, []); - return [patterns, patternCategories, onClickPattern]; -}; + }, [clientId]); +} -/* harmony default export */ __webpack_exports__["a"] = (usePatternsState); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-default-class-name.js +/** + * WordPress dependencies + */ -/***/ }), +/** + * Internal dependencies + */ -/***/ "nlh6": -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockProps; }); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("Z23Y"); -/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var _use_moving_animation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("Xkls"); -/* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("jBNB"); -/* harmony import */ var _use_focus_first_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("z+q2"); -/* harmony import */ var _use_is_hovered__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("kBLm"); -/* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("ur0x"); -/* harmony import */ var _use_block_class_names__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("Q2Xw"); -/* harmony import */ var _use_block_default_class_name__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("YZt4"); -/* harmony import */ var _use_block_custom_class_name__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("ERVc"); -/* harmony import */ var _use_block_moving_mode_class_names__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("+6d5"); -/* harmony import */ var _use_focus_handler__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("6jxZ"); -/* harmony import */ var _use_selected_block_event_handlers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("felP"); -/* harmony import */ var _use_nav_mode_exit__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("JDWi"); -/* harmony import */ var _use_scroll_into_view__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__("G4zt"); -/* harmony import */ var _use_block_refs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__("PKbb"); -/* harmony import */ var _use_multi_selection__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__("hw9B"); -/* harmony import */ var _use_intersection_observer__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__("rHRV"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__("BhPs"); +/** + * Returns the default class name if the block is a light block and it supports + * `className`. + * + * @param {string} clientId The block client ID. + * + * @return {string} The class name, e.g. `wp-block-paragraph`. + */ + +function useBlockDefaultClassName(clientId) { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + const name = select(store).getBlockName(clientId); + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); + const hasLightBlockWrapper = (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) > 1; + + if (!hasLightBlockWrapper) { + return; + } + + return (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name); + }, [clientId]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * Returns the custom class name if the block is a light block. + * + * @param {string} clientId The block client ID. + * + * @return {string} The custom class name. + */ + +function useBlockCustomClassName(clientId) { + // It's good for this to be a separate selector because it will be executed + // on every attribute change, while the other selectors are not re-evaluated + // as much. + return (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockName, + getBlockAttributes + } = select(store); + const attributes = getBlockAttributes(clientId); + + if (!(attributes !== null && attributes !== void 0 && attributes.className)) { + return; + } + + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(getBlockName(clientId)); + const hasLightBlockWrapper = (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) > 1; + + if (!hasLightBlockWrapper) { + return; + } + + return attributes.className; + }, [clientId]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * Returns the class names used for block moving mode. + * + * @param {string} clientId The block client ID to insert above. + * + * @return {string} The class names. + */ + +function useBlockMovingModeClassNames(clientId) { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + hasBlockMovingClientId, + canInsertBlockType, + getBlockName, + getBlockRootClientId, + isBlockSelected + } = select(store); // The classes are only relevant for the selected block. Avoid + // re-rendering all blocks! + + if (!isBlockSelected(clientId)) { + return; + } + + const movingClientId = hasBlockMovingClientId(); + + if (!movingClientId) { + return; + } + + return classnames_default()('is-block-moving-mode', { + 'can-insert-moving-block': canInsertBlockType(getBlockName(movingClientId), getBlockRootClientId(clientId)) + }); + }, [clientId]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-handler.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +/** + * Selects the block if it receives focus. + * + * @param {string} clientId Block client ID. + */ + +function useFocusHandler(clientId) { + const { + isBlockSelected + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + selectBlock, + selectionChange + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + /** + * Marks the block as selected when focused and not already + * selected. This specifically handles the case where block does not + * set focus on its own (via `setFocus`), typically if there is no + * focusable input in the block. + * + * @param {FocusEvent} event Focus event. + */ + function onFocus(event) { + // Check synchronously because a non-selected block might be + // getting data through `useSelect` asynchronously. + if (isBlockSelected(clientId)) { + // Potentially change selection away from rich text. + if (!event.target.isContentEditable) { + selectionChange(clientId); + } + + return; + } // If an inner block is focussed, that block is resposible for + // setting the selected block. + + + if (!isInsideRootBlock(node, event.target)) { + return; + } + + selectBlock(clientId); + } + + node.addEventListener('focusin', onFocus); + return () => { + node.removeEventListener('focusin', onFocus); + }; + }, [isBlockSelected, selectBlock]); +} + +;// CONCATENATED MODULE: external ["wp","keycodes"] +var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * Adds block behaviour: + * - Removes the block on BACKSPACE. + * - Inserts a default block on ENTER. + * - Disables dragging of block contents. + * + * @param {string} clientId Block client ID. + */ + +function useEventHandlers(clientId) { + const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isBlockSelected(clientId), [clientId]); + const { + getBlockRootClientId, + getBlockIndex + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + insertDefaultBlock, + removeBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + if (!isSelected) { + return; + } + /** + * Interprets keydown event intent to remove or insert after block if + * key event occurs on wrapper node. This can occur when the block has + * no text fields of its own, particularly after initial insertion, to + * allow for easy deletion and continuous writing flow to add additional + * content. + * + * @param {KeyboardEvent} event Keydown event. + */ + + + function onKeyDown(event) { + const { + keyCode, + target + } = event; + + if (keyCode !== external_wp_keycodes_namespaceObject.ENTER && keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.DELETE) { + return; + } + + if (target !== node || (0,external_wp_dom_namespaceObject.isTextField)(target)) { + return; + } + + event.preventDefault(); + + if (keyCode === external_wp_keycodes_namespaceObject.ENTER) { + insertDefaultBlock({}, getBlockRootClientId(clientId), getBlockIndex(clientId) + 1); + } else { + removeBlock(clientId); + } + } + /** + * Prevents default dragging behavior within a block. To do: we must + * handle this in the future and clean up the drag target. + * + * @param {DragEvent} event Drag event. + */ + + + function onDragStart(event) { + event.preventDefault(); + } + + node.addEventListener('keydown', onKeyDown); + node.addEventListener('dragstart', onDragStart); + return () => { + node.removeEventListener('keydown', onKeyDown); + node.removeEventListener('dragstart', onDragStart); + }; + }, [clientId, isSelected, getBlockRootClientId, getBlockIndex, insertDefaultBlock, removeBlock]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * Allows navigation mode to be exited by clicking in the selected block. + * + * @param {string} clientId Block client ID. + */ + +function useNavModeExit(clientId) { + const { + isNavigationMode, + isBlockSelected + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + setNavigationMode, + selectBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function onMouseDown(event) { + // Don't select a block if it's already handled by a child + // block. + if (isNavigationMode() && !event.defaultPrevented) { + // Prevent focus from moving to the block. + event.preventDefault(); // When clicking on a selected block, exit navigation mode. + + if (isBlockSelected(clientId)) { + setNavigationMode(false); + } else { + selectBlock(clientId); + } + } + } + + node.addEventListener('mousedown', onMouseDown); + return () => { + node.addEventListener('mousedown', onMouseDown); + }; + }, [clientId, isNavigationMode, isBlockSelected, setNavigationMode]); +} + +// EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js +var dom_scroll_into_view_lib = __webpack_require__(5425); +var lib_default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view_lib); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-scroll-into-view.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +function useScrollIntoView(clientId) { + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const isSelectionEnd = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isBlockSelected, + getBlockSelectionEnd + } = select(store); + return isBlockSelected(clientId) || getBlockSelectionEnd() === clientId; + }, [clientId]); // Note that we can't use `useRefEffect` here, since an element change does + // not mean we can scroll. `isSelectionEnd` should be the sole dependency, + // while with `useRefEffect`, the element is a dependency as well. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!isSelectionEnd) { + return; + } + + const extentNode = ref.current; + + if (!extentNode) { + return; + } // If the block is focused, the browser will already have scrolled into + // view if necessary. + + + if (extentNode.contains(extentNode.ownerDocument.activeElement)) { + return; + } + + const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(extentNode) || extentNode.ownerDocument.defaultView; // If there's no scroll container, it follows that there's no scrollbar + // and thus there's no need to try to scroll into view. + + if (!scrollContainer) { + return; + } + + lib_default()(extentNode, scrollContainer, { + onlyScrollIfNeeded: true + }); + }, [isSelectionEnd]); + return ref; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/block-refs-provider.js + + +/** + * WordPress dependencies + */ + +const BlockRefs = (0,external_wp_element_namespaceObject.createContext)(); +function BlockRefsProvider(_ref) { + let { + children + } = _ref; + const value = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + refs: new Map(), + callbacks: new Map() + }), []); + return (0,external_wp_element_namespaceObject.createElement)(BlockRefs.Provider, { + value: value + }, children); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** @typedef {import('@wordpress/element').RefCallback} RefCallback */ + +/** @typedef {import('@wordpress/element').RefObject} RefObject */ + +/** + * Provides a ref to the BlockRefs context. + * + * @param {string} clientId The client ID of the element ref. + * + * @return {RefCallback} Ref callback. + */ + +function useBlockRefProvider(clientId) { + const { + refs, + callbacks + } = (0,external_wp_element_namespaceObject.useContext)(BlockRefs); + const ref = (0,external_wp_element_namespaceObject.useRef)(); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + refs.set(ref, clientId); + return () => { + refs.delete(ref); + }; + }, [clientId]); + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + // Update the ref in the provider. + ref.current = element; // Call any update functions. + + callbacks.forEach((id, setElement) => { + if (clientId === id) { + setElement(element); + } + }); + }, [clientId]); +} +/** + * Gets a ref pointing to the current block element. Continues to return a + * stable ref even if the block client ID changes. + * + * @param {string} clientId The client ID to get a ref for. + * + * @return {RefObject} A ref containing the element. + */ + +function useBlockRef(clientId) { + const { + refs + } = (0,external_wp_element_namespaceObject.useContext)(BlockRefs); + const freshClientId = (0,external_wp_element_namespaceObject.useRef)(); + freshClientId.current = clientId; // Always return an object, even if no ref exists for a given client ID, so + // that `current` works at a later point. + + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + get current() { + let element = null; // Multiple refs may be created for a single block. Find the + // first that has an element set. + + for (const [ref, id] of refs.entries()) { + if (id === freshClientId.current && ref.current) { + element = ref.current; + } + } + + return element; + } + + }), []); +} +/** + * Return the element for a given client ID. Updates whenever the element + * changes, becomes available, or disappears. + * + * @param {string} clientId The client ID to an element for. + * + * @return {Element|null} The block's wrapper element. + */ + + +function useBlockElement(clientId) { + const { + callbacks + } = (0,external_wp_element_namespaceObject.useContext)(BlockRefs); + const ref = useBlockRef(clientId); + const [element, setElement] = (0,external_wp_element_namespaceObject.useState)(null); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (!clientId) { + return; + } + + callbacks.set(setElement, clientId); + return () => { + callbacks.delete(setElement); + }; + }, [clientId]); + return ref.current || element; +} + + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-multi-selection.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +function toggleRichText(container, toggle) { + Array.from(container.closest('.is-root-container').querySelectorAll('.rich-text')).forEach(node => { + if (toggle) { + node.setAttribute('contenteditable', true); + } else { + node.removeAttribute('contenteditable'); + } + }); +} +/** + * Sets a multi-selection based on the native selection across blocks. + * + * @param {string} clientId Block client ID. + */ + + +function useMultiSelection(clientId) { + const { + startMultiSelect, + stopMultiSelect, + multiSelect, + selectBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + isSelectionEnabled, + isBlockSelected, + getBlockParents, + getBlockSelectionStart, + hasMultiSelection + } = (0,external_wp_data_namespaceObject.useSelect)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + const { + ownerDocument + } = node; + const { + defaultView + } = ownerDocument; + let anchorElement; + let rafId; + + function onSelectionChange(_ref) { + let { + isSelectionEnd + } = _ref; + const selection = defaultView.getSelection(); // If no selection is found, end multi selection and enable all rich + // text areas. + + if (!selection.rangeCount || selection.isCollapsed) { + toggleRichText(node, true); + return; + } + + const endClientId = getBlockClientId(selection.focusNode); + const isSingularSelection = clientId === endClientId; + + if (isSingularSelection) { + selectBlock(clientId); // If the selection is complete (on mouse up), and no + // multiple blocks have been selected, set focus back to the + // anchor element. if the anchor element contains the + // selection. Additionally, rich text elements that were + // previously disabled can now be enabled again. + + if (isSelectionEnd) { + toggleRichText(node, true); + + if (selection.rangeCount) { + const { + commonAncestorContainer + } = selection.getRangeAt(0); + + if (anchorElement.contains(commonAncestorContainer)) { + anchorElement.focus(); + } + } + } + } else { + const startPath = [...getBlockParents(clientId), clientId]; + const endPath = [...getBlockParents(endClientId), endClientId]; + const depth = Math.min(startPath.length, endPath.length) - 1; + multiSelect(startPath[depth], endPath[depth]); + } + } + + function onSelectionEnd() { + ownerDocument.removeEventListener('selectionchange', onSelectionChange); // Equivalent to attaching the listener once. + + defaultView.removeEventListener('mouseup', onSelectionEnd); // The browser selection won't have updated yet at this point, + // so wait until the next animation frame to get the browser + // selection. + + rafId = defaultView.requestAnimationFrame(() => { + onSelectionChange({ + isSelectionEnd: true + }); + stopMultiSelect(); + }); + } + + function onMouseLeave(_ref2) { + let { + buttons + } = _ref2; + + // The primary button must be pressed to initiate selection. + // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons + if (buttons !== 1) { + return; + } + + if (!isSelectionEnabled() || !isBlockSelected(clientId)) { + return; + } + + anchorElement = ownerDocument.activeElement; + startMultiSelect(); // `onSelectionStart` is called after `mousedown` and + // `mouseleave` (from a block). The selection ends when + // `mouseup` happens anywhere in the window. + + ownerDocument.addEventListener('selectionchange', onSelectionChange); + defaultView.addEventListener('mouseup', onSelectionEnd); // Removing the contenteditable attributes within the block + // editor is essential for selection to work across editable + // areas. The edible hosts are removed, allowing selection to be + // extended outside the DOM element. `startMultiSelect` sets a + // flag in the store so the rich text components are updated, + // but the rerender may happen very slowly, especially in Safari + // for the blocks that are asynchonously rendered. To ensure the + // browser instantly removes the selection boundaries, we remove + // the contenteditable attributes manually. + + toggleRichText(node, false); + } + + function onMouseDown(event) { + // The main button. + // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button + if (!isSelectionEnabled() || event.button !== 0) { + return; + } + + if (event.shiftKey) { + const blockSelectionStart = getBlockSelectionStart(); // By checking `blockSelectionStart` to be set, we handle the + // case where we select a single block. We also have to check + // the selectionEnd (clientId) not to be included in the + // `blockSelectionStart`'s parents because the click event is + // propagated. + + const startParents = getBlockParents(blockSelectionStart); + + if (blockSelectionStart && blockSelectionStart !== clientId && !(startParents !== null && startParents !== void 0 && startParents.includes(clientId))) { + const startPath = [...startParents, blockSelectionStart]; + const endPath = [...getBlockParents(clientId), clientId]; + const depth = Math.min(startPath.length, endPath.length) - 1; + const start = startPath[depth]; + const end = endPath[depth]; // Handle the case of having selected a parent block and + // then sfift+click on a child. + + if (start !== end) { + toggleRichText(node, false); + multiSelect(start, end); + event.preventDefault(); + } + } + } else if (hasMultiSelection()) { + // Allow user to escape out of a multi-selection to a + // singular selection of a block via click. This is handled + // here since focus handling excludes blocks when there is + // multiselection, as focus can be incurred by starting a + // multiselection (focus moved to first block's multi- + // controls). + selectBlock(clientId); + } + } + + node.addEventListener('mousedown', onMouseDown); + node.addEventListener('mouseleave', onMouseLeave); + return () => { + node.removeEventListener('mousedown', onMouseDown); + node.removeEventListener('mouseleave', onMouseLeave); + ownerDocument.removeEventListener('selectionchange', onSelectionChange); + defaultView.removeEventListener('mouseup', onSelectionEnd); + defaultView.cancelAnimationFrame(rafId); + }; + }, [clientId, startMultiSelect, stopMultiSelect, multiSelect, selectBlock, isSelectionEnabled, isBlockSelected, getBlockParents]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function useIntersectionObserver() { + const observer = (0,external_wp_element_namespaceObject.useContext)(IntersectionObserver); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + if (observer) { + observer.observe(node); + return () => { + observer.unobserve(node); + }; + } + }, [observer]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/index.js /** * External dependencies */ @@ -38628,7 +17114,7 @@ function useBlockProps() { className, wrapperProps = {}, isAligned - } = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_block__WEBPACK_IMPORTED_MODULE_8__[/* BlockListBlockContext */ "a"]); + } = (0,external_wp_element_namespaceObject.useContext)(BlockListBlockContext); const { index, mode, @@ -38638,7 +17124,7 @@ function useBlockProps() { isPartOfSelection, adjustScrolling, enableAnimation - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockIndex, getBlockMode, @@ -38649,11 +17135,11 @@ function useBlockProps() { isBlockMultiSelected, isAncestorMultiSelected, isFirstMultiSelectedBlock - } = select(_store__WEBPACK_IMPORTED_MODULE_23__[/* store */ "a"]); + } = select(store); const isSelected = isBlockSelected(clientId); const isPartOfMultiSelection = isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId); const blockName = getBlockName(clientId); - const blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getBlockType"])(blockName); + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); return { index: getBlockIndex(clientId), mode: getBlockMode(clientId), @@ -38666,19 +17152,19 @@ function useBlockProps() { }; }, [clientId]); // translators: %s: Type of block (i.e. Text, Image etc) - const blockLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Block: %s'), blockTitle); + const blockLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Block: %s'), blockTitle); const htmlSuffix = mode === 'html' && !__unstableIsHtml ? '-visual' : ''; - const mergedRefs = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useMergeRefs"])([props.ref, Object(_use_focus_first_element__WEBPACK_IMPORTED_MODULE_9__[/* useFocusFirstElement */ "a"])(clientId), // Must happen after focus because we check for focus in the block. - Object(_use_scroll_into_view__WEBPACK_IMPORTED_MODULE_19__[/* useScrollIntoView */ "a"])(clientId), Object(_use_block_refs__WEBPACK_IMPORTED_MODULE_20__[/* useBlockRefProvider */ "c"])(clientId), Object(_use_focus_handler__WEBPACK_IMPORTED_MODULE_16__[/* useFocusHandler */ "a"])(clientId), Object(_use_multi_selection__WEBPACK_IMPORTED_MODULE_21__[/* useMultiSelection */ "a"])(clientId), Object(_use_selected_block_event_handlers__WEBPACK_IMPORTED_MODULE_17__[/* useEventHandlers */ "a"])(clientId), Object(_use_nav_mode_exit__WEBPACK_IMPORTED_MODULE_18__[/* useNavModeExit */ "a"])(clientId), Object(_use_is_hovered__WEBPACK_IMPORTED_MODULE_10__[/* useIsHovered */ "a"])(), Object(_use_intersection_observer__WEBPACK_IMPORTED_MODULE_22__[/* useIntersectionObserver */ "a"])(), Object(_use_moving_animation__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])({ + const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, useFocusFirstElement(clientId), // Must happen after focus because we check for focus in the block. + useScrollIntoView(clientId), useBlockRefProvider(clientId), useFocusHandler(clientId), useMultiSelection(clientId), useEventHandlers(clientId), useNavModeExit(clientId), useIsHovered(), useIntersectionObserver(), use_moving_animation({ isSelected: isPartOfSelection, adjustScrolling, enableAnimation, triggerAnimationOnChange: index })]); - const blockEditContext = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_11__[/* useBlockEditContext */ "c"])(); // Ensures it warns only inside the `edit` implementation for the block. + const blockEditContext = useBlockEditContext(); // Ensures it warns only inside the `edit` implementation for the block. if (blockApiVersion < 2 && clientId === blockEditContext.clientId) { - typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_6___default()(`Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.`) : void 0; + typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0; } return { ...wrapperProps, @@ -38691,10 +17177,10 @@ function useBlockProps() { 'data-block': clientId, 'data-type': name, 'data-title': blockTitle, - className: classnames__WEBPACK_IMPORTED_MODULE_0___default()( // The wp-block className is important for editor styles. - classnames__WEBPACK_IMPORTED_MODULE_0___default()('block-editor-block-list__block', { + className: classnames_default()( // The wp-block className is important for editor styles. + classnames_default()('block-editor-block-list__block', { 'wp-block': !isAligned - }), className, props.className, wrapperProps.className, Object(_use_block_class_names__WEBPACK_IMPORTED_MODULE_12__[/* useBlockClassNames */ "a"])(clientId), Object(_use_block_default_class_name__WEBPACK_IMPORTED_MODULE_13__[/* useBlockDefaultClassName */ "a"])(clientId), Object(_use_block_custom_class_name__WEBPACK_IMPORTED_MODULE_14__[/* useBlockCustomClassName */ "a"])(clientId), Object(_use_block_moving_mode_class_names__WEBPACK_IMPORTED_MODULE_15__[/* useBlockMovingModeClassNames */ "a"])(clientId)), + }), className, props.className, wrapperProps.className, useBlockClassNames(clientId), useBlockDefaultClassName(clientId), useBlockCustomClassName(clientId), useBlockMovingModeClassNames(clientId)), style: { ...wrapperProps.style, ...props.style } @@ -38706,174 +17192,15 @@ function useBlockProps() { * @param {Object} props Optional. Props to pass to the element. */ -useBlockProps.save = _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["__unstableGetBlockProps"]; +useBlockProps.save = external_wp_blocks_namespaceObject.__unstableGetBlockProps; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) - -/***/ }), - -/***/ "o97j": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ExecutionEnvironment - */ - -/*jslint evil: true */ - - - -var canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement -); - -/** - * Simple, lightweight module assisting with the detection and context of - * Worker. Helps avoid circular dependencies and allows code to reason about - * whether or not they are in a Worker, even if they never include the main - * `ReactWorker` dependency. - */ -var ExecutionEnvironment = { - - canUseDOM: canUseDOM, - - canUseWorkers: typeof Worker !== 'undefined', - - canUseEventListeners: - canUseDOM && !!(window.addEventListener || window.attachEvent), - - canUseViewport: canUseDOM && !!window.screen, - - isInWorker: !canUseDOM // For now, this is true - might change in the future. - -}; - -module.exports = ExecutionEnvironment; - - -/***/ }), - -/***/ "onLe": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["notices"]; }()); - -/***/ }), - -/***/ "p3NJ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ useInnerBlocksProps; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js -var button_block_appender = __webpack_require__("I5Hl"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js -var block_edit_context = __webpack_require__("ur0x"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/with-client-id.js - - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -const withClientId = Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => props => { - const { - clientId - } = Object(block_edit_context["c" /* useBlockEditContext */])(); - return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, props, { - clientId: clientId - })); -}, 'withClientId'); -/* harmony default export */ var with_client_id = (withClientId); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/button-block-appender.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block.js /** * External dependencies */ -/** - * Internal dependencies - */ - - - -const ButtonBlockAppender = _ref => { - let { - clientId, - showSeparator, - isFloating, - onAddBlock, - isToggle - } = _ref; - return Object(external_wp_element_["createElement"])(button_block_appender["b" /* default */], { - className: classnames_default()({ - 'block-list-appender__toggle': isToggle - }), - rootClientId: clientId, - showSeparator: showSeparator, - isFloating: isFloating, - onAddBlock: onAddBlock - }); -}; -/* harmony default export */ var inner_blocks_button_block_appender = (with_client_id(ButtonBlockAppender)); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js -var default_block_appender = __webpack_require__("5L8O"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/default-block-appender.js - - -/** - * External dependencies - */ /** * WordPress dependencies @@ -38881,6 +17208,10 @@ var store = __webpack_require__("BhPs"); + + + + /** * Internal dependencies */ @@ -38888,2512 +17219,1009 @@ var store = __webpack_require__("BhPs"); -const DefaultBlockAppender = _ref => { + + + + +const BlockListBlockContext = (0,external_wp_element_namespaceObject.createContext)(); +/** + * Merges wrapper props with special handling for classNames and styles. + * + * @param {Object} propsA + * @param {Object} propsB + * + * @return {Object} Merged props. + */ + +function mergeWrapperProps(propsA, propsB) { + const newProps = { ...propsA, + ...propsB + }; + + if (propsA && propsB && propsA.className && propsB.className) { + newProps.className = classnames_default()(propsA.className, propsB.className); + } + + if (propsA && propsB && propsA.style && propsB.style) { + newProps.style = { ...propsA.style, + ...propsB.style + }; + } + + return newProps; +} + +function Block(_ref) { let { - clientId, - lastBlockClientId + children, + isHtml, + ...props } = _ref; - return Object(external_wp_element_["createElement"])(default_block_appender["a" /* default */], { - rootClientId: clientId, - lastBlockClientId: lastBlockClientId - }); -}; -/* harmony default export */ var inner_blocks_default_block_appender = (Object(external_wp_compose_["compose"])([with_client_id, Object(external_wp_data_["withSelect"])((select, _ref2) => { + return (0,external_wp_element_namespaceObject.createElement)("div", useBlockProps(props, { + __unstableIsHtml: isHtml + }), children); +} + +function BlockListBlock(_ref2) { let { - clientId + mode, + isLocked, + canRemove, + clientId, + isSelected, + isSelectionEnabled, + className, + name, + isValid, + attributes, + wrapperProps, + setAttributes, + onReplace, + onInsertBlocksAfter, + onMerge, + toggleSelection } = _ref2; const { - getBlockOrder - } = select(store["a" /* store */]); - const blockClientIds = getBlockOrder(clientId); - return { - lastBlockClientId: Object(external_lodash_["last"])(blockClientIds) - }; -})])(DefaultBlockAppender)); - -// EXTERNAL MODULE: external ["wp","isShallowEqual"] -var external_wp_isShallowEqual_ = __webpack_require__("rl8x"); -var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/index.js + 5 modules -var layouts = __webpack_require__("PPMp"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-nested-settings-update.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -/** - * This hook is a side effect which updates the block-editor store when changes - * happen to inner block settings. The given props are transformed into a - * settings object, and if that is different from the current settings object in - * the block-editor store, then the store is updated with the new settings which - * came from props. - * - * @param {string} clientId The client ID of the block to update. - * @param {string[]} allowedBlocks An array of block names which are permitted - * in inner blocks. - * @param {?Array} __experimentalDefaultBlock The default block to insert: [ blockName, { blockAttributes } ]. - * @param {?Function|boolean} __experimentalDirectInsert If a default block should be inserted directly by the - * appender. - * @param {string} [templateLock] The template lock specified for the inner - * blocks component. (e.g. "all") - * @param {boolean} captureToolbars Whether or children toolbars should be shown - * in the inner blocks component rather than on - * the child block. - * @param {string} orientation The direction in which the block - * should face. - * @param {Object} layout The layout object for the block container. - */ - -function useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout) { - const { - updateBlockListSettings - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const { - blockListSettings, - parentLock - } = Object(external_wp_data_["useSelect"])(select => { - const rootClientId = select(store["a" /* store */]).getBlockRootClientId(clientId); - return { - blockListSettings: select(store["a" /* store */]).getBlockListSettings(clientId), - parentLock: select(store["a" /* store */]).getTemplateLock(rootClientId) - }; - }, [clientId]); // Memoize as inner blocks implementors often pass a new array on every - // render. - - const _allowedBlocks = Object(external_wp_element_["useMemo"])(() => allowedBlocks, allowedBlocks); - - Object(external_wp_element_["useLayoutEffect"])(() => { - const newSettings = { - allowedBlocks: _allowedBlocks, - templateLock: templateLock === undefined ? parentLock : templateLock - }; // These values are not defined for RN, so only include them if they - // are defined. - - if (captureToolbars !== undefined) { - newSettings.__experimentalCaptureToolbars = captureToolbars; - } // Orientation depends on layout, - // ideally the separate orientation prop should be deprecated. - - - if (orientation !== undefined) { - newSettings.orientation = orientation; - } else { - const layoutType = Object(layouts["a" /* getLayoutType */])(layout === null || layout === void 0 ? void 0 : layout.type); - newSettings.orientation = layoutType.getOrientation(layout); - } - - if (__experimentalDefaultBlock !== undefined) { - newSettings.__experimentalDefaultBlock = __experimentalDefaultBlock; - } - - if (__experimentalDirectInsert !== undefined) { - newSettings.__experimentalDirectInsert = __experimentalDirectInsert; - } - - if (!external_wp_isShallowEqual_default()(blockListSettings, newSettings)) { - updateBlockListSettings(clientId, newSettings); - } - }, [clientId, blockListSettings, _allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, parentLock, captureToolbars, orientation, updateBlockListSettings, layout]); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-inner-block-template-sync.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -/** - * This hook makes sure that a block's inner blocks stay in sync with the given - * block "template". The template is a block hierarchy to which inner blocks must - * conform. If the blocks get "out of sync" with the template and the template - * is meant to be locked (e.g. templateLock = "all"), then we replace the inner - * blocks with the correct value after synchronizing it with the template. - * - * @param {string} clientId The block client ID. - * @param {Object} template The template to match. - * @param {string} templateLock The template lock state for the inner blocks. For - * example, if the template lock is set to "all", - * then the inner blocks will stay in sync with the - * template. If not defined or set to false, then - * the inner blocks will not be synchronized with - * the given template. - * @param {boolean} templateInsertUpdatesSelection Whether or not to update the - * block-editor selection state when inner blocks - * are replaced after template synchronization. - */ - -function useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection) { - const { - getSelectedBlocksInitialCaretPosition - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - replaceInnerBlocks - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const innerBlocks = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).getBlocks(clientId), [clientId]); // Maintain a reference to the previous value so we can do a deep equality check. - - const existingTemplate = Object(external_wp_element_["useRef"])(null); - Object(external_wp_element_["useLayoutEffect"])(() => { - // Only synchronize innerBlocks with template if innerBlocks are empty or - // a locking all exists directly on the block. - if (innerBlocks.length === 0 || templateLock === 'all') { - const hasTemplateChanged = !Object(external_lodash_["isEqual"])(template, existingTemplate.current); - - if (hasTemplateChanged) { - existingTemplate.current = template; - const nextBlocks = Object(external_wp_blocks_["synchronizeBlocksWithTemplate"])(innerBlocks, template); - - if (!Object(external_lodash_["isEqual"])(nextBlocks, innerBlocks)) { - replaceInnerBlocks(clientId, nextBlocks, innerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0, // This ensures the "initialPosition" doesn't change when applying the template - // If we're supposed to focus the block, we'll focus the first inner block - // otherwise, we won't apply any auto-focus. - // This ensures for instance that the focus stays in the inserter when inserting the "buttons" block. - getSelectedBlocksInitialCaretPosition()); - } - } - } - }, [innerBlocks, template, templateLock, clientId]); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/get-block-context.js -/** - * External dependencies - */ - -/** - * Block context cache, implemented as a WeakMap mapping block types to a - * WeakMap mapping attributes object to context value. - * - * @type {WeakMap>} - */ - -const BLOCK_CONTEXT_CACHE = new WeakMap(); -/** - * Returns a cached context object value for a given set of attributes for the - * block type. - * - * @param {Record} attributes Block attributes object. - * @param {WPBlockType} blockType Block type settings. - * - * @return {Record} Context value. - */ - -function getBlockContext(attributes, blockType) { - if (!BLOCK_CONTEXT_CACHE.has(blockType)) { - BLOCK_CONTEXT_CACHE.set(blockType, new WeakMap()); - } - - const blockTypeCache = BLOCK_CONTEXT_CACHE.get(blockType); - - if (!blockTypeCache.has(attributes)) { - const context = Object(external_lodash_["mapValues"])(blockType.providesContext, attributeName => attributes[attributeName]); - blockTypeCache.set(attributes, context); - } - - return blockTypeCache.get(attributes); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js + 4 modules -var block_list = __webpack_require__("VyCT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-context/index.js -var block_context = __webpack_require__("uoCR"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/use-block-sync.js -var use_block_sync = __webpack_require__("JGYp"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-on-block-drop/index.js -var use_on_block_drop = __webpack_require__("/lNF"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/math.js -var math = __webpack_require__("vIlp"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-drop-zone/index.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -/** @typedef {import('../../utils/math').WPPoint} WPPoint */ - -/** - * The orientation of a block list. - * - * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation - */ - -/** - * Given a list of block DOM elements finds the index that a block should be dropped - * at. - * - * @param {Element[]} elements Array of DOM elements that represent each block in a block list. - * @param {WPPoint} position The position of the item being dragged. - * @param {WPBlockListOrientation} orientation The orientation of a block list. - * - * @return {number|undefined} The block index that's closest to the drag position. - */ - -function getNearestBlockIndex(elements, position, orientation) { - const allowedEdges = orientation === 'horizontal' ? ['left', 'right'] : ['top', 'bottom']; - const isRightToLeft = Object(external_wp_i18n_["isRTL"])(); - let candidateIndex; - let candidateDistance; - elements.forEach((element, index) => { - const rect = element.getBoundingClientRect(); - const [distance, edge] = Object(math["a" /* getDistanceToNearestEdge */])(position, rect, allowedEdges); - - if (candidateDistance === undefined || distance < candidateDistance) { - // If the user is dropping to the trailing edge of the block - // add 1 to the index to represent dragging after. - // Take RTL languages into account where the left edge is - // the trailing edge. - const isTrailingEdge = edge === 'bottom' || !isRightToLeft && edge === 'right' || isRightToLeft && edge === 'left'; - const offset = isTrailingEdge ? 1 : 0; // Update the currently known best candidate. - - candidateDistance = distance; - candidateIndex = index + offset; - } - }); - return candidateIndex; -} -/** - * @typedef {Object} WPBlockDropZoneConfig - * @property {string} rootClientId The root client id for the block list. - */ - -/** - * A React hook that can be used to make a block list handle drag and drop. - * - * @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone. - */ - -function useBlockDropZone() { - let { - // An undefined value represents a top-level block. Default to an empty - // string for this so that `targetRootClientId` can be easily compared to - // values returned by the `getRootBlockClientId` selector, which also uses - // an empty string to represent top-level blocks. - rootClientId: targetRootClientId = '' - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const [targetBlockIndex, setTargetBlockIndex] = Object(external_wp_element_["useState"])(null); - const isLockedAll = Object(external_wp_data_["useSelect"])(select => { - const { - getTemplateLock - } = select(store["a" /* store */]); - return getTemplateLock(targetRootClientId) === 'all'; - }, [targetRootClientId]); - const { - getBlockListSettings - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); - const { - showInsertionPoint, - hideInsertionPoint - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const onBlockDrop = Object(use_on_block_drop["a" /* default */])(targetRootClientId, targetBlockIndex); - const throttled = Object(external_wp_compose_["useThrottle"])(Object(external_wp_element_["useCallback"])((event, currentTarget) => { - var _getBlockListSettings; - - const blockElements = Array.from(currentTarget.children).filter( // Ensure the element is a block. It should have the `wp-block` class. - element => element.classList.contains('wp-block')); - const targetIndex = getNearestBlockIndex(blockElements, { - x: event.clientX, - y: event.clientY - }, (_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation); - setTargetBlockIndex(targetIndex === undefined ? 0 : targetIndex); - - if (targetIndex !== null) { - showInsertionPoint(targetRootClientId, targetIndex); - } - }, []), 200); - return Object(external_wp_compose_["__experimentalUseDropZone"])({ - isDisabled: isLockedAll, - onDrop: onBlockDrop, - - onDragOver(event) { - // `currentTarget` is only available while the event is being - // handled, so get it now and pass it to the thottled function. - // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget - throttled(event, event.currentTarget); - }, - - onDragLeave() { - throttled.cancel(); - hideInsertionPoint(); - setTargetBlockIndex(null); - }, - - onDragEnd() { - throttled.cancel(); - hideInsertionPoint(); - setTargetBlockIndex(null); - } - - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - -/** - * InnerBlocks is a component which allows a single block to have multiple blocks - * as children. The UncontrolledInnerBlocks component is used whenever the inner - * blocks are not controlled by another entity. In other words, it is normally - * used for inner blocks in the post editor - * - * @param {Object} props The component props. - */ - -function UncontrolledInnerBlocks(props) { - const { - clientId, - allowedBlocks, - __experimentalDefaultBlock, - __experimentalDirectInsert, - template, - templateLock, - wrapperRef, - templateInsertUpdatesSelection, - __experimentalCaptureToolbars: captureToolbars, - __experimentalAppenderTagName, - renderAppender, - orientation, - placeholder, - __experimentalLayout - } = props; - useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, __experimentalLayout); - useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection); - const context = Object(external_wp_data_["useSelect"])(select => { - const block = select(store["a" /* store */]).getBlock(clientId); - const blockType = Object(external_wp_blocks_["getBlockType"])(block.name); - - if (!blockType || !blockType.providesContext) { - return; - } - - return getBlockContext(block.attributes, blockType); - }, [clientId]); // This component needs to always be synchronous as it's the one changing - // the async mode depending on the block selection. - - return Object(external_wp_element_["createElement"])(block_context["a" /* BlockContextProvider */], { - value: context - }, Object(external_wp_element_["createElement"])(block_list["a" /* BlockListItems */], { - rootClientId: clientId, - renderAppender: renderAppender, - __experimentalAppenderTagName: __experimentalAppenderTagName, - __experimentalLayout: __experimentalLayout, - wrapperRef: wrapperRef, - placeholder: placeholder - })); -} -/** - * The controlled inner blocks component wraps the uncontrolled inner blocks - * component with the blockSync hook. This keeps the innerBlocks of the block in - * the block-editor store in sync with the blocks of the controlling entity. An - * example of an inner block controller is a template part block, which provides - * its own blocks from the template part entity data source. - * - * @param {Object} props The component props. - */ - - -function ControlledInnerBlocks(props) { - Object(use_block_sync["a" /* default */])(props); - return Object(external_wp_element_["createElement"])(UncontrolledInnerBlocks, props); -} - -const ForwardedInnerBlocks = Object(external_wp_element_["forwardRef"])((props, ref) => { - const innerBlocksProps = useInnerBlocksProps({ - ref - }, props); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inner-blocks" - }, Object(external_wp_element_["createElement"])("div", innerBlocksProps)); -}); -/** - * This hook is used to lightly mark an element as an inner blocks wrapper - * element. Call this hook and pass the returned props to the element to mark as - * an inner blocks wrapper, automatically rendering inner blocks as children. If - * you define a ref for the element, it is important to pass the ref to this - * hook, which the hook in turn will pass to the component through the props it - * returns. Optionally, you can also pass any other props through this hook, and - * they will be merged and returned. - * - * @param {Object} props Optional. Props to pass to the element. Must contain - * the ref if one is defined. - * @param {Object} options Optional. Inner blocks options. - * - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md - */ - -function useInnerBlocksProps() { - let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const { - clientId - } = Object(block_edit_context["c" /* useBlockEditContext */])(); - const isSmallScreen = Object(external_wp_compose_["useViewportMatch"])('medium', '<'); - const { - __experimentalCaptureToolbars, - hasOverlay - } = Object(external_wp_data_["useSelect"])(select => { - if (!clientId) { - return {}; - } - - const { - getBlockName, - isBlockSelected, - hasSelectedInnerBlock, - isNavigationMode - } = select(store["a" /* store */]); - const blockName = getBlockName(clientId); - const enableClickThrough = isNavigationMode() || isSmallScreen; - return { - __experimentalCaptureToolbars: select(external_wp_blocks_["store"]).hasBlockSupport(blockName, '__experimentalExposeControlsToChildren', false), - hasOverlay: blockName !== 'core/template' && !isBlockSelected(clientId) && !hasSelectedInnerBlock(clientId, true) && enableClickThrough - }; - }, [clientId, isSmallScreen]); - const ref = Object(external_wp_compose_["useMergeRefs"])([props.ref, useBlockDropZone({ - rootClientId: clientId - })]); - const innerBlocksProps = { - __experimentalCaptureToolbars, - ...options - }; - const InnerBlocks = innerBlocksProps.value && innerBlocksProps.onChange ? ControlledInnerBlocks : UncontrolledInnerBlocks; - return { ...props, - ref, - className: classnames_default()(props.className, 'block-editor-block-list__layout', { - 'has-overlay': hasOverlay - }), - children: clientId ? Object(external_wp_element_["createElement"])(InnerBlocks, Object(esm_extends["a" /* default */])({}, innerBlocksProps, { - clientId: clientId - })) : Object(external_wp_element_["createElement"])(block_list["a" /* BlockListItems */], options) - }; -} -useInnerBlocksProps.save = external_wp_blocks_["__unstableGetInnerBlocksProps"]; // Expose default appender placeholders as components. - -ForwardedInnerBlocks.DefaultBlockAppender = inner_blocks_default_block_appender; -ForwardedInnerBlocks.ButtonBlockAppender = inner_blocks_button_block_appender; - -ForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children; -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md - */ - - -/* harmony default export */ var inner_blocks = __webpack_exports__["a"] = (ForwardedInnerBlocks); - - -/***/ }), - -/***/ "pOGT": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export getNormalizedSearchTerms */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return searchBlockItems; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return searchItems; }); -/* unused harmony export getItemSearchRank */ -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/** - * External dependencies - */ - // Default search helpers - -const defaultGetName = item => item.name || ''; - -const defaultGetTitle = item => item.title; - -const defaultGetDescription = item => item.description || ''; - -const defaultGetKeywords = item => item.keywords || []; - -const defaultGetCategory = item => item.category; - -const defaultGetCollection = () => null; -/** - * Sanitizes the search input string. - * - * @param {string} input The search input to normalize. - * - * @return {string} The normalized search input. - */ - - -function normalizeSearchInput() { - let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - // Disregard diacritics. - // Input: "média" - input = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["deburr"])(input); // Accommodate leading slash, matching autocomplete expectations. - // Input: "/media" - - input = input.replace(/^\//, ''); // Lowercase. - // Input: "MEDIA" - - input = input.toLowerCase(); - return input; -} -/** - * Converts the search term into a list of normalized terms. - * - * @param {string} input The search term to normalize. - * - * @return {string[]} The normalized list of search terms. - */ - - -const getNormalizedSearchTerms = function () { - let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - // Extract words. - return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["words"])(normalizeSearchInput(input)); -}; - -const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { - return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["differenceWith"])(unmatchedTerms, getNormalizedSearchTerms(unprocessedTerms), (unmatchedTerm, unprocessedTerm) => unprocessedTerm.includes(unmatchedTerm)); -}; - -const searchBlockItems = (items, categories, collections, searchInput) => { - const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); - - if (normalizedSearchTerms.length === 0) { - return items; - } - - const config = { - getCategory: item => { - var _find; - - return (_find = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(categories, { - slug: item.category - })) === null || _find === void 0 ? void 0 : _find.title; - }, - getCollection: item => { - var _collections$item$nam; - - return (_collections$item$nam = collections[item.name.split('/')[0]]) === null || _collections$item$nam === void 0 ? void 0 : _collections$item$nam.title; - } - }; - return searchItems(items, searchInput, config); -}; -/** - * 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 = function () { - let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let searchInput = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); - - if (normalizedSearchTerms.length === 0) { - return items; - } - - const rankedItems = items.map(item => { - return [item, getItemSearchRank(item, searchInput, config)]; - }).filter(_ref => { - let [, rank] = _ref; - return rank > 0; - }); - rankedItems.sort((_ref2, _ref3) => { - let [, rank1] = _ref2; - let [, rank2] = _ref3; - return rank2 - rank1; - }); - return rankedItems.map(_ref4 => { - let [item] = _ref4; - return 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) { - let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - const { - getName = defaultGetName, - getTitle = defaultGetTitle, - getDescription = defaultGetDescription, - getKeywords = defaultGetKeywords, - getCategory = defaultGetCategory, - getCollection = defaultGetCollection - } = config; - const name = getName(item); - const title = getTitle(item); - const description = getDescription(item); - const keywords = getKeywords(item); - const category = getCategory(item); - const collection = getCollection(item); - const normalizedSearchInput = normalizeSearchInput(searchTerm); - const normalizedTitle = normalizeSearchInput(title); - let rank = 0; // Prefers exact matches - // Then prefers if the beginning of the title matches the search term - // name, keywords, categories, collection, variations match come later. - - if (normalizedSearchInput === normalizedTitle) { - rank += 30; - } else if (normalizedTitle.startsWith(normalizedSearchInput)) { - rank += 20; - } else { - const terms = [name, title, description, ...keywords, category, collection].join(' '); - const normalizedSearchTerms = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["words"])(normalizedSearchInput); - const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); - - if (unmatchedTerms.length === 0) { - rank += 10; - } - } // Give a better rank to "core" namespaced items. - - - if (rank !== 0 && name.startsWith('core/')) { - rank++; - } - - return rank; -} - - -/***/ }), - -/***/ "pPDe": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - - -var LEAF_KEY, hasWeakMap; - -/** - * Arbitrary value used as key for referencing cache object in WeakMap tree. - * - * @type {Object} - */ -LEAF_KEY = {}; - -/** - * Whether environment supports WeakMap. - * - * @type {boolean} - */ -hasWeakMap = typeof WeakMap !== 'undefined'; - -/** - * Returns the first argument as the sole entry in an array. - * - * @param {*} value Value to return. - * - * @return {Array} Value returned as entry in array. - */ -function arrayOf( value ) { - return [ value ]; -} - -/** - * Returns true if the value passed is object-like, or false otherwise. A value - * is object-like if it can support property assignment, e.g. object or array. - * - * @param {*} value Value to test. - * - * @return {boolean} Whether value is object-like. - */ -function isObjectLike( value ) { - return !! value && 'object' === typeof value; -} - -/** - * Creates and returns a new cache object. - * - * @return {Object} Cache object. - */ -function createCache() { - var cache = { - clear: function() { - cache.head = null; - }, - }; - - return cache; -} - -/** - * Returns true if entries within the two arrays are strictly equal by - * reference from a starting index. - * - * @param {Array} a First array. - * @param {Array} b Second array. - * @param {number} fromIndex Index from which to start comparison. - * - * @return {boolean} Whether arrays are shallowly equal. - */ -function isShallowEqual( a, b, fromIndex ) { - var i; - - if ( a.length !== b.length ) { - return false; - } - - for ( i = fromIndex; i < a.length; i++ ) { - if ( a[ i ] !== b[ i ] ) { - return false; - } - } - - return true; -} - -/** - * Returns a memoized selector function. The getDependants function argument is - * called before the memoized selector and is expected to return an immutable - * reference or array of references on which the selector depends for computing - * its own return value. The memoize cache is preserved only as long as those - * dependant references remain the same. If getDependants returns a different - * reference(s), the cache is cleared and the selector value regenerated. - * - * @param {Function} selector Selector function. - * @param {Function} getDependants Dependant getter returning an immutable - * reference or array of reference used in - * cache bust consideration. - * - * @return {Function} Memoized selector. - */ -/* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) { - var rootCache, getCache; - - // Use object source as dependant if getter not provided - if ( ! getDependants ) { - getDependants = arrayOf; - } - - /** - * Returns the root cache. If WeakMap is supported, this is assigned to the - * root WeakMap cache set, otherwise it is a shared instance of the default - * cache object. - * - * @return {(WeakMap|Object)} Root cache object. - */ - function getRootCache() { - return rootCache; - } - - /** - * Returns the cache for a given dependants array. When possible, a WeakMap - * will be used to create a unique cache for each set of dependants. This - * is feasible due to the nature of WeakMap in allowing garbage collection - * to occur on entries where the key object is no longer referenced. Since - * WeakMap requires the key to be an object, this is only possible when the - * dependant is object-like. The root cache is created as a hierarchy where - * each top-level key is the first entry in a dependants set, the value a - * WeakMap where each key is the next dependant, and so on. This continues - * so long as the dependants are object-like. If no dependants are object- - * like, then the cache is shared across all invocations. - * - * @see isObjectLike - * - * @param {Array} dependants Selector dependants. - * - * @return {Object} Cache object. - */ - function getWeakMapCache( dependants ) { - var caches = rootCache, - isUniqueByDependants = true, - i, dependant, map, cache; - - for ( i = 0; i < dependants.length; i++ ) { - dependant = dependants[ i ]; - - // Can only compose WeakMap from object-like key. - if ( ! isObjectLike( dependant ) ) { - isUniqueByDependants = false; - break; - } - - // Does current segment of cache already have a WeakMap? - if ( caches.has( dependant ) ) { - // Traverse into nested WeakMap. - caches = caches.get( dependant ); - } else { - // Create, set, and traverse into a new one. - map = new WeakMap(); - caches.set( dependant, map ); - caches = map; - } - } - - // We use an arbitrary (but consistent) object as key for the last item - // in the WeakMap to serve as our running cache. - if ( ! caches.has( LEAF_KEY ) ) { - cache = createCache(); - cache.isUniqueByDependants = isUniqueByDependants; - caches.set( LEAF_KEY, cache ); - } - - return caches.get( LEAF_KEY ); - } - - // Assign cache handler by availability of WeakMap - getCache = hasWeakMap ? getWeakMapCache : getRootCache; - - /** - * Resets root memoization cache. - */ - function clear() { - rootCache = hasWeakMap ? new WeakMap() : createCache(); - } - - // eslint-disable-next-line jsdoc/check-param-names - /** - * The augmented selector call, considering first whether dependants have - * changed before passing it to underlying memoize function. - * - * @param {Object} source Source object for derivation. - * @param {...*} extraArgs Additional arguments to pass to selector. - * - * @return {*} Selector result. - */ - function callSelector( /* source, ...extraArgs */ ) { - var len = arguments.length, - cache, node, i, args, dependants; - - // Create copy of arguments (avoid leaking deoptimization). - args = new Array( len ); - for ( i = 0; i < len; i++ ) { - args[ i ] = arguments[ i ]; - } - - dependants = getDependants.apply( null, args ); - cache = getCache( dependants ); - - // If not guaranteed uniqueness by dependants (primitive type or lack - // of WeakMap support), shallow compare against last dependants and, if - // references have changed, destroy cache to recalculate result. - if ( ! cache.isUniqueByDependants ) { - if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) { - cache.clear(); - } - - cache.lastDependants = dependants; - } - - node = cache.head; - while ( node ) { - // Check whether node arguments match arguments - if ( ! isShallowEqual( node.args, args, 1 ) ) { - node = node.next; - continue; - } - - // At this point we can assume we've found a match - - // Surface matched node to head if not already - if ( node !== cache.head ) { - // Adjust siblings to point to each other. - node.prev.next = node.next; - if ( node.next ) { - node.next.prev = node.prev; - } - - node.next = cache.head; - node.prev = null; - cache.head.prev = node; - cache.head = node; - } - - // Return immediately - return node.val; - } - - // No cached value found. Continue to insertion phase: - - node = { - // Generate the result from original function - val: selector.apply( null, args ), - }; - - // Avoid including the source object in the cache. - args[ 0 ] = null; - node.args = args; - - // Don't need to check whether node is already head, since it would - // have been returned above already if it was - - // Shift existing head down list - if ( cache.head ) { - cache.head.prev = node; - node.next = cache.head; - } - - cache.head = node; - - return node.val; - } - - callSelector.getDependants = getDependants; - callSelector.clear = clear; - clear(); - - return callSelector; -}); - - -/***/ }), - -/***/ "pXCJ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * Contains the properties `ConvertToGroupButton` component needs. - * - * @typedef {Object} ConvertToGroupButtonProps - * @property {string[]} clientIds An array of the selected client ids. - * @property {boolean} isGroupable Indicates if the selected blocks can be grouped. - * @property {boolean} isUngroupable Indicates if the selected blocks can be ungrouped. - * @property {WPBlock[]} blocksSelection An array of the selected blocks. - * @property {string} groupingBlockName The name of block used for handling grouping interactions. - */ - -/** - * Returns the properties `ConvertToGroupButton` component needs to work properly. - * It is used in `BlockSettingsMenuControls` to know if `ConvertToGroupButton` - * should be rendered, to avoid ending up with an empty MenuGroup. - * - * @return {ConvertToGroupButtonProps} Returns the properties needed by `ConvertToGroupButton`. - */ - -function useConvertToGroupButtonProps() { - const { - clientIds, - isGroupable, - isUngroupable, - blocksSelection, - groupingBlockName - } = Object(external_wp_data_["useSelect"])(select => { - var _blocksSelection$; - - const { - getBlockRootClientId, - getBlocksByClientId, - canInsertBlockType, - getSelectedBlockClientIds - } = select(store["a" /* store */]); - const { - getGroupingBlockName - } = select(external_wp_blocks_["store"]); - - const _clientIds = getSelectedBlockClientIds(); - - const _groupingBlockName = getGroupingBlockName(); - - const rootClientId = !!(_clientIds !== null && _clientIds !== void 0 && _clientIds.length) ? getBlockRootClientId(_clientIds[0]) : undefined; - const groupingBlockAvailable = canInsertBlockType(_groupingBlockName, rootClientId); - - const _blocksSelection = getBlocksByClientId(_clientIds); - - const isSingleGroupingBlock = _blocksSelection.length === 1 && ((_blocksSelection$ = _blocksSelection[0]) === null || _blocksSelection$ === void 0 ? void 0 : _blocksSelection$.name) === _groupingBlockName; // Do we have - // 1. Grouping block available to be inserted? - // 2. One or more blocks selected - // (we allow single Blocks to become groups unless - // they are a soltiary group block themselves) - - const _isGroupable = groupingBlockAvailable && _blocksSelection.length && !isSingleGroupingBlock; // Do we have a single Group Block selected and does that group have inner blocks? - - - const _isUngroupable = isSingleGroupingBlock && !!_blocksSelection[0].innerBlocks.length; - - return { - clientIds: _clientIds, - isGroupable: _isGroupable, - isUngroupable: _isUngroupable, - blocksSelection: _blocksSelection, - groupingBlockName: _groupingBlockName - }; - }, []); - return { - clientIds, - isGroupable, - isUngroupable, - blocksSelection, - groupingBlockName - }; -} - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/index.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -function ConvertToGroupButton(_ref) { - let { - clientIds, - isGroupable, - isUngroupable, - blocksSelection, - groupingBlockName, - onClose = () => {} - } = _ref; - const { - replaceBlocks - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - - const onConvertToGroup = () => { - // Activate the `transform` on the Grouping Block which does the conversion - const newBlocks = Object(external_wp_blocks_["switchToBlockType"])(blocksSelection, groupingBlockName); - - if (newBlocks) { - replaceBlocks(clientIds, newBlocks); - } - }; - - const onConvertFromGroup = () => { - const innerBlocks = blocksSelection[0].innerBlocks; - - if (!innerBlocks.length) { - return; - } - - replaceBlocks(clientIds, innerBlocks); - }; - - if (!isGroupable && !isUngroupable) { - return null; - } - - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isGroupable && Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: () => { - onConvertToGroup(); - onClose(); - } - }, Object(external_wp_i18n_["_x"])('Group', 'verb')), isUngroupable && Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - onClick: () => { - onConvertFromGroup(); - onClose(); - } - }, Object(external_wp_i18n_["_x"])('Ungroup', 'Ungrouping blocks from within a Group block back into individual blocks within the Editor '))); -} - - - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -const { - Fill, - Slot -} = Object(external_wp_components_["createSlotFill"])('BlockSettingsMenuControls'); - -const BlockSettingsMenuControlsSlot = _ref => { - let { - fillProps, - clientIds = null - } = _ref; - const { - selectedBlocks, - selectedClientIds - } = Object(external_wp_data_["useSelect"])(select => { - const { - getBlocksByClientId, - getSelectedBlockClientIds - } = select(store["a" /* store */]); - const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds(); - return { - selectedBlocks: Object(external_lodash_["map"])(Object(external_lodash_["compact"])(getBlocksByClientId(ids)), block => block.name), - selectedClientIds: ids - }; - }, [clientIds]); // Check if current selection of blocks is Groupable or Ungroupable - // and pass this props down to ConvertToGroupButton. - - const convertToGroupButtonProps = useConvertToGroupButtonProps(); - const { - isGroupable, - isUngroupable - } = convertToGroupButtonProps; - const showConvertToGroupButton = isGroupable || isUngroupable; - return Object(external_wp_element_["createElement"])(Slot, { - fillProps: { ...fillProps, - selectedBlocks, - selectedClientIds - } - }, fills => { - if ((fills === null || fills === void 0 ? void 0 : fills.length) > 0 || showConvertToGroupButton) { - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, fills, Object(external_wp_element_["createElement"])(ConvertToGroupButton, Object(esm_extends["a" /* default */])({}, convertToGroupButtonProps, { - onClose: fillProps === null || fillProps === void 0 ? void 0 : fillProps.onClose - }))); - } - }); -}; -/** - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md - * - * @param {Object} props Fill props. - * @return {WPElement} Element. - */ - - -function BlockSettingsMenuControls(_ref2) { - let { ...props - } = _ref2; - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalStyleProvider"], { - document: document - }, Object(external_wp_element_["createElement"])(Fill, props)); -} - -BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot; -/* harmony default export */ var block_settings_menu_controls = __webpack_exports__["a"] = (BlockSettingsMenuControls); - - -/***/ }), - -/***/ "pY5h": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useCommonSingleMultipleSelects; }); -/* harmony import */ var _use_setting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("v5LD"); -/** - * Internal dependencies - */ - -function useCommonSingleMultipleSelects() { - return { - disableCustomColors: !Object(_use_setting__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])('color.custom'), - disableCustomGradients: !Object(_use_setting__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])('color.customGradient') - }; -} - - -/***/ }), - -/***/ "plpT": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const alignCenter = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (alignCenter); - - -/***/ }), - -/***/ "q3tz": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlockDraggableChip; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("xN+R"); -/* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("7SSY"); - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function BlockDraggableChip(_ref) { - let { - count, - icon - } = _ref; - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-block-draggable-chip-wrapper" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { - className: "block-editor-block-draggable-chip" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Flex"], { - justify: "center", - className: "block-editor-block-draggable-chip__content" - }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["FlexItem"], null, icon ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], { - icon: icon - }) : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["sprintf"])( - /* translators: %d: Number of blocks. */ - Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_n"])('%d block', '%d blocks', count), count)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["FlexItem"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], { - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"] - }))))); -} - - -/***/ }), - -/***/ "qRz9": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["richText"]; }()); - -/***/ }), - -/***/ "qrxh": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","a11y"] -var external_wp_a11y_ = __webpack_require__("gdqT"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js -var plus = __webpack_require__("Q4Sy"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/menu.js + 10 modules -var menu = __webpack_require__("xZzQ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-results.js -var search_results = __webpack_require__("Wg7J"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js -var use_insertion_point = __webpack_require__("AORF"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-state.js -var use_patterns_state = __webpack_require__("nQUx"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-block-types-state.js -var use_block_types_state = __webpack_require__("+G0a"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/quick-inserter.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - -const SEARCH_THRESHOLD = 6; -const SHOWN_BLOCK_TYPES = 6; -const SHOWN_BLOCK_PATTERNS = 2; -function QuickInserter(_ref) { - let { - onSelect, - rootClientId, - clientId, - isAppender - } = _ref; - const [filterValue, setFilterValue] = Object(external_wp_element_["useState"])(''); - const [destinationRootClientId, onInsertBlocks] = Object(use_insertion_point["a" /* default */])({ - onSelect, - rootClientId, - clientId, - isAppender - }); - const [blockTypes] = Object(use_block_types_state["a" /* default */])(destinationRootClientId, onInsertBlocks); - const [patterns] = Object(use_patterns_state["a" /* default */])(onInsertBlocks, destinationRootClientId); - const showPatterns = patterns.length && !!filterValue; - const showSearch = showPatterns && patterns.length > SEARCH_THRESHOLD || blockTypes.length > SEARCH_THRESHOLD; - const { - setInserterIsOpened, - insertionIndex - } = Object(external_wp_data_["useSelect"])(select => { - const { - getSettings, - getBlockIndex, - getBlockCount - } = select(store["a" /* store */]); - const index = getBlockIndex(clientId); - return { - setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened, - insertionIndex: index === -1 ? getBlockCount() : index - }; - }, [clientId, rootClientId]); - Object(external_wp_element_["useEffect"])(() => { - if (setInserterIsOpened) { - setInserterIsOpened(false); - } - }, [setInserterIsOpened]); // When clicking Browse All select the appropriate block so as - // the insertion point can work as expected - - const onBrowseAll = () => { - setInserterIsOpened({ - rootClientId, - insertionIndex, - filterValue - }); - }; - - return Object(external_wp_element_["createElement"])("div", { - className: classnames_default()('block-editor-inserter__quick-inserter', { - 'has-search': showSearch, - 'has-expand': setInserterIsOpened - }) - }, showSearch && Object(external_wp_element_["createElement"])(external_wp_components_["SearchControl"], { - className: "block-editor-inserter__search", - value: filterValue, - onChange: value => { - setFilterValue(value); - }, - label: Object(external_wp_i18n_["__"])('Search for blocks and patterns'), - placeholder: Object(external_wp_i18n_["__"])('Search') - }), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__quick-inserter-results" - }, Object(external_wp_element_["createElement"])(search_results["a" /* default */], { - filterValue: filterValue, - onSelect: onSelect, - rootClientId: rootClientId, + removeBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const onRemove = (0,external_wp_element_namespaceObject.useCallback)(() => removeBlock(clientId), [clientId]); // We wrap the BlockEdit component in a div that hides it when editing in + // HTML mode. This allows us to render all of the ancillary pieces + // (InspectorControls, etc.) which are inside `BlockEdit` but not + // `BlockHTML`, even in HTML mode. + + let blockEdit = (0,external_wp_element_namespaceObject.createElement)(BlockEdit, { + name: name, + isSelected: isSelected, + attributes: attributes, + setAttributes: setAttributes, + insertBlocksAfter: isLocked ? undefined : onInsertBlocksAfter, + onReplace: canRemove ? onReplace : undefined, + onRemove: canRemove ? onRemove : undefined, + mergeBlocks: canRemove ? onMerge : undefined, clientId: clientId, - isAppender: isAppender, - maxBlockPatterns: showPatterns ? SHOWN_BLOCK_PATTERNS : 0, - maxBlockTypes: SHOWN_BLOCK_TYPES, - isDraggable: false - })), setInserterIsOpened && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: "block-editor-inserter__quick-inserter-expand", - onClick: onBrowseAll, - "aria-label": Object(external_wp_i18n_["__"])('Browse all. This will open the main inserter panel in the editor toolbar.') - }, Object(external_wp_i18n_["__"])('Browse all'))); -} + isSelectionEnabled: isSelectionEnabled, + toggleSelection: toggleSelection + }); + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); // Determine whether the block has props to apply to the wrapper. -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js + if (blockType !== null && blockType !== void 0 && blockType.getEditWrapperProps) { + wrapperProps = mergeWrapperProps(wrapperProps, blockType.getEditWrapperProps(attributes)); + } + const isAligned = wrapperProps && !!wrapperProps['data-align']; // For aligned blocks, provide a wrapper element so the block can be + // positioned relative to the block column. + if (isAligned) { + blockEdit = (0,external_wp_element_namespaceObject.createElement)("div", { + className: "wp-block", + "data-align": wrapperProps['data-align'] + }, blockEdit); + } -/** - * External dependencies - */ + let block; - -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - - -const defaultRenderToggle = _ref => { - let { - onToggle, - disabled, - isOpen, - blockTitle, - hasSingleBlockType, - toggleProps = {} - } = _ref; - let label; - - if (hasSingleBlockType) { - label = Object(external_wp_i18n_["sprintf"])( // translators: %s: the name of the block when there is only one - Object(external_wp_i18n_["_x"])('Add %s', 'directly add the only allowed block'), blockTitle); + if (!isValid) { + const saveContent = (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes); + block = (0,external_wp_element_namespaceObject.createElement)(Block, { + className: "has-warning" + }, (0,external_wp_element_namespaceObject.createElement)(block_invalid_warning, { + clientId: clientId + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(saveContent))); + } else if (mode === 'html') { + // Render blockEdit so the inspector controls don't disappear. + // See #8969. + block = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", { + style: { + display: 'none' + } + }, blockEdit), (0,external_wp_element_namespaceObject.createElement)(Block, { + isHtml: true + }, (0,external_wp_element_namespaceObject.createElement)(block_html, { + clientId: clientId + }))); + } else if ((blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) > 1) { + block = blockEdit; } else { - label = Object(external_wp_i18n_["_x"])('Add block', 'Generic label for block inserter button'); - } - - const { - onClick, - ...rest - } = toggleProps; // Handle both onClick functions from the toggle and the parent component - - function handleClick(event) { - if (onToggle) { - onToggle(event); - } - - if (onClick) { - onClick(event); - } - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({ - icon: plus["a" /* default */], - label: label, - tooltipPosition: "bottom", - onClick: handleClick, - className: "block-editor-inserter__toggle", - "aria-haspopup": !hasSingleBlockType ? 'true' : false, - "aria-expanded": !hasSingleBlockType ? isOpen : false, - disabled: disabled - }, rest)); -}; - -class inserter_Inserter extends external_wp_element_["Component"] { - constructor() { - super(...arguments); - this.onToggle = this.onToggle.bind(this); - this.renderToggle = this.renderToggle.bind(this); - this.renderContent = this.renderContent.bind(this); - } - - onToggle(isOpen) { - const { - onToggle - } = this.props; // Surface toggle callback to parent component - - if (onToggle) { - onToggle(isOpen); - } - } - /** - * Render callback to display Dropdown toggle element. - * - * @param {Object} options - * @param {Function} options.onToggle Callback to invoke when toggle is - * pressed. - * @param {boolean} options.isOpen Whether dropdown is currently open. - * - * @return {WPElement} Dropdown toggle element. - */ - - - renderToggle(_ref2) { - let { - onToggle, - isOpen - } = _ref2; - const { - disabled, - blockTitle, - hasSingleBlockType, - directInsertBlock, - toggleProps, - hasItems, - renderToggle = defaultRenderToggle - } = this.props; - return renderToggle({ - onToggle, - isOpen, - disabled: disabled || !hasItems, - blockTitle, - hasSingleBlockType, - directInsertBlock, - toggleProps - }); - } - /** - * Render callback to display Dropdown content element. - * - * @param {Object} options - * @param {Function} options.onClose Callback to invoke when dropdown is - * closed. - * - * @return {WPElement} Dropdown content element. - */ - - - renderContent(_ref3) { - let { - onClose - } = _ref3; - const { - rootClientId, - clientId, - isAppender, - showInserterHelpPanel, - // This prop is experimental to give some time for the quick inserter to mature - // Feel free to make them stable after a few releases. - __experimentalIsQuick: isQuick - } = this.props; - - if (isQuick) { - return Object(external_wp_element_["createElement"])(QuickInserter, { - onSelect: () => { - onClose(); - }, - rootClientId: rootClientId, - clientId: clientId, - isAppender: isAppender - }); - } - - return Object(external_wp_element_["createElement"])(menu["a" /* default */], { - onSelect: () => { - onClose(); - }, - rootClientId: rootClientId, - clientId: clientId, - isAppender: isAppender, - showInserterHelpPanel: showInserterHelpPanel - }); - } - - render() { - const { - position, - hasSingleBlockType, - directInsertBlock, - insertOnlyAllowedBlock, - __experimentalIsQuick: isQuick, - onSelectOrClose - } = this.props; - - if (hasSingleBlockType || directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length) { - return this.renderToggle({ - onToggle: insertOnlyAllowedBlock - }); - } - - return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { - className: "block-editor-inserter", - contentClassName: classnames_default()('block-editor-inserter__popover', { - 'is-quick': isQuick - }), - position: position, - onToggle: this.onToggle, - expandOnMobile: true, - headerTitle: Object(external_wp_i18n_["__"])('Add a block'), - renderToggle: this.renderToggle, - renderContent: this.renderContent, - onClose: onSelectOrClose - }); + block = (0,external_wp_element_namespaceObject.createElement)(Block, wrapperProps, blockEdit); } + const value = { + clientId, + className, + wrapperProps: (0,external_lodash_namespaceObject.omit)(wrapperProps, ['data-align']), + isAligned + }; + const memoizedValue = (0,external_wp_element_namespaceObject.useMemo)(() => value, Object.values(value)); + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlockContext.Provider, { + value: memoizedValue + }, (0,external_wp_element_namespaceObject.createElement)(block_crash_boundary, { + fallback: (0,external_wp_element_namespaceObject.createElement)(Block, { + className: "has-warning" + }, (0,external_wp_element_namespaceObject.createElement)(block_crash_warning, null)) + }, block)); } -/* harmony default export */ var inserter = __webpack_exports__["a"] = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, _ref4) => { +const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)((select, _ref3) => { let { clientId, rootClientId - } = _ref4; + } = _ref3; const { - getBlockRootClientId, - hasInserterItems, - __experimentalGetAllowedBlocks, - __experimentalGetDirectInsertBlock - } = select(store["a" /* store */]); + isBlockSelected, + getBlockMode, + isSelectionEnabled, + getTemplateLock, + __unstableGetBlockWithoutInnerBlocks, + canRemoveBlock, + canMoveBlock + } = select(store); + + const block = __unstableGetBlockWithoutInnerBlocks(clientId); + + const isSelected = isBlockSelected(clientId); + const templateLock = getTemplateLock(rootClientId); + const canRemove = canRemoveBlock(clientId, rootClientId); + const canMove = canMoveBlock(clientId, rootClientId); // The fallback to `{}` is a temporary fix. + // This function should never be called when a block is not present in + // the state. It happens now because the order in withSelect rendering + // is not correct. + const { - getBlockVariations - } = select(external_wp_blocks_["store"]); - rootClientId = rootClientId || getBlockRootClientId(clientId) || undefined; - - const allowedBlocks = __experimentalGetAllowedBlocks(rootClientId); - - const directInsertBlock = __experimentalGetDirectInsertBlock(rootClientId); - - const hasSingleBlockType = Object(external_lodash_["size"])(allowedBlocks) === 1 && Object(external_lodash_["size"])(getBlockVariations(allowedBlocks[0].name, 'inserter')) === 0; - let allowedBlockType = false; - - if (hasSingleBlockType) { - allowedBlockType = allowedBlocks[0]; - } + name, + attributes, + isValid + } = block || {}; // Do not add new properties here, use `useSelect` instead to avoid + // leaking new props to the public API (editor.BlockListBlock filter). return { - hasItems: hasInserterItems(rootClientId), - hasSingleBlockType, - blockTitle: allowedBlockType ? allowedBlockType.title : '', - allowedBlockType, - directInsertBlock, - rootClientId + mode: getBlockMode(clientId), + isSelectionEnabled: isSelectionEnabled(), + isLocked: !!templateLock, + canRemove, + canMove, + // Users of the editor.BlockListBlock filter used to be able to + // access the block prop. + // Ideally these blocks would rely on the clientId prop only. + // This is kept for backward compatibility reasons. + block, + name, + attributes, + isValid, + isSelected }; -}), Object(external_wp_data_["withDispatch"])((dispatch, ownProps, _ref5) => { +}); +const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, _ref4) => { let { select - } = _ref5; - return { - insertOnlyAllowedBlock() { - const { - rootClientId, - clientId, - isAppender, - hasSingleBlockType, - allowedBlockType, - directInsertBlock, - onSelectOrClose - } = ownProps; + } = _ref4; + const { + updateBlockAttributes, + insertBlocks, + mergeBlocks, + replaceBlocks, + toggleSelection, + __unstableMarkLastChangeAsPersistent + } = dispatch(store); // Do not add new properties here, use `useDispatch` instead to avoid + // leaking new props to the public API (editor.BlockListBlock filter). - if (!hasSingleBlockType && !(directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length)) { + return { + setAttributes(newAttributes) { + const { + getMultiSelectedBlockClientIds + } = select(store); + const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(); + const { + clientId + } = ownProps; + const clientIds = multiSelectedBlockClientIds.length ? multiSelectedBlockClientIds : [clientId]; + updateBlockAttributes(clientIds, newAttributes); + }, + + onInsertBlocks(blocks, index) { + const { + rootClientId + } = ownProps; + insertBlocks(blocks, index, rootClientId); + }, + + onInsertBlocksAfter(blocks) { + const { + clientId, + rootClientId + } = ownProps; + const { + getBlockIndex + } = select(store); + const index = getBlockIndex(clientId); + insertBlocks(blocks, index + 1, rootClientId); + }, + + onMerge(forward) { + const { + clientId + } = ownProps; + const { + getPreviousBlockClientId, + getNextBlockClientId + } = select(store); + + if (forward) { + const nextBlockClientId = getNextBlockClientId(clientId); + + if (nextBlockClientId) { + mergeBlocks(clientId, nextBlockClientId); + } + } else { + const previousBlockClientId = getPreviousBlockClientId(clientId); + + if (previousBlockClientId) { + mergeBlocks(previousBlockClientId, clientId); + } + } + }, + + onReplace(blocks, indexToSelect, initialPosition) { + if (blocks.length && !(0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blocks[blocks.length - 1])) { + __unstableMarkLastChangeAsPersistent(); + } + + replaceBlocks([ownProps.clientId], blocks, indexToSelect, initialPosition); + }, + + toggleSelection(selectionEnabled) { + toggleSelection(selectionEnabled); + } + + }; +}); +/* harmony default export */ var block = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.pure, applyWithSelect, applyWithDispatch, // block is sometimes not mounted at the right time, causing it be undefined +// see issue for more info +// https://github.com/WordPress/gutenberg/issues/17013 +(0,external_wp_compose_namespaceObject.ifCondition)(_ref5 => { + let { + block + } = _ref5; + return !!block; +}), (0,external_wp_components_namespaceObject.withFilters)('editor.BlockListBlock'))(BlockListBlock)); + +;// CONCATENATED MODULE: external ["wp","htmlEntities"] +var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js + + +/** + * WordPress dependencies + */ + +const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" +})); +/* harmony default export */ var library_plus = (plus); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/tips.js + + +/** + * WordPress dependencies + */ + + + +const globalTips = [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('While writing, you can press / to quickly insert new blocks.'), { + kbd: (0,external_wp_element_namespaceObject.createElement)("kbd", null) +}), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Indent a list by pressing space at the beginning of a line.'), { + kbd: (0,external_wp_element_namespaceObject.createElement)("kbd", null) +}), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Outdent a list by pressing backspace at the beginning of a line.'), { + kbd: (0,external_wp_element_namespaceObject.createElement)("kbd", null) +}), (0,external_wp_i18n_namespaceObject.__)('Drag files into the editor to automatically insert media blocks.'), (0,external_wp_i18n_namespaceObject.__)("Change a block's type by pressing the block icon on the toolbar.")]; + +function Tips() { + const [randomIndex] = (0,external_wp_element_namespaceObject.useState)( // Disable Reason: I'm not generating an HTML id. + // eslint-disable-next-line no-restricted-syntax + Math.floor(Math.random() * globalTips.length)); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tip, null, globalTips[randomIndex]); +} + +/* harmony default export */ var tips = (Tips); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js + + +/** + * WordPress dependencies + */ + +const blockDefault = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var block_default = (blockDefault); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +function BlockIcon(_ref) { + var _icon; + + let { + icon, + showColors = false, + className + } = _ref; + + if (((_icon = icon) === null || _icon === void 0 ? void 0 : _icon.src) === 'block-default') { + icon = { + src: block_default + }; + } + + const renderedIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, { + icon: icon && icon.src ? icon.src : icon + }); + const style = showColors ? { + backgroundColor: icon && icon.background, + color: icon && icon.foreground + } : {}; + return (0,external_wp_element_namespaceObject.createElement)("span", { + style: style, + className: classnames_default()('block-editor-block-icon', className, { + 'has-colors': showColors + }) + }, renderedIcon); +} + +/* harmony default export */ var block_icon = ((0,external_wp_element_namespaceObject.memo)(BlockIcon)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-card/index.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + +function BlockCard(_ref) { + let { + title, + icon, + description, + blockType + } = _ref; + + if (blockType) { + external_wp_deprecated_default()('`blockType` property in `BlockCard component`', { + since: '5.7', + alternative: '`title, icon and description` properties' + }); + ({ + title, + icon, + description + } = blockType); + } + + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-card" + }, (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: icon, + showColors: true + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-card__content" + }, (0,external_wp_element_namespaceObject.createElement)("h2", { + className: "block-editor-block-card__title" + }, title), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-block-card__description" + }, description))); +} + +/* harmony default export */ var block_card = (BlockCard); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/with-registry-provider.js + + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => { + return (0,external_wp_data_namespaceObject.withRegistry)(_ref => { + let { + useSubRegistry = true, + registry, + ...props + } = _ref; + + if (!useSubRegistry) { + return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({ + registry: registry + }, props)); + } + + const [subRegistry, setSubRegistry] = (0,external_wp_element_namespaceObject.useState)(null); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const newRegistry = (0,external_wp_data_namespaceObject.createRegistry)({}, registry); + newRegistry.registerStore(STORE_NAME, storeConfig); + setSubRegistry(newRegistry); + }, [registry]); + + if (!subRegistry) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.RegistryProvider, { + value: subRegistry + }, (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({ + registry: subRegistry + }, props))); + }); +}, 'withRegistryProvider'); +/* harmony default export */ var with_registry_provider = (withRegistryProvider); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/use-block-sync.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * A function to call when the block value has been updated in the block-editor + * store. + * + * @callback onBlockUpdate + * @param {Object[]} blocks The updated blocks. + * @param {Object} options The updated block options, such as selectionStart + * and selectionEnd. + */ + +/** + * useBlockSync is a side effect which handles bidirectional sync between the + * block-editor store and a controlling data source which provides blocks. This + * is most commonly used by the BlockEditorProvider to synchronize the contents + * of the block-editor store with the root entity, like a post. + * + * Another example would be the template part block, which provides blocks from + * a separate entity data source than a root entity. This hook syncs edits to + * the template part in the block editor back to the entity and vice-versa. + * + * Here are some of its basic functions: + * - Initalizes the block-editor store for the given clientID to the blocks + * given via props. + * - Adds incoming changes (like undo) to the block-editor store. + * - Adds outgoing changes (like editing content) to the controlling entity, + * determining if a change should be considered persistent or not. + * - Handles edge cases and race conditions which occur in those operations. + * - Ignores changes which happen to other entities (like nested inner block + * controllers. + * - Passes selection state from the block-editor store to the controlling entity. + * + * @param {Object} props Props for the block sync hook + * @param {string} props.clientId The client ID of the inner block controller. + * If none is passed, then it is assumed to be a + * root controller rather than an inner block + * controller. + * @param {Object[]} props.value The control value for the blocks. This value + * is used to initalize the block-editor store + * and for resetting the blocks to incoming + * changes like undo. + * @param {Object} props.selection The selection state responsible to restore the selection on undo/redo. + * @param {onBlockUpdate} props.onChange Function to call when a persistent + * change has been made in the block-editor blocks + * for the given clientId. For example, after + * this function is called, an entity is marked + * dirty because it has changes to save. + * @param {onBlockUpdate} props.onInput Function to call when a non-persistent + * change has been made in the block-editor blocks + * for the given clientId. When this is called, + * controlling sources do not become dirty. + */ + +function useBlockSync(_ref) { + let { + clientId = null, + value: controlledBlocks, + selection: controlledSelection, + onChange = external_lodash_namespaceObject.noop, + onInput = external_lodash_namespaceObject.noop + } = _ref; + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const { + resetBlocks, + resetSelection, + replaceInnerBlocks, + setHasControlledInnerBlocks, + __unstableMarkNextChangeAsNotPersistent + } = registry.dispatch(store); + const { + getBlockName, + getBlocks + } = registry.select(store); + const isControlled = (0,external_wp_data_namespaceObject.useSelect)(select => { + return !clientId || select(store).areInnerBlocksControlled(clientId); + }, [clientId]); + const pendingChanges = (0,external_wp_element_namespaceObject.useRef)({ + incoming: null, + outgoing: [] + }); + const subscribed = (0,external_wp_element_namespaceObject.useRef)(false); + + const setControlledBlocks = () => { + if (!controlledBlocks) { + return; + } // We don't need to persist this change because we only replace + // controlled inner blocks when the change was caused by an entity, + // and so it would already be persisted. + + + __unstableMarkNextChangeAsNotPersistent(); + + if (clientId) { + // It is important to batch here because otherwise, + // as soon as `setHasControlledInnerBlocks` is called + // the effect to restore might be triggered + // before the actual blocks get set properly in state. + registry.batch(() => { + setHasControlledInnerBlocks(clientId, true); + const storeBlocks = controlledBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); + + if (subscribed.current) { + pendingChanges.current.incoming = storeBlocks; + } + + __unstableMarkNextChangeAsNotPersistent(); + + replaceInnerBlocks(clientId, storeBlocks); + }); + } else { + if (subscribed.current) { + pendingChanges.current.incoming = controlledBlocks; + } + + resetBlocks(controlledBlocks); + } + }; // Add a subscription to the block-editor registry to detect when changes + // have been made. This lets us inform the data source of changes. This + // is an effect so that the subscriber can run synchronously without + // waiting for React renders for changes. + + + const onInputRef = (0,external_wp_element_namespaceObject.useRef)(onInput); + const onChangeRef = (0,external_wp_element_namespaceObject.useRef)(onChange); + (0,external_wp_element_namespaceObject.useEffect)(() => { + onInputRef.current = onInput; + onChangeRef.current = onChange; + }, [onInput, onChange]); // Determine if blocks need to be reset when they change. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (pendingChanges.current.outgoing.includes(controlledBlocks)) { + // Skip block reset if the value matches expected outbound sync + // triggered by this component by a preceding change detection. + // Only skip if the value matches expectation, since a reset should + // still occur if the value is modified (not equal by reference), + // to allow that the consumer may apply modifications to reflect + // back on the editor. + if ((0,external_lodash_namespaceObject.last)(pendingChanges.current.outgoing) === controlledBlocks) { + pendingChanges.current.outgoing = []; + } + } else if (getBlocks(clientId) !== controlledBlocks) { + // Reset changing value in all other cases than the sync described + // above. Since this can be reached in an update following an out- + // bound sync, unset the outbound value to avoid considering it in + // subsequent renders. + pendingChanges.current.outgoing = []; + setControlledBlocks(); + + if (controlledSelection) { + resetSelection(controlledSelection.selectionStart, controlledSelection.selectionEnd, controlledSelection.initialPosition); + } + } + }, [controlledBlocks, clientId]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // When the block becomes uncontrolled, it means its inner state has been reset + // we need to take the blocks again from the external value property. + if (!isControlled) { + pendingChanges.current.outgoing = []; + setControlledBlocks(); + } + }, [isControlled]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const { + getSelectionStart, + getSelectionEnd, + getSelectedBlocksInitialCaretPosition, + isLastBlockChangePersistent, + __unstableIsLastBlockChangeIgnored, + areInnerBlocksControlled + } = registry.select(store); + let blocks = getBlocks(clientId); + let isPersistent = isLastBlockChangePersistent(); + let previousAreBlocksDifferent = false; + subscribed.current = true; + const unsubscribe = registry.subscribe(() => { + // Sometimes, when changing block lists, lingering subscriptions + // might trigger before they are cleaned up. If the block for which + // the subscription runs is no longer in the store, this would clear + // its parent entity's block list. To avoid this, we bail out if + // the subscription is triggering for a block (`clientId !== null`) + // and its block name can't be found because it's not on the list. + // (`getBlockName( clientId ) === null`). + if (clientId !== null && getBlockName(clientId) === null) return; // When RESET_BLOCKS on parent blocks get called, the controlled blocks + // can reset to uncontrolled, in these situations, it means we need to populate + // the blocks again from the external blocks (the value property here) + // and we should stop triggering onChange + + const isStillControlled = !clientId || areInnerBlocksControlled(clientId); + + if (!isStillControlled) { return; } - function getInsertionIndex() { - const { - getBlockIndex, - getBlockSelectionEnd, - getBlockOrder, - getBlockRootClientId - } = select(store["a" /* store */]); // If the clientId is defined, we insert at the position of the block. + const newIsPersistent = isLastBlockChangePersistent(); + const newBlocks = getBlocks(clientId); + const areBlocksDifferent = newBlocks !== blocks; + blocks = newBlocks; - if (clientId) { - return getBlockIndex(clientId); - } // If there a selected block, we insert after the selected block. + if (areBlocksDifferent && (pendingChanges.current.incoming || __unstableIsLastBlockChangeIgnored())) { + pendingChanges.current.incoming = null; + isPersistent = newIsPersistent; + return; + } // Since we often dispatch an action to mark the previous action as + // persistent, we need to make sure that the blocks changed on the + // previous action before committing the change. - const end = getBlockSelectionEnd(); + const didPersistenceChange = previousAreBlocksDifferent && !areBlocksDifferent && newIsPersistent && !isPersistent; - if (!isAppender && end && getBlockRootClientId(end) === rootClientId) { - return getBlockIndex(end) + 1; - } // Otherwise, we insert at the end of the current rootClientId + if (areBlocksDifferent || didPersistenceChange) { + isPersistent = newIsPersistent; // We know that onChange/onInput will update controlledBlocks. + // We need to be aware that it was caused by an outgoing change + // so that we do not treat it as an incoming change later on, + // which would cause a block reset. + pendingChanges.current.outgoing.push(blocks); // Inform the controlling entity that changes have been made to + // the block-editor store they should be aware about. - return getBlockOrder(rootClientId).length; - } - - const { - insertBlock - } = dispatch(store["a" /* store */]); - const blockToInsert = directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length ? Object(external_wp_blocks_["createBlock"])(...directInsertBlock) : Object(external_wp_blocks_["createBlock"])(allowedBlockType.name); - insertBlock(blockToInsert, getInsertionIndex(), rootClientId); - - if (onSelectOrClose) { - onSelectOrClose(); - } - - const message = Object(external_wp_i18n_["sprintf"])( // translators: %s: the name of the block that has been added - Object(external_wp_i18n_["__"])('%s block added'), allowedBlockType.title); - Object(external_wp_a11y_["speak"])(message); - } - - }; -}), // The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as -// a way to detect the global Inserter. -Object(external_wp_compose_["ifCondition"])(_ref6 => { - let { - hasItems, - isAppender, - rootClientId, - clientId - } = _ref6; - return hasItems || !isAppender && !rootClientId && !clientId; -})])(inserter_Inserter)); - - -/***/ }), - -/***/ "rH4q": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const media = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" -})); -/* harmony default export */ __webpack_exports__["a"] = (media); - - -/***/ }), - -/***/ "rHRV": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIntersectionObserver; }); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("VyCT"); -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function useIntersectionObserver() { - const observer = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(___WEBPACK_IMPORTED_MODULE_2__[/* IntersectionObserver */ "b"]); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__["useRefEffect"])(node => { - if (observer) { - observer.observe(node); - return () => { - observer.unobserve(node); - }; - } - }, [observer]); -} - - -/***/ }), - -/***/ "rl8x": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["isShallowEqual"]; }()); - -/***/ }), - -/***/ "rmEH": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["htmlEntities"]; }()); - -/***/ }), - -/***/ "smQA": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*istanbul ignore start*/ - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Diff; - -/*istanbul ignore end*/ -function Diff() {} - -Diff.prototype = { - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - diff: function diff(oldString, newString) { - /*istanbul ignore start*/ - var - /*istanbul ignore end*/ - options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var callback = options.callback; - - if (typeof options === 'function') { - callback = options; - options = {}; - } - - this.options = options; - var self = this; - - function done(value) { - if (callback) { - setTimeout(function () { - callback(undefined, value); - }, 0); - return true; - } else { - return value; - } - } // Allow subclasses to massage the input prior to running - - - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, - oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - var bestPath = [{ - newPos: -1, - components: [] - }]; // Seed editLength = 0, i.e. the content starts with the same values - - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - // Identity per the equality and tokenizer - return done([{ - value: this.join(newString), - count: newString.length - }]); - } // Main worker method. checks all permutations of a given edit length for acceptance. - - - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = - /*istanbul ignore start*/ - void 0 - /*istanbul ignore end*/ - ; - - var addPath = bestPath[diagonalPath - 1], - removePath = bestPath[diagonalPath + 1], - _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath - 1] = undefined; - } - - var canAdd = addPath && addPath.newPos + 1 < newLen, - canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - - if (!canAdd && !canRemove) { - // If this path is a terminal then prune - bestPath[diagonalPath] = undefined; - continue; - } // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - - - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self.pushComponent(basePath.components, undefined, true); - } else { - basePath = addPath; // No need to clone, we've pulled it from the list - - basePath.newPos++; - self.pushComponent(basePath.components, true, undefined); - } - - _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done - - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); - } else { - // Otherwise track this path as a potential candidate and continue. - bestPath[diagonalPath] = basePath; - } - } - - editLength++; - } // Performs the length of edit iteration. Is a bit fugly as this has to support the - // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. - - - if (callback) { - (function exec() { - setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ - if (editLength > maxEditLength) { - return callback(); + const updateParent = isPersistent ? onChangeRef.current : onInputRef.current; + updateParent(blocks, { + selection: { + selectionStart: getSelectionStart(), + selectionEnd: getSelectionEnd(), + initialPosition: getSelectedBlocksInitialCaretPosition() } - - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - - if (ret) { - return ret; - } - } - } - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - pushComponent: function pushComponent(components, added, removed) { - var last = components[components.length - 1]; - - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length - 1] = { - count: last.count + 1, - added: added, - removed: removed - }; - } else { - components.push({ - count: 1, - added: added, - removed: removed - }); - } - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath, - commonCount = 0; - - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - - basePath.newPos = newPos; - return oldPos; - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - removeEmpty: function removeEmpty(array) { - var ret = []; - - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - - return ret; - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - castInput: function castInput(value) { - return value; - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - tokenize: function tokenize(value) { - return value.split(''); - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - join: function join(chars) { - return chars.join(''); - } -}; - -function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, - componentLen = components.length, - newPos = 0, - oldPos = 0; - - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function (value, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value.length ? oldValue : value; }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); } - newPos += component.count; // Common case - - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; // Reverse add and remove so removes are output first to match common convention - // The diffing algorithm is tied to add then remove output and this is the simplest - // route to get the desired output with minimal overhead. - - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } // Special case handle for when one terminal is ignored (i.e. whitespace). - // For this case we merge the terminal into the prior string and drop the change. - // This is only available for string mode. - - - var lastComponent = components[componentLen - 1]; - - if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - - return components; + previousAreBlocksDifferent = areBlocksDifferent; + }); + return () => unsubscribe(); + }, [registry, clientId]); } -function clonePath(path) { +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */ + +function BlockEditorProvider(props) { + const { + children, + settings + } = props; + const { + updateSettings + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + updateSettings(settings); + }, [settings]); // Syncs the entity provider with changes in the block-editor store. + + useBlockSync(props); + return (0,external_wp_element_namespaceObject.createElement)(BlockRefsProvider, null, children); +} + +/* harmony default export */ var provider = (with_registry_provider(BlockEditorProvider)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/live.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +function LiveBlockPreview(_ref) { + let { + onClick + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + tabIndex: 0, + role: "button", + onClick: onClick, + onKeyPress: onClick + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)(BlockList, null))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-selection-clearer/index.js + + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * Pass the returned ref callback to an element that should clear block + * selection. Selection will only be cleared if the element is clicked directly, + * not if a child element is clicked. + * + * @return {import('react').RefCallback} Ref callback. + */ + +function useBlockSelectionClearer() { + const { + hasSelectedBlock, + hasMultiSelection + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + clearSelectedBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function onMouseDown(event) { + if (!hasSelectedBlock() && !hasMultiSelection()) { + return; + } // Only handle clicks on the element, not the children. + + + if (event.target !== node) { + return; + } + + clearSelectedBlock(); + } + + node.addEventListener('mousedown', onMouseDown); + return () => { + node.removeEventListener('mousedown', onMouseDown); + }; + }, [hasSelectedBlock, hasMultiSelection, clearSelectedBlock]); +} +function BlockSelectionClearer(props) { + return (0,external_wp_element_namespaceObject.createElement)("div", _extends({ + ref: useBlockSelectionClearer() + }, props)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-multi-selection.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function use_multi_selection_toggleRichText(container, toggle) { + Array.from(container.querySelectorAll('.rich-text')).forEach(node => { + if (toggle) { + node.setAttribute('contenteditable', true); + } else { + node.removeAttribute('contenteditable'); + } + }); +} +/** + * Returns for the deepest node at the start or end of a container node. Ignores + * any text nodes that only contain HTML formatting whitespace. + * + * @param {Element} node Container to search. + * @param {string} type 'start' or 'end'. + */ + + +function getDeepestNode(node, type) { + const child = type === 'start' ? 'firstChild' : 'lastChild'; + const sibling = type === 'start' ? 'nextSibling' : 'previousSibling'; + + while (node[child]) { + node = node[child]; + + while (node.nodeType === node.TEXT_NODE && /^[ \t\n]*$/.test(node.data) && node[sibling]) { + node = node[sibling]; + } + } + + return node; +} + +function selector(select) { + const { + isMultiSelecting, + getMultiSelectedBlockClientIds, + hasMultiSelection, + getSelectedBlockClientId + } = select(store); return { - newPos: path.newPos, - components: path.components.slice(0) + isMultiSelecting: isMultiSelecting(), + multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(), + hasMultiSelection: hasMultiSelection(), + selectedBlockClientId: getSelectedBlockClientId() }; } - -/***/ }), - -/***/ "suLj": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const justifyRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (justifyRight); - - -/***/ }), - -/***/ "tI+e": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["components"]; }()); - -/***/ }), - -/***/ "tr0p": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "__experimentalGetBorderClassesAndStyles", function() { return /* reexport */ getBorderClassesAndStyles; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUseBorderProps", function() { return /* reexport */ useBorderProps; }); -__webpack_require__.d(__webpack_exports__, "__experimentalGetColorClassesAndStyles", function() { return /* reexport */ getColorClassesAndStyles; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUseColorProps", function() { return /* reexport */ useColorProps; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUseCustomSides", function() { return /* reexport */ useCustomSides; }); -__webpack_require__.d(__webpack_exports__, "__experimentalGetSpacingClassesAndStyles", function() { return /* reexport */ getSpacingClassesAndStyles; }); -__webpack_require__.d(__webpack_exports__, "useCachedTruthy", function() { return /* reexport */ useCachedTruthy; }); -__webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return /* reexport */ components["ic" /* getColorClassName */]; }); -__webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return /* reexport */ components["jc" /* getColorObjectByAttributeValues */]; }); -__webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return /* reexport */ components["kc" /* getColorObjectByColorValue */]; }); -__webpack_require__.d(__webpack_exports__, "createCustomColorsHOC", function() { return /* reexport */ components["hc" /* createCustomColorsHOC */]; }); -__webpack_require__.d(__webpack_exports__, "withColors", function() { return /* reexport */ components["wc" /* withColors */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalGetGradientClass", function() { return /* reexport */ components["yb" /* __experimentalGetGradientClass */]; }); -__webpack_require__.d(__webpack_exports__, "getGradientValueBySlug", function() { return /* reexport */ components["pc" /* getGradientValueBySlug */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalGetGradientObjectByGradientValue", function() { return /* reexport */ components["zb" /* __experimentalGetGradientObjectByGradientValue */]; }); -__webpack_require__.d(__webpack_exports__, "getGradientSlugByValue", function() { return /* reexport */ components["oc" /* getGradientSlugByValue */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUseGradient", function() { return /* reexport */ components["Tb" /* __experimentalUseGradient */]; }); -__webpack_require__.d(__webpack_exports__, "getFontSize", function() { return /* reexport */ components["lc" /* getFontSize */]; }); -__webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return /* reexport */ components["mc" /* getFontSizeClass */]; }); -__webpack_require__.d(__webpack_exports__, "getFontSizeObjectByValue", function() { return /* reexport */ components["nc" /* getFontSizeObjectByValue */]; }); -__webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return /* reexport */ components["I" /* FontSizePicker */]; }); -__webpack_require__.d(__webpack_exports__, "withFontSizes", function() { return /* reexport */ components["xc" /* withFontSizes */]; }); -__webpack_require__.d(__webpack_exports__, "AlignmentControl", function() { return /* reexport */ components["a" /* AlignmentControl */]; }); -__webpack_require__.d(__webpack_exports__, "AlignmentToolbar", function() { return /* reexport */ components["b" /* AlignmentToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return /* reexport */ components["c" /* Autocomplete */]; }); -__webpack_require__.d(__webpack_exports__, "BlockAlignmentControl", function() { return /* reexport */ components["d" /* BlockAlignmentControl */]; }); -__webpack_require__.d(__webpack_exports__, "BlockAlignmentToolbar", function() { return /* reexport */ components["e" /* BlockAlignmentToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBlockFullHeightAligmentControl", function() { return /* reexport */ components["nb" /* __experimentalBlockFullHeightAligmentControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBlockAlignmentMatrixControl", function() { return /* reexport */ components["lb" /* __experimentalBlockAlignmentMatrixControl */]; }); -__webpack_require__.d(__webpack_exports__, "BlockBreadcrumb", function() { return /* reexport */ components["f" /* BlockBreadcrumb */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBlockContentOverlay", function() { return /* reexport */ components["mb" /* __experimentalBlockContentOverlay */]; }); -__webpack_require__.d(__webpack_exports__, "BlockContextProvider", function() { return /* reexport */ components["h" /* BlockContextProvider */]; }); -__webpack_require__.d(__webpack_exports__, "BlockControls", function() { return /* reexport */ components["i" /* BlockControls */]; }); -__webpack_require__.d(__webpack_exports__, "BlockFormatControls", function() { return /* reexport */ components["m" /* BlockFormatControls */]; }); -__webpack_require__.d(__webpack_exports__, "BlockColorsStyleSelector", function() { return /* reexport */ components["g" /* BlockColorsStyleSelector */]; }); -__webpack_require__.d(__webpack_exports__, "BlockEdit", function() { return /* reexport */ components["j" /* BlockEdit */]; }); -__webpack_require__.d(__webpack_exports__, "useBlockEditContext", function() { return /* reexport */ components["rc" /* useBlockEditContext */]; }); -__webpack_require__.d(__webpack_exports__, "BlockIcon", function() { return /* reexport */ components["n" /* BlockIcon */]; }); -__webpack_require__.d(__webpack_exports__, "BlockNavigationDropdown", function() { return /* reexport */ components["r" /* BlockNavigationDropdown */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBlockVariationPicker", function() { return /* reexport */ components["pb" /* __experimentalBlockVariationPicker */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBlockPatternSetup", function() { return /* reexport */ components["ob" /* __experimentalBlockPatternSetup */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBlockVariationTransforms", function() { return /* reexport */ components["qb" /* __experimentalBlockVariationTransforms */]; }); -__webpack_require__.d(__webpack_exports__, "BlockVerticalAlignmentToolbar", function() { return /* reexport */ components["A" /* BlockVerticalAlignmentToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "BlockVerticalAlignmentControl", function() { return /* reexport */ components["z" /* BlockVerticalAlignmentControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBorderRadiusControl", function() { return /* reexport */ components["rb" /* __experimentalBorderRadiusControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalBorderStyleControl", function() { return /* reexport */ components["sb" /* __experimentalBorderStyleControl */]; }); -__webpack_require__.d(__webpack_exports__, "ButtonBlockerAppender", function() { return /* reexport */ components["C" /* ButtonBlockerAppender */]; }); -__webpack_require__.d(__webpack_exports__, "ButtonBlockAppender", function() { return /* reexport */ components["B" /* ButtonBlockAppender */]; }); -__webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return /* reexport */ components["D" /* ColorPalette */]; }); -__webpack_require__.d(__webpack_exports__, "ColorPaletteControl", function() { return /* reexport */ components["E" /* ColorPaletteControl */]; }); -__webpack_require__.d(__webpack_exports__, "ContrastChecker", function() { return /* reexport */ components["F" /* ContrastChecker */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalDuotoneControl", function() { return /* reexport */ components["vb" /* __experimentalDuotoneControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalFontAppearanceControl", function() { return /* reexport */ components["wb" /* __experimentalFontAppearanceControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalFontFamilyControl", function() { return /* reexport */ components["xb" /* __experimentalFontFamilyControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalLetterSpacingControl", function() { return /* reexport */ components["Fb" /* __experimentalLetterSpacingControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalTextDecorationControl", function() { return /* reexport */ components["Pb" /* __experimentalTextDecorationControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalTextTransformControl", function() { return /* reexport */ components["Qb" /* __experimentalTextTransformControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalColorGradientControl", function() { return /* reexport */ components["tb" /* __experimentalColorGradientControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalColorGradientSettingsDropdown", function() { return /* reexport */ components["ub" /* __experimentalColorGradientSettingsDropdown */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalPanelColorGradientSettings", function() { return /* reexport */ components["Mb" /* __experimentalPanelColorGradientSettings */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalImageEditor", function() { return /* reexport */ components["Bb" /* __experimentalImageEditor */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalImageEditingProvider", function() { return /* reexport */ components["Ab" /* __experimentalImageEditingProvider */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalImageSizeControl", function() { return /* reexport */ components["Cb" /* __experimentalImageSizeControl */]; }); -__webpack_require__.d(__webpack_exports__, "InnerBlocks", function() { return /* reexport */ components["J" /* InnerBlocks */]; }); -__webpack_require__.d(__webpack_exports__, "useInnerBlocksProps", function() { return /* reexport */ components["tc" /* useInnerBlocksProps */]; }); -__webpack_require__.d(__webpack_exports__, "InspectorControls", function() { return /* reexport */ components["M" /* InspectorControls */]; }); -__webpack_require__.d(__webpack_exports__, "InspectorAdvancedControls", function() { return /* reexport */ components["L" /* InspectorAdvancedControls */]; }); -__webpack_require__.d(__webpack_exports__, "JustifyToolbar", function() { return /* reexport */ components["O" /* JustifyToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "JustifyContentControl", function() { return /* reexport */ components["N" /* JustifyContentControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalLinkControl", function() { return /* reexport */ components["Hb" /* __experimentalLinkControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalLinkControlSearchInput", function() { return /* reexport */ components["Ib" /* __experimentalLinkControlSearchInput */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalLinkControlSearchResults", function() { return /* reexport */ components["Kb" /* __experimentalLinkControlSearchResults */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalLinkControlSearchItem", function() { return /* reexport */ components["Jb" /* __experimentalLinkControlSearchItem */]; }); -__webpack_require__.d(__webpack_exports__, "LineHeightControl", function() { return /* reexport */ components["P" /* LineHeightControl */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalListView", function() { return /* reexport */ components["Lb" /* __experimentalListView */]; }); -__webpack_require__.d(__webpack_exports__, "MediaReplaceFlow", function() { return /* reexport */ components["R" /* MediaReplaceFlow */]; }); -__webpack_require__.d(__webpack_exports__, "MediaPlaceholder", function() { return /* reexport */ components["Q" /* MediaPlaceholder */]; }); -__webpack_require__.d(__webpack_exports__, "MediaUpload", function() { return /* reexport */ components["S" /* MediaUpload */]; }); -__webpack_require__.d(__webpack_exports__, "MediaUploadCheck", function() { return /* reexport */ components["T" /* MediaUploadCheck */]; }); -__webpack_require__.d(__webpack_exports__, "PanelColorSettings", function() { return /* reexport */ components["X" /* PanelColorSettings */]; }); -__webpack_require__.d(__webpack_exports__, "PlainText", function() { return /* reexport */ components["Y" /* PlainText */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalResponsiveBlockControl", function() { return /* reexport */ components["Ob" /* __experimentalResponsiveBlockControl */]; }); -__webpack_require__.d(__webpack_exports__, "RichText", function() { return /* reexport */ components["ab" /* RichText */]; }); -__webpack_require__.d(__webpack_exports__, "RichTextShortcut", function() { return /* reexport */ components["bb" /* RichTextShortcut */]; }); -__webpack_require__.d(__webpack_exports__, "RichTextToolbarButton", function() { return /* reexport */ components["cb" /* RichTextToolbarButton */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableRichTextInputEvent", function() { return /* reexport */ components["ac" /* __unstableRichTextInputEvent */]; }); -__webpack_require__.d(__webpack_exports__, "ToolSelector", function() { return /* reexport */ components["eb" /* ToolSelector */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUnitControl", function() { return /* reexport */ components["Rb" /* __experimentalUnitControl */]; }); -__webpack_require__.d(__webpack_exports__, "URLInput", function() { return /* reexport */ components["gb" /* URLInput */]; }); -__webpack_require__.d(__webpack_exports__, "URLInputButton", function() { return /* reexport */ components["hb" /* URLInputButton */]; }); -__webpack_require__.d(__webpack_exports__, "URLPopover", function() { return /* reexport */ components["ib" /* URLPopover */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalImageURLInputUI", function() { return /* reexport */ components["Db" /* __experimentalImageURLInputUI */]; }); -__webpack_require__.d(__webpack_exports__, "withColorContext", function() { return /* reexport */ components["vc" /* withColorContext */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableBlockSettingsMenuFirstItem", function() { return /* reexport */ components["Wb" /* __unstableBlockSettingsMenuFirstItem */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableInserterMenuExtension", function() { return /* reexport */ components["Zb" /* __unstableInserterMenuExtension */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalPreviewOptions", function() { return /* reexport */ components["Nb" /* __experimentalPreviewOptions */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUseResizeCanvas", function() { return /* reexport */ components["Vb" /* __experimentalUseResizeCanvas */]; }); -__webpack_require__.d(__webpack_exports__, "BlockInspector", function() { return /* reexport */ components["o" /* BlockInspector */]; }); -__webpack_require__.d(__webpack_exports__, "BlockList", function() { return /* reexport */ components["p" /* BlockList */]; }); -__webpack_require__.d(__webpack_exports__, "useBlockProps", function() { return /* reexport */ components["sc" /* useBlockProps */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalLayoutStyle", function() { return /* reexport */ components["Eb" /* __experimentalLayoutStyle */]; }); -__webpack_require__.d(__webpack_exports__, "BlockMover", function() { return /* reexport */ components["q" /* BlockMover */]; }); -__webpack_require__.d(__webpack_exports__, "BlockPreview", function() { return /* reexport */ components["s" /* BlockPreview */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUseBlockPreview", function() { return /* reexport */ components["Sb" /* __experimentalUseBlockPreview */]; }); -__webpack_require__.d(__webpack_exports__, "BlockSelectionClearer", function() { return /* reexport */ components["t" /* BlockSelectionClearer */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableUseBlockSelectionClearer", function() { return /* reexport */ components["bc" /* __unstableUseBlockSelectionClearer */]; }); -__webpack_require__.d(__webpack_exports__, "BlockSettingsMenu", function() { return /* reexport */ components["u" /* BlockSettingsMenu */]; }); -__webpack_require__.d(__webpack_exports__, "BlockSettingsMenuControls", function() { return /* reexport */ components["v" /* BlockSettingsMenuControls */]; }); -__webpack_require__.d(__webpack_exports__, "BlockTitle", function() { return /* reexport */ components["w" /* BlockTitle */]; }); -__webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return /* reexport */ components["x" /* BlockToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "BlockTools", function() { return /* reexport */ components["y" /* BlockTools */]; }); -__webpack_require__.d(__webpack_exports__, "CopyHandler", function() { return /* reexport */ components["G" /* CopyHandler */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableUseClipboardHandler", function() { return /* reexport */ components["dc" /* __unstableUseClipboardHandler */]; }); -__webpack_require__.d(__webpack_exports__, "DefaultBlockAppender", function() { return /* reexport */ components["H" /* DefaultBlockAppender */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableEditorStyles", function() { return /* reexport */ components["Xb" /* __unstableEditorStyles */]; }); -__webpack_require__.d(__webpack_exports__, "Inserter", function() { return /* reexport */ components["K" /* Inserter */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalLibrary", function() { return /* reexport */ components["Gb" /* __experimentalLibrary */]; }); -__webpack_require__.d(__webpack_exports__, "BlockEditorKeyboardShortcuts", function() { return /* reexport */ components["k" /* BlockEditorKeyboardShortcuts */]; }); -__webpack_require__.d(__webpack_exports__, "MultiSelectScrollIntoView", function() { return /* reexport */ components["U" /* MultiSelectScrollIntoView */]; }); -__webpack_require__.d(__webpack_exports__, "NavigableToolbar", function() { return /* reexport */ components["V" /* NavigableToolbar */]; }); -__webpack_require__.d(__webpack_exports__, "ObserveTyping", function() { return /* reexport */ components["W" /* ObserveTyping */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableUseTypingObserver", function() { return /* reexport */ components["gc" /* __unstableUseTypingObserver */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableUseMouseMoveTypingReset", function() { return /* reexport */ components["ec" /* __unstableUseMouseMoveTypingReset */]; }); -__webpack_require__.d(__webpack_exports__, "PreserveScrollInReorder", function() { return /* reexport */ components["Z" /* PreserveScrollInReorder */]; }); -__webpack_require__.d(__webpack_exports__, "SkipToSelectedBlock", function() { return /* reexport */ components["db" /* SkipToSelectedBlock */]; }); -__webpack_require__.d(__webpack_exports__, "Typewriter", function() { return /* reexport */ components["fb" /* Typewriter */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableUseTypewriter", function() { return /* reexport */ components["fc" /* __unstableUseTypewriter */]; }); -__webpack_require__.d(__webpack_exports__, "Warning", function() { return /* reexport */ components["jb" /* Warning */]; }); -__webpack_require__.d(__webpack_exports__, "WritingFlow", function() { return /* reexport */ components["kb" /* WritingFlow */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableUseCanvasClickRedirect", function() { return /* reexport */ components["cc" /* __unstableUseCanvasClickRedirect */]; }); -__webpack_require__.d(__webpack_exports__, "useBlockDisplayInformation", function() { return /* reexport */ components["qc" /* useBlockDisplayInformation */]; }); -__webpack_require__.d(__webpack_exports__, "__unstableIframe", function() { return /* reexport */ components["Yb" /* __unstableIframe */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalUseNoRecursiveRenders", function() { return /* reexport */ components["Ub" /* __experimentalUseNoRecursiveRenders */]; }); -__webpack_require__.d(__webpack_exports__, "BlockEditorProvider", function() { return /* reexport */ components["l" /* BlockEditorProvider */]; }); -__webpack_require__.d(__webpack_exports__, "useSetting", function() { return /* reexport */ components["uc" /* useSetting */]; }); -__webpack_require__.d(__webpack_exports__, "transformStyles", function() { return /* reexport */ build_module_utils["c" /* transformStyles */]; }); -__webpack_require__.d(__webpack_exports__, "validateThemeColors", function() { return /* reexport */ build_module_utils["d" /* validateThemeColors */]; }); -__webpack_require__.d(__webpack_exports__, "validateThemeGradients", function() { return /* reexport */ build_module_utils["e" /* validateThemeGradients */]; }); -__webpack_require__.d(__webpack_exports__, "__experimentalGetMatchingVariation", function() { return /* reexport */ build_module_utils["a" /* __experimentalGetMatchingVariation */]; }); -__webpack_require__.d(__webpack_exports__, "getPxFromCssUnit", function() { return /* reexport */ build_module_utils["b" /* getPxFromCssUnit */]; }); -__webpack_require__.d(__webpack_exports__, "storeConfig", function() { return /* reexport */ store["b" /* storeConfig */]; }); -__webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store["a" /* store */]; }); -__webpack_require__.d(__webpack_exports__, "SETTINGS_DEFAULTS", function() { return /* reexport */ defaults["b" /* SETTINGS_DEFAULTS */]; }); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","hooks"] -var external_wp_hooks_ = __webpack_require__("g56x"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/compat.js -/** - * WordPress dependencies - */ - - - -function migrateLightBlockWrapper(settings) { +function use_multi_selection_useMultiSelection() { const { - apiVersion = 1 - } = settings; + isMultiSelecting, + multiSelectedBlockClientIds, + hasMultiSelection, + selectedBlockClientId + } = (0,external_wp_data_namespaceObject.useSelect)(selector, []); + const selectedRef = useBlockRef(selectedBlockClientId); // These must be in the right DOM order. - if (apiVersion < 2 && Object(external_wp_blocks_["hasBlockSupport"])(settings, 'lightBlockWrapper', false)) { - settings.apiVersion = 2; - } + const startRef = useBlockRef((0,external_lodash_namespaceObject.first)(multiSelectedBlockClientIds)); + const endRef = useBlockRef((0,external_lodash_namespaceObject.last)(multiSelectedBlockClientIds)); + /** + * When the component updates, and there is multi selection, we need to + * select the entire block contents. + */ - return settings; + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + const { + ownerDocument + } = node; + const { + defaultView + } = ownerDocument; + + if (!hasMultiSelection || isMultiSelecting) { + if (!selectedBlockClientId || isMultiSelecting) { + return; + } + + const selection = defaultView.getSelection(); + + if (selection.rangeCount && !selection.isCollapsed) { + const blockNode = selectedRef.current; + const { + startContainer, + endContainer + } = selection.getRangeAt(0); + + if (!!blockNode && (!blockNode.contains(startContainer) || !blockNode.contains(endContainer))) { + selection.removeAllRanges(); + } + } + + return; + } + + const { + length + } = multiSelectedBlockClientIds; + + if (length < 2) { + return; + } // The block refs might not be immediately available + // when dragging blocks into another block. + + + if (!startRef.current || !endRef.current) { + return; + } // For some browsers, like Safari, it is important that focus happens + // BEFORE selection. + + + node.focus(); + const selection = defaultView.getSelection(); + const range = ownerDocument.createRange(); // These must be in the right DOM order. + // The most stable way to select the whole block contents is to start + // and end at the deepest points. + + const startNode = getDeepestNode(startRef.current, 'start'); + const endNode = getDeepestNode(endRef.current, 'end'); // While rich text will be disabled with a delay when there is a multi + // selection, we must do it immediately because it's not possible to set + // selection across editable hosts. + + use_multi_selection_toggleRichText(node, false); + range.setStartBefore(startNode); + range.setEndAfter(endNode); + selection.removeAllRanges(); + selection.addRange(range); + }, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId]); } -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/compat/migrateLightBlockWrapper', migrateLightBlockWrapper); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js + 4 modules -var block_controls = __webpack_require__("fOYa"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js + 4 modules -var block_alignment_control = __webpack_require__("vtO0"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/use-available-alignments.js -var use_available_alignments = __webpack_require__("K/rC"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/align.js - - - -/** - * External dependencies - */ +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-tab-nav.js /** @@ -41403,536 +18231,192 @@ var use_available_alignments = __webpack_require__("K/rC"); + /** * Internal dependencies */ -/** - * An array which includes all possible valid alignments, - * used to validate if an alignment is valid or not. - * - * @constant - * @type {string[]} - */ - -const ALL_ALIGNMENTS = ['left', 'center', 'right', 'wide', 'full']; -/** - * An array which includes all wide alignments. - * In order for this alignments to be valid they need to be supported by the block, - * and by the theme. - * - * @constant - * @type {string[]} - */ - -const WIDE_ALIGNMENTS = ['wide', 'full']; -/** - * Returns the valid alignments. - * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not. - * Exported just for testing purposes, not exported outside the module. - * - * @param {?boolean|string[]} blockAlign Aligns supported by the block. - * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise. - * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise. - * - * @return {string[]} Valid alignments. - */ - -function getValidAlignments(blockAlign) { - let hasWideBlockSupport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - let hasWideEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - let validAlignments; - - if (Array.isArray(blockAlign)) { - validAlignments = ALL_ALIGNMENTS.filter(value => blockAlign.includes(value)); - } else if (blockAlign === true) { - // `true` includes all alignments... - validAlignments = [...ALL_ALIGNMENTS]; - } else { - validAlignments = []; - } - - if (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) { - return Object(external_lodash_["without"])(validAlignments, ...WIDE_ALIGNMENTS); - } - - return validAlignments; -} -/** - * Filters registered block settings, extending attributes to include `align`. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - -function addAttribute(settings) { - // allow blocks to specify their own attribute definition with default values if needed. - if (Object(external_lodash_["has"])(settings.attributes, ['align', 'type'])) { - return settings; - } - - if (Object(external_wp_blocks_["hasBlockSupport"])(settings, 'align')) { - // Gracefully handle if settings.attributes is undefined. - settings.attributes = { ...settings.attributes, - align: { - type: 'string', - // Allow for '' since it is used by updateAlignment function - // in withToolbarControls for special cases with defined default values. - enum: [...ALL_ALIGNMENTS, ''] - } - }; - } - - return settings; -} -/** - * Override the default edit UI to include new toolbar controls for block - * alignment, if block defines support. - * - * @param {Function} BlockEdit Original component. - * - * @return {Function} Wrapped component. - */ - -const withToolbarControls = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => props => { +function isFormElement(element) { const { - name: blockName - } = props; // Compute the block valid alignments by taking into account, - // if the theme supports wide alignments or not and the layout's - // availble alignments. We do that for conditionally rendering - // Slot. + tagName + } = element; + return tagName === 'INPUT' || tagName === 'BUTTON' || tagName === 'SELECT' || tagName === 'TEXTAREA'; +} - const blockAllowedAlignments = getValidAlignments(Object(external_wp_blocks_["getBlockSupport"])(blockName, 'align'), Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'alignWide', true)); - const validAlignments = Object(use_available_alignments["a" /* default */])(blockAllowedAlignments).map(_ref => { - let { - name - } = _ref; - return name; - }); - - const updateAlignment = nextAlign => { - if (!nextAlign) { - var _blockType$attributes, _blockType$attributes2; - - const blockType = Object(external_wp_blocks_["getBlockType"])(props.name); - const blockDefaultAlign = blockType === null || blockType === void 0 ? void 0 : (_blockType$attributes = blockType.attributes) === null || _blockType$attributes === void 0 ? void 0 : (_blockType$attributes2 = _blockType$attributes.align) === null || _blockType$attributes2 === void 0 ? void 0 : _blockType$attributes2.default; - - if (blockDefaultAlign) { - nextAlign = ''; - } - } - - props.setAttributes({ - align: nextAlign - }); - }; - - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !!validAlignments.length && Object(external_wp_element_["createElement"])(block_controls["b" /* default */], { - group: "block", - __experimentalShareWithChildBlocks: true - }, Object(external_wp_element_["createElement"])(block_alignment_control["a" /* BlockAlignmentControl */], { - value: props.attributes.align, - onChange: updateAlignment, - controls: validAlignments - })), Object(external_wp_element_["createElement"])(BlockEdit, props)); -}, 'withToolbarControls'); -/** - * Override the default block element to add alignment wrapper props. - * - * @param {Function} BlockListBlock Original component. - * - * @return {Function} Wrapped component. - */ - -const withDataAlign = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => { +function useTabNav() { + const container = (0,external_wp_element_namespaceObject.useRef)(); + const focusCaptureBeforeRef = (0,external_wp_element_namespaceObject.useRef)(); + const focusCaptureAfterRef = (0,external_wp_element_namespaceObject.useRef)(); + const lastFocus = (0,external_wp_element_namespaceObject.useRef)(); const { - name, - attributes - } = props; + hasMultiSelection, + getSelectedBlockClientId, + getBlockCount + } = (0,external_wp_data_namespaceObject.useSelect)(store); const { - align - } = attributes; - const blockAllowedAlignments = getValidAlignments(Object(external_wp_blocks_["getBlockSupport"])(name, 'align'), Object(external_wp_blocks_["hasBlockSupport"])(name, 'alignWide', true)); - const validAlignments = Object(use_available_alignments["a" /* default */])(blockAllowedAlignments); // If an alignment is not assigned, there's no need to go through the - // effort to validate or assign its value. - - if (align === undefined) { - return Object(external_wp_element_["createElement"])(BlockListBlock, props); - } - - let wrapperProps = props.wrapperProps; - - if (validAlignments.some(alignment => alignment.name === align)) { - wrapperProps = { ...wrapperProps, - 'data-align': align - }; - } - - return Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, { - wrapperProps: wrapperProps - })); -}); -/** - * Override props assigned to save component to inject alignment class name if - * block supports it. - * - * @param {Object} props Additional props applied to save element. - * @param {Object} blockType Block type. - * @param {Object} attributes Block attributes. - * - * @return {Object} Filtered props applied to save element. - */ - -function addAssignedAlign(props, blockType, attributes) { - const { - align - } = attributes; - const blockAlign = Object(external_wp_blocks_["getBlockSupport"])(blockType, 'align'); - const hasWideBlockSupport = Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'alignWide', true); // Compute valid alignments without taking into account if - // the theme supports wide alignments or not. - // This way changing themes does not impact the block save. - - const isAlignValid = getValidAlignments(blockAlign, hasWideBlockSupport).includes(align); - - if (isAlignValid) { - props.className = classnames_default()(`align${align}`, props.className); - } - - return props; -} -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/align/addAttribute', addAttribute); -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/editor/align/with-data-align', withDataAlign); -Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/editor/align/with-toolbar-controls', withToolbarControls); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/align/addAssignedAlign', addAssignedAlign); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/lock.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Filters registered block settings, extending attributes to include `lock`. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - -function lock_addAttribute(settings) { - // allow blocks to specify their own attribute definition with default values if needed. - if (Object(external_lodash_["has"])(settings.attributes, ['lock', 'type'])) { - return settings; - } // Gracefully handle if settings.attributes is undefined. - - - settings.attributes = { ...settings.attributes, - lock: { - type: 'object' - } - }; - return settings; -} -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/lock/addAttribute', lock_addAttribute); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/index.js -var inspector_controls = __webpack_require__("1oY3"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/anchor.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - -/** - * Regular expression matching invalid anchor characters for replacement. - * - * @type {RegExp} - */ - -const ANCHOR_REGEX = /[\s#]/g; -/** - * Filters registered block settings, extending attributes with anchor using ID - * of the first node. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - -function anchor_addAttribute(settings) { - // allow blocks to specify their own attribute definition with default values if needed. - if (Object(external_lodash_["has"])(settings.attributes, ['anchor', 'type'])) { - return settings; - } - - if (Object(external_wp_blocks_["hasBlockSupport"])(settings, 'anchor')) { - // Gracefully handle if settings.attributes is undefined. - settings.attributes = { ...settings.attributes, - anchor: { - type: 'string', - source: 'attribute', - attribute: 'id', - selector: '*' - } - }; - } - - return settings; -} -/** - * Override the default edit UI to include a new block inspector control for - * assigning the anchor ID, if block supports anchor. - * - * @param {WPComponent} BlockEdit Original component. - * - * @return {WPComponent} Wrapped component. - */ - -const withInspectorControl = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => { - return props => { - const hasAnchor = Object(external_wp_blocks_["hasBlockSupport"])(props.name, 'anchor'); - - if (hasAnchor && props.isSelected) { - const isWeb = external_wp_element_["Platform"].OS === 'web'; - const textControl = Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - className: "html-anchor-control", - label: Object(external_wp_i18n_["__"])('HTML anchor'), - help: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_i18n_["__"])('Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'), isWeb && Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { - href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/page-jumps/') - }, Object(external_wp_i18n_["__"])('Learn more about anchors'))), - value: props.attributes.anchor || '', - placeholder: !isWeb ? Object(external_wp_i18n_["__"])('Add an anchor') : null, - onChange: nextValue => { - nextValue = nextValue.replace(ANCHOR_REGEX, '-'); - props.setAttributes({ - anchor: nextValue - }); - }, - autoCapitalize: "none", - autoComplete: "off" - }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(BlockEdit, props), isWeb && Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], { - __experimentalGroup: "advanced" - }, textControl), !isWeb && props.name === 'core/heading' && Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Heading settings') - }, textControl))); - } - - return Object(external_wp_element_["createElement"])(BlockEdit, props); - }; -}, 'withInspectorControl'); -/** - * Override props assigned to save component to inject anchor ID, if block - * supports anchor. This is only applied if the block's save result is an - * element and not a markup string. - * - * @param {Object} extraProps Additional props applied to save element. - * @param {Object} blockType Block type. - * @param {Object} attributes Current block attributes. - * - * @return {Object} Filtered props applied to save element. - */ - -function addSaveProps(extraProps, blockType, attributes) { - if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'anchor')) { - extraProps.id = attributes.anchor === '' ? null : attributes.anchor; - } - - return extraProps; -} -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/anchor/attribute', anchor_addAttribute); -Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/editor/anchor/with-inspector-control', withInspectorControl); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/anchor/save-props', addSaveProps); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/custom-class-name.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - -/** - * Filters registered block settings, extending attributes with anchor using ID - * of the first node. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - -function custom_class_name_addAttribute(settings) { - if (Object(external_wp_blocks_["hasBlockSupport"])(settings, 'customClassName', true)) { - // Gracefully handle if settings.attributes is undefined. - settings.attributes = { ...settings.attributes, - className: { - type: 'string' - } - }; - } - - return settings; -} -/** - * Override the default edit UI to include a new block inspector control for - * assigning the custom class name, if block supports custom class name. - * - * @param {WPComponent} BlockEdit Original component. - * - * @return {WPComponent} Wrapped component. - */ - -const custom_class_name_withInspectorControl = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => { - return props => { - const hasCustomClassName = Object(external_wp_blocks_["hasBlockSupport"])(props.name, 'customClassName', true); - - if (hasCustomClassName && props.isSelected) { - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(BlockEdit, props), Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], { - __experimentalGroup: "advanced" - }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - autoComplete: "off", - label: Object(external_wp_i18n_["__"])('Additional CSS class(es)'), - value: props.attributes.className || '', - onChange: nextValue => { - props.setAttributes({ - className: nextValue !== '' ? nextValue : undefined - }); - }, - help: Object(external_wp_i18n_["__"])('Separate multiple classes with spaces.') - }))); - } - - return Object(external_wp_element_["createElement"])(BlockEdit, props); - }; -}, 'withInspectorControl'); -/** - * Override props assigned to save component to inject anchor ID, if block - * supports anchor. This is only applied if the block's save result is an - * element and not a markup string. - * - * @param {Object} extraProps Additional props applied to save element. - * @param {Object} blockType Block type. - * @param {Object} attributes Current block attributes. - * - * @return {Object} Filtered props applied to save element. - */ - -function custom_class_name_addSaveProps(extraProps, blockType, attributes) { - if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'customClassName', true) && attributes.className) { - extraProps.className = classnames_default()(extraProps.className, attributes.className); - } - - return extraProps; -} -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/custom-class-name/attribute', custom_class_name_addAttribute); -Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/editor/custom-class-name/with-inspector-control', custom_class_name_withInspectorControl); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/custom-class-name/save-props', custom_class_name_addSaveProps); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/generated-class-name.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - -/** - * Override props assigned to save component to inject generated className if - * block supports it. This is only applied if the block's save result is an - * element and not a markup string. - * - * @param {Object} extraProps Additional props applied to save element. - * @param {Object} blockType Block type. - * - * @return {Object} Filtered props applied to save element. - */ - -function addGeneratedClassName(extraProps, blockType) { - // Adding the generated className - if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'className', true)) { - if (typeof extraProps.className === 'string') { - // We have some extra classes and want to add the default classname - // We use uniq to prevent duplicate classnames - extraProps.className = Object(external_lodash_["uniq"])([Object(external_wp_blocks_["getBlockDefaultClassName"])(blockType.name), ...extraProps.className.split(' ')]).join(' ').trim(); + setNavigationMode + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const isNavigationMode = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isNavigationMode(), []); // Don't allow tabbing to this element in Navigation mode. + + const focusCaptureTabIndex = !isNavigationMode ? '0' : undefined; // Reference that holds the a flag for enabling or disabling + // capturing on the focus capture elements. + + const noCapture = (0,external_wp_element_namespaceObject.useRef)(); + + function onFocusCapture(event) { + // Do not capture incoming focus if set by us in WritingFlow. + if (noCapture.current) { + noCapture.current = null; + } else if (hasMultiSelection()) { + container.current.focus(); + } else if (getSelectedBlockClientId()) { + lastFocus.current.focus(); } else { - // There is no string in the className variable, - // so we just dump the default name in there - extraProps.className = Object(external_wp_blocks_["getBlockDefaultClassName"])(blockType.name); + setNavigationMode(true); + const isBefore = // eslint-disable-next-line no-bitwise + event.target.compareDocumentPosition(container.current) & event.target.DOCUMENT_POSITION_FOLLOWING; + const action = isBefore ? 'findNext' : 'findPrevious'; + external_wp_dom_namespaceObject.focus.tabbable[action](event.target).focus(); } } - return extraProps; + const before = (0,external_wp_element_namespaceObject.createElement)("div", { + ref: focusCaptureBeforeRef, + tabIndex: focusCaptureTabIndex, + onFocus: onFocusCapture + }); + const after = (0,external_wp_element_namespaceObject.createElement)("div", { + ref: focusCaptureAfterRef, + tabIndex: focusCaptureTabIndex, + onFocus: onFocusCapture + }); + const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function onKeyDown(event) { + if (event.defaultPrevented) { + return; + } + + if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !hasMultiSelection()) { + event.preventDefault(); + setNavigationMode(true); + return; + } // In Edit mode, Tab should focus the first tabbable element after + // the content, which is normally the sidebar (with block controls) + // and Shift+Tab should focus the first tabbable element before the + // content, which is normally the block toolbar. + // Arrow keys can be used, and Tab and arrow keys can be used in + // Navigation mode (press Esc), to navigate through blocks. + + + if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) { + return; + } + + const isShift = event.shiftKey; + const direction = isShift ? 'findPrevious' : 'findNext'; + + if (!hasMultiSelection() && !getSelectedBlockClientId()) { + // Preserve the behaviour of entering navigation mode when + // tabbing into the content without a block selection. + // `onFocusCapture` already did this previously, but we need to + // do it again here because after clearing block selection, + // focus land on the writing flow container and pressing Tab + // will no longer send focus through the focus capture element. + if (event.target === node) setNavigationMode(true); + return; + } // Allow tabbing between form elements rendered in a block, + // such as inside a placeholder. Form elements are generally + // meant to be UI rather than part of the content. Ideally + // these are not rendered in the content and perhaps in the + // future they can be rendered in an iframe or shadow DOM. + + + if (isFormElement(event.target) && isFormElement(external_wp_dom_namespaceObject.focus.tabbable[direction](event.target))) { + return; + } + + const next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef; // Disable focus capturing on the focus capture element, so it + // doesn't refocus this block and so it allows default behaviour + // (moving focus to the next tabbable element). + + noCapture.current = true; // Focusing the focus capture element, which is located above and + // below the editor, should not scroll the page all the way up or + // down. + + next.current.focus({ + preventScroll: true + }); + } + + function onFocusOut(event) { + lastFocus.current = event.target; + const { + ownerDocument + } = node; // If focus disappears due to there being no blocks, move focus to + // the writing flow wrapper. + + if (!event.relatedTarget && ownerDocument.activeElement === ownerDocument.body && getBlockCount() === 0) { + node.focus(); + } + } // When tabbing back to an element in block list, this event handler prevents scrolling if the + // focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph + // when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the + // top or bottom of the document. + // + // Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this + // earlier in the keypress handler, and call focus( { preventScroll: true } ) instead. + // https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters + + + function preventScrollOnTab(event) { + var _event$target; + + if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) { + return; + } + + if (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute('role')) === 'region') { + return; + } + + if (container.current === event.target) { + return; + } + + const isShift = event.shiftKey; + const direction = isShift ? 'findPrevious' : 'findNext'; + const target = external_wp_dom_namespaceObject.focus.tabbable[direction](event.target); // only do something when the next tabbable is a focus capture div (before/after) + + if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) { + event.preventDefault(); + target.focus({ + preventScroll: true + }); + } + } + + const { + ownerDocument + } = node; + const { + defaultView + } = ownerDocument; + defaultView.addEventListener('keydown', preventScrollOnTab); + node.addEventListener('keydown', onKeyDown); + node.addEventListener('focusout', onFocusOut); + return () => { + defaultView.removeEventListener('keydown', preventScrollOnTab); + node.removeEventListener('keydown', onKeyDown); + node.removeEventListener('focusout', onFocusOut); + }; + }, []); + const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([container, ref]); + return [before, mergedRefs, after]; } -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/generated-class-name/save-props', addGeneratedClassName); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js + 4 modules -var block_list = __webpack_require__("VyCT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js -var use_setting = __webpack_require__("v5LD"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/dropdown.js -var dropdown = __webpack_require__("dchM"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js -var use_multiple_origin_colors_and_gradients = __webpack_require__("0LBR"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/utils.js -var utils = __webpack_require__("bVpQ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/utils.js -var hooks_utils = __webpack_require__("715p"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-color.js - - +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-arrow-nav.js /** * External dependencies */ @@ -41951,3917 +18435,335 @@ var hooks_utils = __webpack_require__("715p"); - - - - // Defining empty array here instead of inline avoids unnecessary re-renders of -// color control. - -const EMPTY_ARRAY = []; /** - * Inspector control panel containing the border color related configuration. + * Returns true if the element should consider edge navigation upon a keyboard + * event of the given directional key code, or false otherwise. * - * There is deliberate overlap between the colors and borders block supports - * relating to border color. It can be argued the border color controls could - * be included within either, or both, the colors and borders panels in the - * inspector controls. If they share the same block attributes it should not - * matter. + * @param {Element} element HTML element to test. + * @param {number} keyCode KeyboardEvent keyCode to test. + * @param {boolean} hasModifier Whether a modifier is pressed. * - * @param {Object} props Block properties. - * - * @return {WPElement} Border color edit element. + * @return {boolean} Whether element should consider edge navigation. */ -function BorderColorEdit(props) { +function isNavigationCandidate(element, keyCode, hasModifier) { + const isVertical = keyCode === external_wp_keycodes_namespaceObject.UP || keyCode === external_wp_keycodes_namespaceObject.DOWN; // Currently, all elements support unmodified vertical navigation. + + if (isVertical && !hasModifier) { + return true; + } // Native inputs should not navigate horizontally. + + const { - attributes: { - borderColor, - style - }, - setAttributes - } = props; - const colorGradientSettings = Object(use_multiple_origin_colors_and_gradients["a" /* default */])(); - const availableColors = colorGradientSettings.colors.reduce((colors, origin) => colors.concat(origin.colors), []); - const [colorValue, setColorValue] = Object(external_wp_element_["useState"])(() => { - var _getColorObjectByAttr, _style$border; - - return (_getColorObjectByAttr = Object(utils["b" /* getColorObjectByAttributeValues */])(availableColors, borderColor, style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.color)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color; - }); - - const onChangeColor = value => { - setColorValue(value); - const colorObject = Object(utils["c" /* getColorObjectByColorValue */])(availableColors, value); - const newStyle = { ...style, - border: { ...(style === null || style === void 0 ? void 0 : style.border), - color: colorObject !== null && colorObject !== void 0 && colorObject.slug ? undefined : value - } - }; // If empty slug, ensure undefined to remove attribute. - - const newNamedColor = colorObject !== null && colorObject !== void 0 && colorObject.slug ? colorObject.slug : undefined; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle), - borderColor: newNamedColor - }); - }; - - const settings = [{ - label: Object(external_wp_i18n_["__"])('Color'), - onColorChange: onChangeColor, - colorValue, - clearable: false - }]; - return Object(external_wp_element_["createElement"])(dropdown["a" /* default */], Object(esm_extends["a" /* default */])({ - settings: settings, - disableCustomColors: true, - disableCustomGradients: true, - __experimentalHasMultipleOrigins: true, - __experimentalIsRenderedInSidebar: true, - enableAlpha: true - }, colorGradientSettings)); + tagName + } = element; + return tagName !== 'INPUT' && tagName !== 'TEXTAREA'; } /** - * Filters registered block settings, extending attributes to include - * `borderColor` if needed. + * Returns the optimal tab target from the given focused element in the desired + * direction. A preference is made toward text fields, falling back to the block + * focus stop if no other candidates exist for the block. * - * @param {Object} settings Original block settings. + * @param {Element} target Currently focused text field. + * @param {boolean} isReverse True if considering as the first field. + * @param {Element} containerElement Element containing all blocks. + * @param {boolean} onlyVertical Whether to only consider tabbable elements + * that are visually above or under the + * target. * - * @return {Object} Updated block settings. + * @return {?Element} Optimal tab target, if one exists. */ -function addAttributes(settings) { - if (!hasBorderSupport(settings, 'color')) { - return settings; - } // Allow blocks to specify default value if needed. +function getClosestTabbable(target, isReverse, containerElement, onlyVertical) { + // Since the current focus target is not guaranteed to be a text field, find + // all focusables. Tabbability is considered later. + let focusableNodes = external_wp_dom_namespaceObject.focus.focusable.find(containerElement); + + if (isReverse) { + focusableNodes = (0,external_lodash_namespaceObject.reverse)(focusableNodes); + } // Consider as candidates those focusables after the current target. It's + // assumed this can only be reached if the target is focusable (on its + // keydown event), so no need to verify it exists in the set. - if (settings.attributes.borderColor) { - return settings; - } // Add new borderColor attribute to block settings. + focusableNodes = focusableNodes.slice(focusableNodes.indexOf(target) + 1); + let targetRect; - - return { ...settings, - attributes: { ...settings.attributes, - borderColor: { - type: 'string' - } - } - }; -} -/** - * Override props assigned to save component to inject border color. - * - * @param {Object} props Additional props applied to save element. - * @param {Object} blockType Block type definition. - * @param {Object} attributes Block's attributes. - * - * @return {Object} Filtered props to apply to save element. - */ - - -function border_color_addSaveProps(props, blockType, attributes) { - var _style$border2; - - if (!hasBorderSupport(blockType, 'color') || shouldSkipSerialization(blockType)) { - return props; + if (onlyVertical) { + targetRect = target.getBoundingClientRect(); } - const { - borderColor, - style - } = attributes; - const borderColorClass = Object(utils["a" /* getColorClassName */])('border-color', borderColor); - const newClassName = classnames_default()(props.className, { - 'has-border-color': borderColor || (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.color), - [borderColorClass]: !!borderColorClass - }); // If we are clearing the last of the previous classes in `className` - // set it to `undefined` to avoid rendering empty DOM attributes. - - props.className = newClassName ? newClassName : undefined; - return props; -} -/** - * Filters the registered block settings to apply border color styles and - * classnames to the block edit wrapper. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ + function isTabCandidate(node) { + // Not a candidate if the node is not tabbable. + if (!external_wp_dom_namespaceObject.focus.tabbable.isTabbableIndex(node)) { + return false; + } // Skip focusable elements such as links within content editable nodes. -function addEditProps(settings) { - if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings)) { - return settings; - } - - const existingGetEditWrapperProps = settings.getEditWrapperProps; - - settings.getEditWrapperProps = attributes => { - let props = {}; - - if (existingGetEditWrapperProps) { - props = existingGetEditWrapperProps(attributes); + if (node.isContentEditable && node.contentEditable !== 'true') { + return false; } - return border_color_addSaveProps(props, settings, attributes); - }; + if (onlyVertical) { + const nodeRect = node.getBoundingClientRect(); - return settings; -} -/** - * This adds inline styles for color palette colors. - * Ideally, this is not needed and themes should load their palettes on the editor. - * - * @param {Function} BlockListBlock Original component. - * - * @return {Function} Wrapped component. - */ - - -const withBorderColorPaletteStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => { - var _getColorObjectByAttr2, _props$wrapperProps; - - const { - name, - attributes - } = props; - const { - borderColor - } = attributes; - const colors = Object(use_setting["a" /* default */])('color.palette') || EMPTY_ARRAY; - - if (!hasBorderSupport(name, 'color') || shouldSkipSerialization(name)) { - return Object(external_wp_element_["createElement"])(BlockListBlock, props); - } - - const extraStyles = { - borderColor: borderColor ? (_getColorObjectByAttr2 = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, borderColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color : undefined - }; - let wrapperProps = props.wrapperProps; - wrapperProps = { ...props.wrapperProps, - style: { ...extraStyles, - ...((_props$wrapperProps = props.wrapperProps) === null || _props$wrapperProps === void 0 ? void 0 : _props$wrapperProps.style) - } - }; - return Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, { - wrapperProps: wrapperProps - })); -}); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/border/addAttributes', addAttributes); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/border/addSaveProps', border_color_addSaveProps); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/border/addEditProps', addEditProps); -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/border/with-border-color-palette-styles', withBorderColorPaletteStyles); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js + 4 modules -var border_radius_control = __webpack_require__("Wy3j"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-radius.js - - -/** - * Internal dependencies - */ - - -/** - * Inspector control panel containing the border radius related configuration. - * - * @param {Object} props Block properties. - * - * @return {WPElement} Border radius edit element. - */ - -function BorderRadiusEdit(props) { - var _style$border; - - const { - attributes: { - style - }, - setAttributes - } = props; - - const onChange = newRadius => { - let newStyle = { ...style, - border: { ...(style === null || style === void 0 ? void 0 : style.border), - radius: newRadius + if (nodeRect.left >= targetRect.right || nodeRect.right <= targetRect.left) { + return false; } - }; - - if (newRadius === undefined || newRadius === '') { - newStyle = Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle); } - setAttributes({ - style: newStyle - }); - }; - - return Object(external_wp_element_["createElement"])(border_radius_control["a" /* default */], { - values: style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius, - onChange: onChange - }); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-style-control/index.js + 2 modules -var border_style_control = __webpack_require__("2YCo"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-style.js - - -/** - * Internal dependencies - */ - - -/** - * Inspector control for configuring border style property. - * - * @param {Object} props Block properties. - * - * @return {WPElement} Border style edit element. - */ - -const BorderStyleEdit = props => { - var _style$border; - - const { - attributes: { - style - }, - setAttributes - } = props; - - const onChange = newBorderStyle => { - const newStyleAttributes = { ...style, - border: { ...(style === null || style === void 0 ? void 0 : style.border), - style: newBorderStyle - } - }; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyleAttributes) - }); - }; - - return Object(external_wp_element_["createElement"])(border_style_control["a" /* default */], { - value: style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.style, - onChange: onChange - }); -}; - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-width.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -const MIN_BORDER_WIDTH = 0; -/** - * Inspector control for configuring border width property. - * - * @param {Object} props Block properties. - * - * @return {WPElement} Border width edit element. - */ - -const BorderWidthEdit = props => { - const { - attributes: { - borderColor, - style - }, - setAttributes - } = props; - const { - width, - color: customBorderColor, - style: borderStyle - } = (style === null || style === void 0 ? void 0 : style.border) || {}; - const [styleSelection, setStyleSelection] = Object(external_wp_element_["useState"])(); - const [colorSelection, setColorSelection] = Object(external_wp_element_["useState"])(); // Temporarily track previous border color & style selections to be able to - // restore them when border width changes from zero value. - - Object(external_wp_element_["useEffect"])(() => { - if (borderStyle !== 'none') { - setStyleSelection(borderStyle); - } - }, [borderStyle]); - Object(external_wp_element_["useEffect"])(() => { - if (borderColor || customBorderColor) { - setColorSelection({ - name: !!borderColor ? borderColor : undefined, - color: !!customBorderColor ? customBorderColor : undefined - }); - } - }, [borderColor, customBorderColor]); - - const onChange = newWidth => { - let newStyle = { ...style, - border: { ...(style === null || style === void 0 ? void 0 : style.border), - width: newWidth - } - }; // Used to clear named border color attribute. - - let borderPaletteColor = borderColor; - const hasZeroWidth = parseFloat(newWidth) === 0; // Setting the border width explicitly to zero will also set the - // border style to `none` and clear border color attributes. - - if (hasZeroWidth) { - borderPaletteColor = undefined; - newStyle.border.color = undefined; - newStyle.border.style = 'none'; - } // Restore previous border style selection if width is now not zero and - // border style was 'none'. This is to support changes to the UI which - // change the border style UI to a segmented control without a "none" - // option. - - - if (!hasZeroWidth && borderStyle === 'none') { - newStyle.border.style = styleSelection; - } // Restore previous border color selection if width is no longer zero - // and current border color is undefined. - - - if (!hasZeroWidth && borderColor === undefined) { - borderPaletteColor = colorSelection === null || colorSelection === void 0 ? void 0 : colorSelection.name; - newStyle.border.color = colorSelection === null || colorSelection === void 0 ? void 0 : colorSelection.color; - } // If width was reset, clean out undefined styles. - - - if (newWidth === undefined || newWidth === '') { - newStyle = Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle); - } - - setAttributes({ - borderColor: borderPaletteColor, - style: newStyle - }); - }; - - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(use_setting["a" /* default */])('spacing.units') || ['px', 'em', 'rem'] - }); - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], { - value: width, - label: Object(external_wp_i18n_["__"])('Width'), - min: MIN_BORDER_WIDTH, - onChange: onChange, - units: units - }); -}; - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - - - -const BORDER_SUPPORT_KEY = '__experimentalBorder'; -function BorderPanel(props) { - const isDisabled = useIsBorderDisabled(props); - const isSupported = hasBorderSupport(props.name); - const isColorSupported = Object(use_setting["a" /* default */])('border.color') && hasBorderSupport(props.name, 'color'); - const isRadiusSupported = Object(use_setting["a" /* default */])('border.radius') && hasBorderSupport(props.name, 'radius'); - const isStyleSupported = Object(use_setting["a" /* default */])('border.style') && hasBorderSupport(props.name, 'style'); - const isWidthSupported = Object(use_setting["a" /* default */])('border.width') && hasBorderSupport(props.name, 'width'); - - if (isDisabled || !isSupported) { - return null; - } - - return Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - className: "block-editor-hooks__border-controls", - title: Object(external_wp_i18n_["__"])('Border'), - initialOpen: false - }, (isWidthSupported || isStyleSupported) && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-hooks__border-controls-row" - }, isWidthSupported && Object(external_wp_element_["createElement"])(BorderWidthEdit, props), isStyleSupported && Object(external_wp_element_["createElement"])(BorderStyleEdit, props)), isColorSupported && Object(external_wp_element_["createElement"])(BorderColorEdit, props), isRadiusSupported && Object(external_wp_element_["createElement"])(BorderRadiusEdit, props))); -} -/** - * Determine whether there is block support for border properties. - * - * @param {string} blockName Block name. - * @param {string} feature Border feature to check support for. - * - * @return {boolean} Whether there is support. - */ - -function hasBorderSupport(blockName) { - let feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any'; - - if (external_wp_element_["Platform"].OS !== 'web') { - return false; - } - - const support = Object(external_wp_blocks_["getBlockSupport"])(blockName, BORDER_SUPPORT_KEY); - - if (support === true) { return true; } - if (feature === 'any') { - return !!(support !== null && support !== void 0 && support.color || support !== null && support !== void 0 && support.radius || support !== null && support !== void 0 && support.width || support !== null && support !== void 0 && support.style); - } - - return !!(support !== null && support !== void 0 && support[feature]); + return (0,external_lodash_namespaceObject.find)(focusableNodes, isTabCandidate); } -/** - * Check whether serialization of border classes and styles should be skipped. - * - * @param {string|Object} blockType Block name or block type object. - * - * @return {boolean} Whether serialization of border properties should occur. - */ +function useArrowNav() { + const { + getSelectedBlockClientId, + getMultiSelectedBlocksStartClientId, + getMultiSelectedBlocksEndClientId, + getPreviousBlockClientId, + getNextBlockClientId, + getFirstMultiSelectedBlockClientId, + getLastMultiSelectedBlockClientId, + getSettings, + hasMultiSelection + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + multiSelect, + selectBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + // Here a DOMRect is stored while moving the caret vertically so + // vertical position of the start position can be restored. This is to + // recreate browser behaviour across blocks. + let verticalRect; -function shouldSkipSerialization(blockType) { - const support = Object(external_wp_blocks_["getBlockSupport"])(blockType, BORDER_SUPPORT_KEY); - return support === null || support === void 0 ? void 0 : support.__experimentalSkipSerialization; -} -/** - * Determines if all border support features have been disabled. - * - * @return {boolean} If border support is completely disabled. - */ - -const useIsBorderDisabled = () => { - const configs = [!Object(use_setting["a" /* default */])('border.color'), !Object(use_setting["a" /* default */])('border.radius'), !Object(use_setting["a" /* default */])('border.style'), !Object(use_setting["a" /* default */])('border.width')]; - return configs.every(Boolean); -}; - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/gradients/use-gradient.js -var use_gradient = __webpack_require__("Cn0l"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js -var panel_color_gradient_settings = __webpack_require__("yU1v"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/contrast-checker/index.js -var contrast_checker = __webpack_require__("6c9H"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js -var use_block_refs = __webpack_require__("PKbb"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color-panel.js - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - - -function getComputedStyle(node) { - return node.ownerDocument.defaultView.getComputedStyle(node); -} - -function ColorPanel(_ref) { - let { - settings, - clientId, - enableContrastChecking = true, - showTitle = true - } = _ref; - const [detectedBackgroundColor, setDetectedBackgroundColor] = Object(external_wp_element_["useState"])(); - const [detectedColor, setDetectedColor] = Object(external_wp_element_["useState"])(); - const ref = Object(use_block_refs["b" /* __unstableUseBlockRef */])(clientId); - Object(external_wp_element_["useEffect"])(() => { - if (!enableContrastChecking) { - return; + function onMouseDown() { + verticalRect = null; } - if (!ref.current) { - return; - } - - setDetectedColor(getComputedStyle(ref.current).color); - let backgroundColorNode = ref.current; - let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; - - while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) { - backgroundColorNode = backgroundColorNode.parentNode; - backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; - } - - setDetectedBackgroundColor(backgroundColor); - }); - return Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], null, Object(external_wp_element_["createElement"])(panel_color_gradient_settings["a" /* default */], { - title: Object(external_wp_i18n_["__"])('Color'), - initialOpen: false, - settings: settings, - showTitle: showTitle, - __experimentalHasMultipleOrigins: true, - __experimentalIsRenderedInSidebar: true - }, enableContrastChecking && Object(external_wp_element_["createElement"])(contrast_checker["a" /* default */], { - backgroundColor: detectedBackgroundColor, - textColor: detectedColor - }))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - -const COLOR_SUPPORT_KEY = 'color'; - -const hasColorSupport = blockType => { - const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY); - return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false); -}; - -const color_shouldSkipSerialization = blockType => { - const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY); - return colorSupport === null || colorSupport === void 0 ? void 0 : colorSupport.__experimentalSkipSerialization; -}; - -const hasLinkColorSupport = blockType => { - if (external_wp_element_["Platform"].OS !== 'web') { - return false; - } - - const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY); - return Object(external_lodash_["isObject"])(colorSupport) && !!colorSupport.link; -}; - -const hasGradientSupport = blockType => { - const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY); - return Object(external_lodash_["isObject"])(colorSupport) && !!colorSupport.gradients; -}; - -const hasBackgroundColorSupport = blockType => { - const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY); - return colorSupport && colorSupport.background !== false; -}; - -const hasTextColorSupport = blockType => { - const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY); - return colorSupport && colorSupport.text !== false; -}; -/** - * Filters registered block settings, extending attributes to include - * `backgroundColor` and `textColor` attribute. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - - -function color_addAttributes(settings) { - if (!hasColorSupport(settings)) { - return settings; - } // allow blocks to specify their own attribute definition with default values if needed. - - - if (!settings.attributes.backgroundColor) { - Object.assign(settings.attributes, { - backgroundColor: { - type: 'string' - } - }); - } - - if (!settings.attributes.textColor) { - Object.assign(settings.attributes, { - textColor: { - type: 'string' - } - }); - } - - if (hasGradientSupport(settings) && !settings.attributes.gradient) { - Object.assign(settings.attributes, { - gradient: { - type: 'string' - } - }); - } - - return settings; -} -/** - * Override props assigned to save component to inject colors classnames. - * - * @param {Object} props Additional props applied to save element. - * @param {Object} blockType Block type. - * @param {Object} attributes Block attributes. - * - * @return {Object} Filtered props applied to save element. - */ - - -function color_addSaveProps(props, blockType, attributes) { - var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link; - - if (!hasColorSupport(blockType) || color_shouldSkipSerialization(blockType)) { - return props; - } - - const hasGradient = hasGradientSupport(blockType); // I'd have prefered to avoid the "style" attribute usage here - - const { - backgroundColor, - textColor, - gradient, - style - } = attributes; - const backgroundClass = Object(utils["a" /* getColorClassName */])('background-color', backgroundColor); - - const gradientClass = Object(use_gradient["a" /* __experimentalGetGradientClass */])(gradient); - - const textClass = Object(utils["a" /* getColorClassName */])('color', textColor); - const newClassName = classnames_default()(props.className, textClass, gradientClass, { - // Don't apply the background class if there's a custom gradient - [backgroundClass]: (!hasGradient || !(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.gradient)) && !!backgroundClass, - 'has-text-color': textColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.text), - 'has-background': backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.background) || hasGradient && (gradient || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.gradient)), - 'has-link-color': style === null || style === void 0 ? void 0 : (_style$elements = style.elements) === null || _style$elements === void 0 ? void 0 : (_style$elements$link = _style$elements.link) === null || _style$elements$link === void 0 ? void 0 : _style$elements$link.color - }); - props.className = newClassName ? newClassName : undefined; - return props; -} -/** - * Filters registered block settings to extand the block edit wrapper - * to apply the desired styles and classnames properly. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - -function color_addEditProps(settings) { - if (!hasColorSupport(settings) || color_shouldSkipSerialization(settings)) { - return settings; - } - - const existingGetEditWrapperProps = settings.getEditWrapperProps; - - settings.getEditWrapperProps = attributes => { - let props = {}; - - if (existingGetEditWrapperProps) { - props = existingGetEditWrapperProps(attributes); - } - - return color_addSaveProps(props, settings, attributes); - }; - - return settings; -} - -const getLinkColorFromAttributeValue = (colors, value) => { - const attributeParsed = /var:preset\|color\|(.+)/.exec(value); - - if (attributeParsed && attributeParsed[1]) { - return Object(utils["b" /* getColorObjectByAttributeValues */])(colors, attributeParsed[1]).color; - } - - return value; -}; - -function immutableSet(object, path, value) { - return Object(external_lodash_["setWith"])(object ? Object(external_lodash_["clone"])(object) : {}, path, value, external_lodash_["clone"]); -} -/** - * Inspector control panel containing the color related configuration - * - * @param {Object} props - * - * @return {WPElement} Color edit element. - */ - - -function ColorEdit(props) { - var _style$color6, _style$color7, _style$color8, _style$elements2, _style$elements2$link, _style$elements2$link2, _style$elements3, _style$elements3$link, _style$elements3$link2; - - const { - name: blockName, - attributes - } = props; // Some color settings have a special handling for deprecated flags in `useSetting`, - // so we can't unwrap them by doing const { ... } = useSetting('color') - // until https://github.com/WordPress/gutenberg/issues/37094 is fixed. - - const userPalette = Object(use_setting["a" /* default */])('color.palette.custom'); - const themePalette = Object(use_setting["a" /* default */])('color.palette.theme'); - const defaultPalette = Object(use_setting["a" /* default */])('color.palette.default'); - const allSolids = Object(external_wp_element_["useMemo"])(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); - const userGradientPalette = Object(use_setting["a" /* default */])('color.gradients.custom'); - const themeGradientPalette = Object(use_setting["a" /* default */])('color.gradients.theme'); - const defaultGradientPalette = Object(use_setting["a" /* default */])('color.gradients.default'); - const allGradients = Object(external_wp_element_["useMemo"])(() => [...(userGradientPalette || []), ...(themeGradientPalette || []), ...(defaultGradientPalette || [])], [userGradientPalette, themeGradientPalette, defaultGradientPalette]); - const areCustomSolidsEnabled = Object(use_setting["a" /* default */])('color.custom'); - const areCustomGradientsEnabled = Object(use_setting["a" /* default */])('color.customGradient'); - const isBackgroundEnabled = Object(use_setting["a" /* default */])('color.background'); - const isLinkEnabled = Object(use_setting["a" /* default */])('color.link'); - const isTextEnabled = Object(use_setting["a" /* default */])('color.text'); - const solidsEnabled = areCustomSolidsEnabled || !themePalette || (themePalette === null || themePalette === void 0 ? void 0 : themePalette.length) > 0; - const gradientsEnabled = areCustomGradientsEnabled || !themeGradientPalette || (themeGradientPalette === null || themeGradientPalette === void 0 ? void 0 : themeGradientPalette.length) > 0; // Shouldn't be needed but right now the ColorGradientsPanel - // can trigger both onChangeColor and onChangeBackground - // synchronously causing our two callbacks to override changes - // from each other. - - const localAttributes = Object(external_wp_element_["useRef"])(attributes); - Object(external_wp_element_["useEffect"])(() => { - localAttributes.current = attributes; - }, [attributes]); - - if (!hasColorSupport(blockName)) { - return null; - } - - const hasLinkColor = hasLinkColorSupport(blockName) && isLinkEnabled && solidsEnabled; - const hasTextColor = hasTextColorSupport(blockName) && isTextEnabled && solidsEnabled; - const hasBackgroundColor = hasBackgroundColorSupport(blockName) && isBackgroundEnabled && solidsEnabled; - const hasGradientColor = hasGradientSupport(blockName) && gradientsEnabled; - - if (!hasLinkColor && !hasTextColor && !hasBackgroundColor && !hasGradientColor) { - return null; - } - - const { - style, - textColor, - backgroundColor, - gradient - } = attributes; - let gradientValue; - - if (hasGradientColor && gradient) { - gradientValue = Object(use_gradient["e" /* getGradientValueBySlug */])(allGradients, gradient); - } else if (hasGradientColor) { - var _style$color5; - - gradientValue = style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient; - } - - const onChangeColor = name => value => { - var _localAttributes$curr, _localAttributes$curr2; - - const colorObject = Object(utils["c" /* getColorObjectByColorValue */])(allSolids, value); - const attributeName = name + 'Color'; - const newStyle = { ...localAttributes.current.style, - color: { ...((_localAttributes$curr = localAttributes.current) === null || _localAttributes$curr === void 0 ? void 0 : (_localAttributes$curr2 = _localAttributes$curr.style) === null || _localAttributes$curr2 === void 0 ? void 0 : _localAttributes$curr2.color), - [name]: colorObject !== null && colorObject !== void 0 && colorObject.slug ? undefined : value - } - }; - const newNamedColor = colorObject !== null && colorObject !== void 0 && colorObject.slug ? colorObject.slug : undefined; - const newAttributes = { - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle), - [attributeName]: newNamedColor - }; - props.setAttributes(newAttributes); - localAttributes.current = { ...localAttributes.current, - ...newAttributes - }; - }; - - const onChangeGradient = value => { - const slug = Object(use_gradient["d" /* getGradientSlugByValue */])(allGradients, value); - let newAttributes; - - if (slug) { - var _localAttributes$curr3, _localAttributes$curr4, _localAttributes$curr5; - - const newStyle = { ...((_localAttributes$curr3 = localAttributes.current) === null || _localAttributes$curr3 === void 0 ? void 0 : _localAttributes$curr3.style), - color: { ...((_localAttributes$curr4 = localAttributes.current) === null || _localAttributes$curr4 === void 0 ? void 0 : (_localAttributes$curr5 = _localAttributes$curr4.style) === null || _localAttributes$curr5 === void 0 ? void 0 : _localAttributes$curr5.color), - gradient: undefined - } - }; - newAttributes = { - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle), - gradient: slug - }; - } else { - var _localAttributes$curr6, _localAttributes$curr7, _localAttributes$curr8; - - const newStyle = { ...((_localAttributes$curr6 = localAttributes.current) === null || _localAttributes$curr6 === void 0 ? void 0 : _localAttributes$curr6.style), - color: { ...((_localAttributes$curr7 = localAttributes.current) === null || _localAttributes$curr7 === void 0 ? void 0 : (_localAttributes$curr8 = _localAttributes$curr7.style) === null || _localAttributes$curr8 === void 0 ? void 0 : _localAttributes$curr8.color), - gradient: value - } - }; - newAttributes = { - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle), - gradient: undefined - }; - } - - props.setAttributes(newAttributes); - localAttributes.current = { ...localAttributes.current, - ...newAttributes - }; - }; - - const onChangeLinkColor = value => { - const colorObject = Object(utils["c" /* getColorObjectByColorValue */])(allSolids, value); - const newLinkColorValue = colorObject !== null && colorObject !== void 0 && colorObject.slug ? `var:preset|color|${colorObject.slug}` : value; - const newStyle = Object(hooks_utils["a" /* cleanEmptyObject */])(immutableSet(style, ['elements', 'link', 'color', 'text'], newLinkColorValue)); - props.setAttributes({ - style: newStyle - }); - }; - - return Object(external_wp_element_["createElement"])(ColorPanel, { - enableContrastChecking: // Turn on contrast checker for web only since it's not supported on mobile yet. - external_wp_element_["Platform"].OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient), - clientId: props.clientId, - settings: [...(hasTextColor ? [{ - label: Object(external_wp_i18n_["__"])('Text'), - onColorChange: onChangeColor('text'), - colorValue: Object(utils["b" /* getColorObjectByAttributeValues */])(allSolids, textColor, style === null || style === void 0 ? void 0 : (_style$color7 = style.color) === null || _style$color7 === void 0 ? void 0 : _style$color7.text).color - }] : []), ...(hasBackgroundColor || hasGradientColor ? [{ - label: Object(external_wp_i18n_["__"])('Background'), - onColorChange: hasBackgroundColor ? onChangeColor('background') : undefined, - colorValue: Object(utils["b" /* getColorObjectByAttributeValues */])(allSolids, backgroundColor, style === null || style === void 0 ? void 0 : (_style$color8 = style.color) === null || _style$color8 === void 0 ? void 0 : _style$color8.background).color, - gradientValue, - onGradientChange: hasGradientColor ? onChangeGradient : undefined - }] : []), ...(hasLinkColor ? [{ - label: Object(external_wp_i18n_["__"])('Link'), - onColorChange: onChangeLinkColor, - colorValue: getLinkColorFromAttributeValue(allSolids, style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : (_style$elements2$link2 = _style$elements2$link.color) === null || _style$elements2$link2 === void 0 ? void 0 : _style$elements2$link2.text), - clearable: !!(style !== null && style !== void 0 && (_style$elements3 = style.elements) !== null && _style$elements3 !== void 0 && (_style$elements3$link = _style$elements3.link) !== null && _style$elements3$link !== void 0 && (_style$elements3$link2 = _style$elements3$link.color) !== null && _style$elements3$link2 !== void 0 && _style$elements3$link2.text) - }] : [])] - }); -} -/** - * This adds inline styles for color palette colors. - * Ideally, this is not needed and themes should load their palettes on the editor. - * - * @param {Function} BlockListBlock Original component. - * - * @return {Function} Wrapped component. - */ - -const withColorPaletteStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => { - var _props$wrapperProps; - - const { - name, - attributes - } = props; - const { - backgroundColor, - textColor - } = attributes; - const userPalette = Object(use_setting["a" /* default */])('color.palette.custom') || []; - const themePalette = Object(use_setting["a" /* default */])('color.palette.theme') || []; - const defaultPalette = Object(use_setting["a" /* default */])('color.palette.default') || []; - const colors = Object(external_wp_element_["useMemo"])(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); - - if (!hasColorSupport(name) || color_shouldSkipSerialization(name)) { - return Object(external_wp_element_["createElement"])(BlockListBlock, props); - } - - const extraStyles = {}; - - if (textColor) { - var _getColorObjectByAttr; - - extraStyles.color = (_getColorObjectByAttr = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, textColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color; - } - - if (backgroundColor) { - var _getColorObjectByAttr2; - - extraStyles.backgroundColor = (_getColorObjectByAttr2 = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, backgroundColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color; - } - - let wrapperProps = props.wrapperProps; - wrapperProps = { ...props.wrapperProps, - style: { ...extraStyles, - ...((_props$wrapperProps = props.wrapperProps) === null || _props$wrapperProps === void 0 ? void 0 : _props$wrapperProps.style) - } - }; - return Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, { - wrapperProps: wrapperProps - })); -}); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/color/addAttribute', color_addAttributes); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/color/addSaveProps', color_addSaveProps); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/color/addEditProps', color_addEditProps); -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/color/with-color-palette-styles', withColorPaletteStyles); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-appearance-control/index.js -var font_appearance_control = __webpack_require__("Bo0k"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js + 1 modules -var line_height_control = __webpack_require__("weEX"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/line-height.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight'; -/** - * Inspector control panel containing the line height related configuration - * - * @param {Object} props - * - * @return {WPElement} Line height edit element. - */ - -function LineHeightEdit(props) { - var _style$typography; - - const { - attributes: { - style - }, - setAttributes - } = props; - - const onChange = newLineHeightValue => { - const newStyle = { ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - lineHeight: newLineHeightValue - } - }; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle) - }); - }; - - return Object(external_wp_element_["createElement"])(line_height_control["a" /* default */], { - value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.lineHeight, - onChange: onChange - }); -} -/** - * Custom hook that checks if line-height settings have been disabled. - * - * @param {string} name The name of the block. - * @return {boolean} Whether setting is disabled. - */ - -function useIsLineHeightDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const isDisabled = !Object(use_setting["a" /* default */])('typography.lineHeight'); - return !Object(external_wp_blocks_["hasBlockSupport"])(blockName, LINE_HEIGHT_SUPPORT_KEY) || isDisabled; -} -/** - * Checks if there is a current value set for the line height block support. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a line height value set. - */ - -function hasLineHeightValue(props) { - var _props$attributes$sty, _props$attributes$sty2; - - return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.lineHeight); -} -/** - * Resets the line height block support attribute. This can be used when - * disabling the line height support controls for a block via a progressive - * discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetLineHeight(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - lineHeight: undefined - } - }) - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-appearance.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -/** - * Key within block settings' support array indicating support for font style. - */ - -const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle'; -/** - * Key within block settings' support array indicating support for font weight. - */ - -const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight'; -/** - * Inspector control panel containing the font appearance options. - * - * @param {Object} props Block properties. - * - * @return {WPElement} Font appearance edit element. - */ - -function FontAppearanceEdit(props) { - var _style$typography, _style$typography2; - - const { - attributes: { - style - }, - setAttributes - } = props; - const hasFontStyles = !useIsFontStyleDisabled(props); - const hasFontWeights = !useIsFontWeightDisabled(props); - - const onChange = newStyles => { - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - fontStyle: newStyles.fontStyle, - fontWeight: newStyles.fontWeight - } - }) - }); - }; - - const fontStyle = style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontStyle; - const fontWeight = style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontWeight; - return Object(external_wp_element_["createElement"])(font_appearance_control["a" /* default */], { - onChange: onChange, - hasFontStyles: hasFontStyles, - hasFontWeights: hasFontWeights, - value: { - fontStyle, - fontWeight - } - }); -} -/** - * Checks if font style support has been disabled either by not opting in for - * support or by failing to provide preset styles. - * - * @param {Object} props Block properties. - * @param {string} props.name Name for the block type. - * - * @return {boolean} Whether font style support has been disabled. - */ - -function useIsFontStyleDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const styleSupport = Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_STYLE_SUPPORT_KEY); - const hasFontStyles = Object(use_setting["a" /* default */])('typography.fontStyle'); - return !styleSupport || !hasFontStyles; -} -/** - * Checks if font weight support has been disabled either by not opting in for - * support or by failing to provide preset weights. - * - * @param {Object} props Block properties. - * @param {string} props.name Name for the block type. - * - * @return {boolean} Whether font weight support has been disabled. - */ - -function useIsFontWeightDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const weightSupport = Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_WEIGHT_SUPPORT_KEY); - const hasFontWeights = Object(use_setting["a" /* default */])('typography.fontWeight'); - return !weightSupport || !hasFontWeights; -} -/** - * Checks if font appearance support has been disabled. - * - * @param {Object} props Block properties. - * - * @return {boolean} Whether font appearance support has been disabled. - */ - -function useIsFontAppearanceDisabled(props) { - const stylesDisabled = useIsFontStyleDisabled(props); - const weightsDisabled = useIsFontWeightDisabled(props); - return stylesDisabled && weightsDisabled; -} -/** - * Checks if there is either a font style or weight value set within the - * typography styles. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a font style or weight. - */ - -function hasFontAppearanceValue(props) { - var _props$attributes$sty; - - const { - fontStyle, - fontWeight - } = ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.typography) || {}; - return !!fontStyle || !!fontWeight; -} -/** - * Resets the font style and weight block support attributes. This can be used - * when disabling the font appearance support controls for a block via a - * progressive discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetFontAppearance(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - fontStyle: undefined, - fontWeight: undefined - } - }) - }); -} - -// EXTERNAL MODULE: external ["wp","tokenList"] -var external_wp_tokenList_ = __webpack_require__("BLeD"); -var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-family/index.js -var font_family = __webpack_require__("GKUk"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-family.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - -const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily'; -/** - * Filters registered block settings, extending attributes to include - * the `fontFamily` attribute. - * - * @param {Object} settings Original block settings - * @return {Object} Filtered block settings - */ - -function font_family_addAttributes(settings) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_FAMILY_SUPPORT_KEY)) { - return settings; - } // Allow blocks to specify a default value if needed. - - - if (!settings.attributes.fontFamily) { - Object.assign(settings.attributes, { - fontFamily: { - type: 'string' - } - }); - } - - return settings; -} -/** - * Override props assigned to save component to inject font family. - * - * @param {Object} props Additional props applied to save element - * @param {Object} blockType Block type - * @param {Object} attributes Block attributes - * @return {Object} Filtered props applied to save element - */ - - -function font_family_addSaveProps(props, blockType, attributes) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, FONT_FAMILY_SUPPORT_KEY)) { - return props; - } - - if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'typography.__experimentalSkipSerialization')) { - return props; - } - - if (!(attributes !== null && attributes !== void 0 && attributes.fontFamily)) { - return props; - } // Use TokenList to dedupe classes. - - - const classes = new external_wp_tokenList_default.a(props.className); - classes.add(`has-${Object(external_lodash_["kebabCase"])(attributes === null || attributes === void 0 ? void 0 : attributes.fontFamily)}-font-family`); - const newClassName = classes.value; - props.className = newClassName ? newClassName : undefined; - return props; -} -/** - * Filters registered block settings to expand the block edit wrapper - * by applying the desired styles and classnames. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - - -function font_family_addEditProps(settings) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_FAMILY_SUPPORT_KEY)) { - return settings; - } - - const existingGetEditWrapperProps = settings.getEditWrapperProps; - - settings.getEditWrapperProps = attributes => { - let props = {}; - - if (existingGetEditWrapperProps) { - props = existingGetEditWrapperProps(attributes); - } - - return font_family_addSaveProps(props, settings, attributes); - }; - - return settings; -} - -function FontFamilyEdit(_ref) { - var _find; - - let { - setAttributes, - attributes: { - fontFamily - } - } = _ref; - const fontFamilies = Object(use_setting["a" /* default */])('typography.fontFamilies'); - const value = (_find = Object(external_lodash_["find"])(fontFamilies, _ref2 => { - let { - slug - } = _ref2; - return fontFamily === slug; - })) === null || _find === void 0 ? void 0 : _find.fontFamily; - - function onChange(newValue) { - const predefinedFontFamily = Object(external_lodash_["find"])(fontFamilies, _ref3 => { - let { - fontFamily: f - } = _ref3; - return f === newValue; - }); - setAttributes({ - fontFamily: predefinedFontFamily === null || predefinedFontFamily === void 0 ? void 0 : predefinedFontFamily.slug - }); - } - - return Object(external_wp_element_["createElement"])(font_family["a" /* default */], { - className: "block-editor-hooks-font-family-control", - fontFamilies: fontFamilies, - value: value, - onChange: onChange - }); -} -/** - * Custom hook that checks if font-family functionality is disabled. - * - * @param {string} name The name of the block. - * @return {boolean} Whether setting is disabled. - */ - -function useIsFontFamilyDisabled(_ref4) { - let { - name - } = _ref4; - const fontFamilies = Object(use_setting["a" /* default */])('typography.fontFamilies'); - return !fontFamilies || fontFamilies.length === 0 || !Object(external_wp_blocks_["hasBlockSupport"])(name, FONT_FAMILY_SUPPORT_KEY); -} -/** - * Checks if there is a current value set for the font family block support. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a font family value set. - */ - -function hasFontFamilyValue(props) { - return !!props.attributes.fontFamily; -} -/** - * Resets the font family block support attribute. This can be used when - * disabling the font family support controls for a block via a progressive - * discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetFontFamily(_ref5) { - let { - setAttributes - } = _ref5; - setAttributes({ - fontFamily: undefined - }); -} -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/fontFamily/addAttribute', font_family_addAttributes); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/fontFamily/addSaveProps', font_family_addSaveProps); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/fontFamily/addEditProps', font_family_addEditProps); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/utils.js -var font_sizes_utils = __webpack_require__("NMUH"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js -var font_size_picker = __webpack_require__("QP/w"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize'; -/** - * Filters registered block settings, extending attributes to include - * `fontSize` and `fontWeight` attributes. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - -function font_size_addAttributes(settings) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_SIZE_SUPPORT_KEY)) { - return settings; - } // Allow blocks to specify a default value if needed. - - - if (!settings.attributes.fontSize) { - Object.assign(settings.attributes, { - fontSize: { - type: 'string' - } - }); - } - - return settings; -} -/** - * Override props assigned to save component to inject font size. - * - * @param {Object} props Additional props applied to save element. - * @param {Object} blockType Block type. - * @param {Object} attributes Block attributes. - * - * @return {Object} Filtered props applied to save element. - */ - - -function font_size_addSaveProps(props, blockType, attributes) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, FONT_SIZE_SUPPORT_KEY)) { - return props; - } - - if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'typography.__experimentalSkipSerialization')) { - return props; - } // Use TokenList to dedupe classes. - - - const classes = new external_wp_tokenList_default.a(props.className); - classes.add(Object(font_sizes_utils["b" /* getFontSizeClass */])(attributes.fontSize)); - const newClassName = classes.value; - props.className = newClassName ? newClassName : undefined; - return props; -} -/** - * Filters registered block settings to expand the block edit wrapper - * by applying the desired styles and classnames. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - - -function font_size_addEditProps(settings) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_SIZE_SUPPORT_KEY)) { - return settings; - } - - const existingGetEditWrapperProps = settings.getEditWrapperProps; - - settings.getEditWrapperProps = attributes => { - let props = {}; - - if (existingGetEditWrapperProps) { - props = existingGetEditWrapperProps(attributes); - } - - return font_size_addSaveProps(props, settings, attributes); - }; - - return settings; -} -/** - * Inspector control panel containing the font size related configuration - * - * @param {Object} props - * - * @return {WPElement} Font size edit element. - */ - - -function FontSizeEdit(props) { - var _style$typography, _style$typography2; - - const { - attributes: { - fontSize, - style - }, - setAttributes - } = props; - const fontSizes = Object(use_setting["a" /* default */])('typography.fontSizes'); - - const onChange = value => { - const fontSizeSlug = Object(font_sizes_utils["c" /* getFontSizeObjectByValue */])(fontSizes, value).slug; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - fontSize: fontSizeSlug ? undefined : value - } - }), - fontSize: fontSizeSlug - }); - }; - - const fontSizeObject = Object(font_sizes_utils["a" /* getFontSize */])(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize); - const fontSizeValue = (fontSizeObject === null || fontSizeObject === void 0 ? void 0 : fontSizeObject.size) || (style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontSize) || fontSize; - return Object(external_wp_element_["createElement"])(font_size_picker["a" /* default */], { - onChange: onChange, - value: fontSizeValue, - withReset: false - }); -} -/** - * Checks if there is a current value set for the font size block support. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a font size value set. - */ - -function hasFontSizeValue(props) { - var _style$typography3; - - const { - fontSize, - style - } = props.attributes; - return !!fontSize || !!(style !== null && style !== void 0 && (_style$typography3 = style.typography) !== null && _style$typography3 !== void 0 && _style$typography3.fontSize); -} -/** - * Resets the font size block support attribute. This can be used when - * disabling the font size support controls for a block via a progressive - * discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetFontSize(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - fontSize: undefined, - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - fontSize: undefined - } - }) - }); -} -/** - * Custom hook that checks if font-size settings have been disabled. - * - * @param {string} name The name of the block. - * @return {boolean} Whether setting is disabled. - */ - -function useIsFontSizeDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const fontSizes = Object(use_setting["a" /* default */])('typography.fontSizes'); - const hasFontSizes = !!(fontSizes !== null && fontSizes !== void 0 && fontSizes.length); - return !Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_SIZE_SUPPORT_KEY) || !hasFontSizes; -} -/** - * Add inline styles for font sizes. - * Ideally, this is not needed and themes load the font-size classes on the - * editor. - * - * @param {Function} BlockListBlock Original component. - * - * @return {Function} Wrapped component. - */ - -const withFontSizeInlineStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => { - var _style$typography4, _style$typography5; - - const fontSizes = Object(use_setting["a" /* default */])('typography.fontSizes'); - const { - name: blockName, - attributes: { - fontSize, - style - }, - wrapperProps - } = props; // Only add inline styles if the block supports font sizes, - // doesn't skip serialization of font sizes, - // doesn't already have an inline font size, - // and does have a class to extract the font size from. - - if (!Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_SIZE_SUPPORT_KEY) || Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'typography.__experimentalSkipSerialization') || !fontSize || style !== null && style !== void 0 && (_style$typography4 = style.typography) !== null && _style$typography4 !== void 0 && _style$typography4.fontSize) { - return Object(external_wp_element_["createElement"])(BlockListBlock, props); - } - - const fontSizeValue = Object(font_sizes_utils["a" /* getFontSize */])(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography5 = style.typography) === null || _style$typography5 === void 0 ? void 0 : _style$typography5.fontSize).size; - const newProps = { ...props, - wrapperProps: { ...wrapperProps, - style: { - fontSize: fontSizeValue, - ...(wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style) - } - } - }; - return Object(external_wp_element_["createElement"])(BlockListBlock, newProps); -}, 'withFontSizeInlineStyles'); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps); -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js + 1 modules -var text_decoration_control = __webpack_require__("kVRd"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/text-decoration.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -/** - * Key within block settings' supports array indicating support for text - * decorations e.g. settings found in `block.json`. - */ - -const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration'; -/** - * Inspector control panel containing the text decoration options. - * - * @param {Object} props Block properties. - * - * @return {WPElement} Text decoration edit element. - */ - -function TextDecorationEdit(props) { - var _style$typography; - - const { - attributes: { - style - }, - setAttributes - } = props; - - function onChange(newDecoration) { - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - textDecoration: newDecoration - } - }) - }); - } - - return Object(external_wp_element_["createElement"])(text_decoration_control["a" /* default */], { - value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.textDecoration, - onChange: onChange - }); -} -/** - * Checks if text-decoration settings have been disabled. - * - * @param {string} name Name of the block. - * - * @return {boolean} Whether or not the setting is disabled. - */ - -function useIsTextDecorationDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const notSupported = !Object(external_wp_blocks_["hasBlockSupport"])(blockName, TEXT_DECORATION_SUPPORT_KEY); - const hasTextDecoration = Object(use_setting["a" /* default */])('typography.textDecoration'); - return notSupported || !hasTextDecoration; -} -/** - * Checks if there is a current value set for the text decoration block support. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a text decoration set. - */ - -function hasTextDecorationValue(props) { - var _props$attributes$sty, _props$attributes$sty2; - - return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.textDecoration); -} -/** - * Resets the text decoration block support attribute. This can be used when - * disabling the text decoration support controls for a block via a progressive - * discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetTextDecoration(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - textDecoration: undefined - } - }) - }); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js + 3 modules -var text_transform_control = __webpack_require__("/Hvg"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/text-transform.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -/** - * Key within block settings' supports array indicating support for text - * transforms e.g. settings found in `block.json`. - */ - -const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform'; -/** - * Inspector control panel containing the text transform options. - * - * @param {Object} props Block properties. - * - * @return {WPElement} Text transform edit element. - */ - -function TextTransformEdit(props) { - var _style$typography; - - const { - attributes: { - style - }, - setAttributes - } = props; - - function onChange(newTransform) { - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - textTransform: newTransform - } - }) - }); - } - - return Object(external_wp_element_["createElement"])(text_transform_control["a" /* default */], { - value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.textTransform, - onChange: onChange - }); -} -/** - * Checks if text-transform settings have been disabled. - * - * @param {string} name Name of the block. - * - * @return {boolean} Whether or not the setting is disabled. - */ - -function useIsTextTransformDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const notSupported = !Object(external_wp_blocks_["hasBlockSupport"])(blockName, TEXT_TRANSFORM_SUPPORT_KEY); - const hasTextTransforms = Object(use_setting["a" /* default */])('typography.textTransform'); - return notSupported || !hasTextTransforms; -} -/** - * Checks if there is a current value set for the text transform block support. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a text transform set. - */ - -function hasTextTransformValue(props) { - var _props$attributes$sty, _props$attributes$sty2; - - return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.textTransform); -} -/** - * Resets the text transform block support attribute. This can be used when - * disabling the text transform support controls for a block via a progressive - * discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetTextTransform(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - textTransform: undefined - } - }) - }); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/letter-spacing-control/index.js -var letter_spacing_control = __webpack_require__("xBDm"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/letter-spacing.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - - - -/** - * Key within block settings' supports array indicating support for letter-spacing - * e.g. settings found in `block.json`. - */ - -const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing'; -/** - * Inspector control panel containing the letter-spacing options. - * - * @param {Object} props Block properties. - * @return {WPElement} Letter-spacing edit element. - */ - -function LetterSpacingEdit(props) { - var _style$typography; - - const { - attributes: { - style - }, - setAttributes - } = props; - - function onChange(newSpacing) { - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - letterSpacing: newSpacing - } - }) - }); - } - - return Object(external_wp_element_["createElement"])(letter_spacing_control["a" /* default */], { - value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.letterSpacing, - onChange: onChange, - __unstableInputWidth: false - }); -} -/** - * Checks if letter-spacing settings have been disabled. - * - * @param {string} name Name of the block. - * @return {boolean} Whether or not the setting is disabled. - */ - -function useIsLetterSpacingDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const notSupported = !Object(external_wp_blocks_["hasBlockSupport"])(blockName, LETTER_SPACING_SUPPORT_KEY); - const hasLetterSpacing = Object(use_setting["a" /* default */])('typography.letterSpacing'); - return notSupported || !hasLetterSpacing; -} -/** - * Checks if there is a current value set for the letter spacing block support. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a letter spacing set. - */ - -function hasLetterSpacingValue(props) { - var _props$attributes$sty, _props$attributes$sty2; - - return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.letterSpacing); -} -/** - * Resets the letter spacing block support attribute. This can be used when - * disabling the letter spacing support controls for a block via a progressive - * discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetLetterSpacing(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - typography: { ...(style === null || style === void 0 ? void 0 : style.typography), - letterSpacing: undefined - } - }) - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - - - - - -const TYPOGRAPHY_SUPPORT_KEY = 'typography'; -const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY]; -function TypographyPanel(props) { - const { - clientId - } = props; - const isFontFamilyDisabled = useIsFontFamilyDisabled(props); - const isFontSizeDisabled = useIsFontSizeDisabled(props); - const isFontAppearanceDisabled = useIsFontAppearanceDisabled(props); - const isLineHeightDisabled = useIsLineHeightDisabled(props); - const isTextDecorationDisabled = useIsTextDecorationDisabled(props); - const isTextTransformDisabled = useIsTextTransformDisabled(props); - const isLetterSpacingDisabled = useIsLetterSpacingDisabled(props); - const hasFontStyles = !useIsFontStyleDisabled(props); - const hasFontWeights = !useIsFontWeightDisabled(props); - const isDisabled = useIsTypographyDisabled(props); - const isSupported = hasTypographySupport(props.name); - if (isDisabled || !isSupported) return null; - const defaultControls = Object(external_wp_blocks_["getBlockSupport"])(props.name, [TYPOGRAPHY_SUPPORT_KEY, '__experimentalDefaultControls']); - - const createResetAllFilter = attribute => newAttributes => { - var _newAttributes$style; - - return { ...newAttributes, - style: { ...newAttributes.style, - typography: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.typography), - [attribute]: undefined + function expandSelection(isReverse) { + const selectedBlockClientId = getSelectedBlockClientId(); + const selectionStartClientId = getMultiSelectedBlocksStartClientId(); + const selectionEndClientId = getMultiSelectedBlocksEndClientId(); + const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId); + const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId); + const nextSelectionEndClientId = isReverse ? selectionBeforeEndClientId : selectionAfterEndClientId; + + if (nextSelectionEndClientId) { + if (selectionStartClientId === nextSelectionEndClientId) { + selectBlock(nextSelectionEndClientId); + } else { + multiSelect(selectionStartClientId || selectedBlockClientId, nextSelectionEndClientId); } } - }; - }; + } - return Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], { - __experimentalGroup: "typography" - }, !isFontFamilyDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - hasValue: () => hasFontFamilyValue(props), - label: Object(external_wp_i18n_["__"])('Font family'), - onDeselect: () => resetFontFamily(props), - isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontFamily, - resetAllFilter: newAttributes => ({ ...newAttributes, - fontFamily: undefined - }), - panelId: clientId - }, Object(external_wp_element_["createElement"])(FontFamilyEdit, props)), !isFontSizeDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - hasValue: () => hasFontSizeValue(props), - label: Object(external_wp_i18n_["__"])('Font size'), - onDeselect: () => resetFontSize(props), - isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontSize, - resetAllFilter: newAttributes => { - var _newAttributes$style2; + function moveSelection(isReverse) { + const selectedFirstClientId = getFirstMultiSelectedBlockClientId(); + const selectedLastClientId = getLastMultiSelectedBlockClientId(); + const focusedBlockClientId = isReverse ? selectedFirstClientId : selectedLastClientId; - return { ...newAttributes, - fontSize: undefined, - style: { ...newAttributes.style, - typography: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.typography), - fontSize: undefined - } + if (focusedBlockClientId) { + selectBlock(focusedBlockClientId); + } + } + /** + * Returns true if the given target field is the last in its block which + * can be considered for tab transition. For example, in a block with + * two text fields, this would return true when reversing from the first + * of the two fields, but false when reversing from the second. + * + * @param {Element} target Currently focused text field. + * @param {boolean} isReverse True if considering as the first field. + * + * @return {boolean} Whether field is at edge for tab transition. + */ + + + function isTabbableEdge(target, isReverse) { + const closestTabbable = getClosestTabbable(target, isReverse, node); + return !closestTabbable || !isInSameBlock(target, closestTabbable); + } + + function onKeyDown(event) { + const { + keyCode, + target + } = event; + const isUp = keyCode === external_wp_keycodes_namespaceObject.UP; + const isDown = keyCode === external_wp_keycodes_namespaceObject.DOWN; + const isLeft = keyCode === external_wp_keycodes_namespaceObject.LEFT; + const isRight = keyCode === external_wp_keycodes_namespaceObject.RIGHT; + const isReverse = isUp || isLeft; + const isHorizontal = isLeft || isRight; + const isVertical = isUp || isDown; + const isNav = isHorizontal || isVertical; + const isShift = event.shiftKey; + const hasModifier = isShift || event.ctrlKey || event.altKey || event.metaKey; + const isNavEdge = isVertical ? external_wp_dom_namespaceObject.isVerticalEdge : external_wp_dom_namespaceObject.isHorizontalEdge; + const { + ownerDocument + } = node; + const { + defaultView + } = ownerDocument; + + if (hasMultiSelection()) { + if (isNav) { + const action = isShift ? expandSelection : moveSelection; + action(isReverse); + event.preventDefault(); } - }; - }, - panelId: clientId - }, Object(external_wp_element_["createElement"])(FontSizeEdit, props)), !isFontAppearanceDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - className: "single-column", - hasValue: () => hasFontAppearanceValue(props), - label: Object(font_appearance_control["b" /* getFontAppearanceLabel */])(hasFontStyles, hasFontWeights), - onDeselect: () => resetFontAppearance(props), - isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontAppearance, - resetAllFilter: newAttributes => { - var _newAttributes$style3; - return { ...newAttributes, - style: { ...newAttributes.style, - typography: { ...((_newAttributes$style3 = newAttributes.style) === null || _newAttributes$style3 === void 0 ? void 0 : _newAttributes$style3.typography), - fontStyle: undefined, - fontWeight: undefined - } + return; + } // When presing any key other than up or down, the initial vertical + // position must ALWAYS be reset. The vertical position is saved so + // it can be restored as well as possible on sebsequent vertical + // arrow key presses. It may not always be possible to restore the + // exact same position (such as at an empty line), so it wouldn't be + // good to compute the position right before any vertical arrow key + // press. + + + if (!isVertical) { + verticalRect = null; + } else if (!verticalRect) { + verticalRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView); + } // Abort if navigation has already been handled (e.g. RichText + // inline boundaries). + + + if (event.defaultPrevented) { + return; + } + + if (!isNav) { + return; + } // Abort if our current target is not a candidate for navigation + // (e.g. preserve native input behaviors). + + + if (!isNavigationCandidate(target, keyCode, hasModifier)) { + return; + } // In the case of RTL scripts, right means previous and left means + // next, which is the exact reverse of LTR. + + + const isReverseDir = (0,external_wp_dom_namespaceObject.isRTL)(target) ? !isReverse : isReverse; + const { + keepCaretInsideBlock + } = getSettings(); + const selectedBlockClientId = getSelectedBlockClientId(); + + if (isShift) { + const selectionEndClientId = getMultiSelectedBlocksEndClientId(); + const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId); + const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId); + + if ( // Ensure that there is a target block. + (isReverse && selectionBeforeEndClientId || !isReverse && selectionAfterEndClientId) && isTabbableEdge(target, isReverse) && isNavEdge(target, isReverse)) { + // Shift key is down, and there is multi selection or we're + // at the end of the current block. + expandSelection(isReverse); + event.preventDefault(); } - }; - }, - panelId: clientId - }, Object(external_wp_element_["createElement"])(FontAppearanceEdit, props)), !isLineHeightDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - className: "single-column", - hasValue: () => hasLineHeightValue(props), - label: Object(external_wp_i18n_["__"])('Line height'), - onDeselect: () => resetLineHeight(props), - isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.lineHeight, - resetAllFilter: createResetAllFilter('lineHeight'), - panelId: clientId - }, Object(external_wp_element_["createElement"])(LineHeightEdit, props)), !isTextDecorationDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - className: "single-column", - hasValue: () => hasTextDecorationValue(props), - label: Object(external_wp_i18n_["__"])('Decoration'), - onDeselect: () => resetTextDecoration(props), - isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textDecoration, - resetAllFilter: createResetAllFilter('textDecoration'), - panelId: clientId - }, Object(external_wp_element_["createElement"])(TextDecorationEdit, props)), !isTextTransformDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - className: "single-column", - hasValue: () => hasTextTransformValue(props), - label: Object(external_wp_i18n_["__"])('Letter case'), - onDeselect: () => resetTextTransform(props), - isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textTransform, - resetAllFilter: createResetAllFilter('textTransform'), - panelId: clientId - }, Object(external_wp_element_["createElement"])(TextTransformEdit, props)), !isLetterSpacingDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - className: "single-column", - hasValue: () => hasLetterSpacingValue(props), - label: Object(external_wp_i18n_["__"])('Letter-spacing'), - onDeselect: () => resetLetterSpacing(props), - isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.letterSpacing, - resetAllFilter: createResetAllFilter('letterSpacing'), - panelId: clientId - }, Object(external_wp_element_["createElement"])(LetterSpacingEdit, props))); -} -const hasTypographySupport = blockName => { - return TYPOGRAPHY_SUPPORT_KEYS.some(key => Object(external_wp_blocks_["hasBlockSupport"])(blockName, key)); -}; + } else if (isVertical && (0,external_wp_dom_namespaceObject.isVerticalEdge)(target, isReverse) && !keepCaretInsideBlock) { + const closestTabbable = getClosestTabbable(target, isReverse, node, true); -function useIsTypographyDisabled() { - let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const configs = [useIsFontAppearanceDisabled(props), useIsFontSizeDisabled(props), useIsLineHeightDisabled(props), useIsFontFamilyDisabled(props), useIsTextDecorationDisabled(props), useIsTextTransformDisabled(props), useIsLetterSpacingDisabled(props)]; - return configs.filter(Boolean).length === configs.length; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/gap.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - -/** - * Determines if there is gap support. - * - * @param {string|Object} blockType Block name or Block Type object. - * @return {boolean} Whether there is support. - */ - -function hasGapSupport(blockType) { - const support = Object(external_wp_blocks_["getBlockSupport"])(blockType, SPACING_SUPPORT_KEY); - return !!(true === support || support !== null && support !== void 0 && support.blockGap); -} -/** - * Checks if there is a current value in the gap block support attributes. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a gap value set. - */ - -function hasGapValue(props) { - var _props$attributes$sty, _props$attributes$sty2; - - return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.blockGap) !== undefined; -} -/** - * Resets the gap block support attribute. This can be used when disabling - * the gap support controls for a block via a progressive discovery panel. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetGap(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: { ...style, - spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), - blockGap: undefined - } - } - }); -} -/** - * Custom hook that checks if gap settings have been disabled. - * - * @param {string} name The name of the block. - * @return {boolean} Whether the gap setting is disabled. - */ - -function useIsGapDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const isDisabled = !Object(use_setting["a" /* default */])('spacing.blockGap'); - return !hasGapSupport(blockName) || isDisabled; -} -/** - * Inspector control panel containing the gap related configuration - * - * @param {Object} props - * - * @return {WPElement} Gap edit element. - */ - -function GapEdit(props) { - var _style$spacing; - - const { - clientId, - attributes: { - style - }, - setAttributes - } = props; - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(use_setting["a" /* default */])('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] - }); - const ref = Object(use_block_refs["b" /* __unstableUseBlockRef */])(clientId); - - if (useIsGapDisabled(props)) { - return null; - } - - const onChange = next => { - var _window; - - const newStyle = { ...style, - spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), - blockGap: next - } - }; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle) - }); // In Safari, changing the `gap` CSS value on its own will not trigger the layout - // to be recalculated / re-rendered. To force the updated gap to re-render, here - // we replace the block's node with itself. - - const isSafari = ((_window = window) === null || _window === void 0 ? void 0 : _window.navigator.userAgent) && window.navigator.userAgent.includes('Safari') && !window.navigator.userAgent.includes('Chrome ') && !window.navigator.userAgent.includes('Chromium '); - - if (ref.current && isSafari) { - var _ref$current$parentNo; - - (_ref$current$parentNo = ref.current.parentNode) === null || _ref$current$parentNo === void 0 ? void 0 : _ref$current$parentNo.replaceChild(ref.current, ref.current); - } - }; - - return external_wp_element_["Platform"].select({ - web: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], { - label: Object(external_wp_i18n_["__"])('Block spacing'), - __unstableInputWidth: "80px", - min: 0, - onChange: onChange, - units: units, - value: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap - })), - native: null - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/margin.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -/** - * Determines if there is margin support. - * - * @param {string|Object} blockType Block name or Block Type object. - * - * @return {boolean} Whether there is support. - */ - -function hasMarginSupport(blockType) { - const support = Object(external_wp_blocks_["getBlockSupport"])(blockType, SPACING_SUPPORT_KEY); - return !!(true === support || support !== null && support !== void 0 && support.margin); -} -/** - * Checks if there is a current value in the margin block support attributes. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a margin value set. - */ - -function hasMarginValue(props) { - var _props$attributes$sty, _props$attributes$sty2; - - return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.margin) !== undefined; -} -/** - * Resets the margin block support attributes. This can be used when disabling - * the margin support controls for a block via a `ToolsPanel`. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetMargin(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), - margin: undefined - } - }) - }); -} -/** - * Custom hook that checks if margin settings have been disabled. - * - * @param {string} name The name of the block. - * - * @return {boolean} Whether margin setting is disabled. - */ - -function useIsMarginDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const isDisabled = !Object(use_setting["a" /* default */])('spacing.margin'); - const isInvalid = !useIsDimensionsSupportValid(blockName, 'margin'); - return !hasMarginSupport(blockName) || isDisabled || isInvalid; -} -/** - * Inspector control panel containing the margin related configuration - * - * @param {Object} props Block props. - * - * @return {WPElement} Margin edit element. - */ - -function MarginEdit(props) { - var _style$spacing; - - const { - name: blockName, - attributes: { - style - }, - setAttributes - } = props; - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(use_setting["a" /* default */])('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] - }); - const sides = useCustomSides(blockName, 'margin'); - const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side)); - - if (useIsMarginDisabled(props)) { - return null; - } - - const onChange = next => { - const newStyle = { ...style, - spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), - margin: next - } - }; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle) - }); - }; - - const onChangeShowVisualizer = next => { - const newStyle = { ...style, - visualizers: { - margin: next - } - }; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle) - }); - }; - - return external_wp_element_["Platform"].select({ - web: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalBoxControl"], { - values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin, - onChange: onChange, - onChangeShowVisualizer: onChangeShowVisualizer, - label: Object(external_wp_i18n_["__"])('Margin'), - sides: sides, - units: units, - allowReset: false, - splitOnAxis: splitOnAxis - })), - native: null - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/padding.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -/** - * Determines if there is padding support. - * - * @param {string|Object} blockType Block name or Block Type object. - * - * @return {boolean} Whether there is support. - */ - -function hasPaddingSupport(blockType) { - const support = Object(external_wp_blocks_["getBlockSupport"])(blockType, SPACING_SUPPORT_KEY); - return !!(true === support || support !== null && support !== void 0 && support.padding); -} -/** - * Checks if there is a current value in the padding block support attributes. - * - * @param {Object} props Block props. - * @return {boolean} Whether or not the block has a padding value set. - */ - -function hasPaddingValue(props) { - var _props$attributes$sty, _props$attributes$sty2; - - return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.padding) !== undefined; -} -/** - * Resets the padding block support attributes. This can be used when disabling - * the padding support controls for a block via a `ToolsPanel`. - * - * @param {Object} props Block props. - * @param {Object} props.attributes Block's attributes. - * @param {Object} props.setAttributes Function to set block's attributes. - */ - -function resetPadding(_ref) { - let { - attributes = {}, - setAttributes - } = _ref; - const { - style - } = attributes; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style, - spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), - padding: undefined - } - }) - }); -} -/** - * Custom hook that checks if padding settings have been disabled. - * - * @param {string} name The name of the block. - * - * @return {boolean} Whether padding setting is disabled. - */ - -function useIsPaddingDisabled() { - let { - name: blockName - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const isDisabled = !Object(use_setting["a" /* default */])('spacing.padding'); - const isInvalid = !useIsDimensionsSupportValid(blockName, 'padding'); - return !hasPaddingSupport(blockName) || isDisabled || isInvalid; -} -/** - * Inspector control panel containing the padding related configuration - * - * @param {Object} props - * - * @return {WPElement} Padding edit element. - */ - -function PaddingEdit(props) { - var _style$spacing; - - const { - name: blockName, - attributes: { - style - }, - setAttributes - } = props; - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(use_setting["a" /* default */])('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] - }); - const sides = useCustomSides(blockName, 'padding'); - const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side)); - - if (useIsPaddingDisabled(props)) { - return null; - } - - const onChange = next => { - const newStyle = { ...style, - spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), - padding: next - } - }; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle) - }); - }; - - const onChangeShowVisualizer = next => { - const newStyle = { ...style, - visualizers: { - padding: next - } - }; - setAttributes({ - style: Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle) - }); - }; - - return external_wp_element_["Platform"].select({ - web: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalBoxControl"], { - values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding, - onChange: onChange, - onChangeShowVisualizer: onChangeShowVisualizer, - label: Object(external_wp_i18n_["__"])('Padding'), - sides: sides, - units: units, - allowReset: false, - splitOnAxis: splitOnAxis - })), - native: null - }); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/dimensions.js - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - -const SPACING_SUPPORT_KEY = 'spacing'; -const ALL_SIDES = ['top', 'right', 'bottom', 'left']; -const AXIAL_SIDES = ['vertical', 'horizontal']; -/** - * Inspector controls for dimensions support. - * - * @param {Object} props Block props. - * - * @return {WPElement} Inspector controls for spacing support features. - */ - -function DimensionsPanel(props) { - const isGapDisabled = useIsGapDisabled(props); - const isPaddingDisabled = useIsPaddingDisabled(props); - const isMarginDisabled = useIsMarginDisabled(props); - const isDisabled = useIsDimensionsDisabled(props); - const isSupported = hasDimensionsSupport(props.name); - - if (isDisabled || !isSupported) { - return null; - } - - const defaultSpacingControls = Object(external_wp_blocks_["getBlockSupport"])(props.name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']); - - const createResetAllFilter = attribute => newAttributes => { - var _newAttributes$style; - - return { ...newAttributes, - style: { ...newAttributes.style, - spacing: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.spacing), - [attribute]: undefined + if (closestTabbable) { + (0,external_wp_dom_namespaceObject.placeCaretAtVerticalEdge)(closestTabbable, isReverse, verticalRect); + event.preventDefault(); } + } else if (isHorizontal && defaultView.getSelection().isCollapsed && (0,external_wp_dom_namespaceObject.isHorizontalEdge)(target, isReverseDir) && !keepCaretInsideBlock) { + const closestTabbable = getClosestTabbable(target, isReverseDir, node); + (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(closestTabbable, isReverse); + event.preventDefault(); } + } + + node.addEventListener('mousedown', onMouseDown); + node.addEventListener('keydown', onKeyDown); + return () => { + node.removeEventListener('mousedown', onMouseDown); + node.removeEventListener('keydown', onKeyDown); }; - }; - - return Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], { - __experimentalGroup: "dimensions" - }, !isPaddingDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - hasValue: () => hasPaddingValue(props), - label: Object(external_wp_i18n_["__"])('Padding'), - onDeselect: () => resetPadding(props), - resetAllFilter: createResetAllFilter('padding'), - isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.padding, - panelId: props.clientId - }, Object(external_wp_element_["createElement"])(PaddingEdit, props)), !isMarginDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - hasValue: () => hasMarginValue(props), - label: Object(external_wp_i18n_["__"])('Margin'), - onDeselect: () => resetMargin(props), - resetAllFilter: createResetAllFilter('margin'), - isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.margin, - panelId: props.clientId - }, Object(external_wp_element_["createElement"])(MarginEdit, props)), !isGapDisabled && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { - hasValue: () => hasGapValue(props), - label: Object(external_wp_i18n_["__"])('Block spacing'), - onDeselect: () => resetGap(props), - resetAllFilter: createResetAllFilter('blockGap'), - isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap, - panelId: props.clientId - }, Object(external_wp_element_["createElement"])(GapEdit, props))); -} -/** - * Determine whether there is dimensions related block support. - * - * @param {string} blockName Block name. - * - * @return {boolean} Whether there is support. - */ - -function hasDimensionsSupport(blockName) { - if (external_wp_element_["Platform"].OS !== 'web') { - return false; - } - - return hasGapSupport(blockName) || hasPaddingSupport(blockName) || hasMarginSupport(blockName); -} -/** - * Determines whether dimensions support has been disabled. - * - * @param {Object} props Block properties. - * - * @return {boolean} If spacing support is completely disabled. - */ - -const useIsDimensionsDisabled = function () { - let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const gapDisabled = useIsGapDisabled(props); - const paddingDisabled = useIsPaddingDisabled(props); - const marginDisabled = useIsMarginDisabled(props); - return gapDisabled && paddingDisabled && marginDisabled; -}; -/** - * Custom hook to retrieve which padding/margin is supported - * e.g. top, right, bottom or left. - * - * Sides are opted into by default. It is only if a specific side is set to - * false that it is omitted. - * - * @param {string} blockName Block name. - * @param {string} feature The feature custom sides relate to e.g. padding or margins. - * - * @return {Object} Sides supporting custom margin. - */ - - -function useCustomSides(blockName, feature) { - const support = Object(external_wp_blocks_["getBlockSupport"])(blockName, SPACING_SUPPORT_KEY); // Skip when setting is boolean as theme isn't setting arbitrary sides. - - if (!support || typeof support[feature] === 'boolean') { - return; - } - - return support[feature]; -} -/** - * Custom hook to determine whether the sides configured in the - * block support are valid. A dimension property cannot declare - * support for a mix of axial and individual sides. - * - * @param {string} blockName Block name. - * @param {string} feature The feature custom sides relate to e.g. padding or margins. - * - * @return {boolean} If the feature has a valid configuration of sides. - */ - -function useIsDimensionsSupportValid(blockName, feature) { - const sides = useCustomSides(blockName, feature); - - if (sides && sides.some(side => ALL_SIDES.includes(side)) && sides.some(side => AXIAL_SIDES.includes(side))) { - // eslint-disable-next-line no-console - console.warn(`The ${feature} support for the "${blockName}" block can not be configured to support both axial and arbitrary sides.`); - return false; - } - - return true; -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-display-block-controls/index.js -var use_display_block_controls = __webpack_require__("HgtZ"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/style.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - - -const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY]; - -const hasStyleSupport = blockType => styleSupportKeys.some(key => Object(external_wp_blocks_["hasBlockSupport"])(blockType, key)); - -const VARIABLE_REFERENCE_PREFIX = 'var:'; -const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|'; -const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--'; - -function compileStyleValue(uncompiledValue) { - if (Object(external_lodash_["startsWith"])(uncompiledValue, VARIABLE_REFERENCE_PREFIX)) { - const variable = uncompiledValue.slice(VARIABLE_REFERENCE_PREFIX.length).split(VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).join(VARIABLE_PATH_SEPARATOR_TOKEN_STYLE); - return `var(--wp--${variable})`; - } - - return uncompiledValue; -} -/** - * Returns the inline styles to add depending on the style object - * - * @param {Object} styles Styles configuration. - * - * @return {Object} Flattened CSS variables declaration. - */ - - -function getInlineStyles() { - let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const ignoredStyles = ['spacing.blockGap']; - const output = {}; - Object.keys(external_wp_blocks_["__EXPERIMENTAL_STYLE_PROPERTY"]).forEach(propKey => { - const path = external_wp_blocks_["__EXPERIMENTAL_STYLE_PROPERTY"][propKey].value; - const subPaths = external_wp_blocks_["__EXPERIMENTAL_STYLE_PROPERTY"][propKey].properties; // Ignore styles on elements because they are handled on the server. - - if (Object(external_lodash_["has"])(styles, path) && 'elements' !== Object(external_lodash_["first"])(path)) { - // Checking if style value is a string allows for shorthand css - // option and backwards compatibility for border radius support. - const styleValue = Object(external_lodash_["get"])(styles, path); - - if (!!subPaths && !Object(external_lodash_["isString"])(styleValue)) { - Object.entries(subPaths).forEach(entry => { - const [name, subPath] = entry; - const value = Object(external_lodash_["get"])(styleValue, [subPath]); - - if (value) { - output[name] = compileStyleValue(value); - } - }); - } else if (!ignoredStyles.includes(path.join('.'))) { - output[propKey] = compileStyleValue(Object(external_lodash_["get"])(styles, path)); - } - } - }); - return output; -} - -function compileElementsStyles(selector) { - let elements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return Object(external_lodash_["map"])(elements, (styles, element) => { - const elementStyles = getInlineStyles(styles); - - if (!Object(external_lodash_["isEmpty"])(elementStyles)) { - return [`.${selector} ${external_wp_blocks_["__EXPERIMENTAL_ELEMENTS"][element]}{`, ...Object(external_lodash_["map"])(elementStyles, (value, property) => `\t${Object(external_lodash_["kebabCase"])(property)}: ${value};`), '}'].join('\n'); - } - - return ''; - }).join('\n'); -} -/** - * Filters registered block settings, extending attributes to include `style` attribute. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - - -function style_addAttribute(settings) { - if (!hasStyleSupport(settings)) { - return settings; - } // allow blocks to specify their own attribute definition with default values if needed. - - - if (!settings.attributes.style) { - Object.assign(settings.attributes, { - style: { - type: 'object' - } - }); - } - - return settings; -} -/** - * A dictionary of paths to flag skipping block support serialization as the key, - * with values providing the style paths to be omitted from serialization. - * - * @constant - * @type {Record} - */ - - -const skipSerializationPathsEdit = { - [`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['border'], - [`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [COLOR_SUPPORT_KEY], - [`${TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [TYPOGRAPHY_SUPPORT_KEY], - [`${SPACING_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['spacing'] -}; -/** - * A dictionary of paths to flag skipping block support serialization as the key, - * with values providing the style paths to be omitted from serialization. - * - * Extends the Edit skip paths to enable skipping additional paths in just - * the Save component. This allows a block support to be serialized within the - * editor, while using an alternate approach, such as server-side rendering, when - * the support is saved. - * - * @constant - * @type {Record} - */ - -const skipSerializationPathsSave = { ...skipSerializationPathsEdit, - [`${SPACING_SUPPORT_KEY}`]: ['spacing.blockGap'] -}; -/** - * Override props assigned to save component to inject the CSS variables definition. - * - * @param {Object} props Additional props applied to save element. - * @param {Object} blockType Block type. - * @param {Object} attributes Block attributes. - * @param {?Record} skipPaths An object of keys and paths to skip serialization. - * - * @return {Object} Filtered props applied to save element. - */ - -function style_addSaveProps(props, blockType, attributes) { - let skipPaths = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : skipSerializationPathsSave; - - if (!hasStyleSupport(blockType)) { - return props; - } - - let { - style - } = attributes; - Object(external_lodash_["forEach"])(skipPaths, (path, indicator) => { - if (Object(external_wp_blocks_["getBlockSupport"])(blockType, indicator)) { - style = Object(external_lodash_["omit"])(style, path); - } - }); - props.style = { ...getInlineStyles(style), - ...props.style - }; - return props; -} -/** - * Filters registered block settings to extend the block edit wrapper - * to apply the desired styles and classnames properly. - * - * @param {Object} settings Original block settings. - * - * @return {Object}.Filtered block settings. - */ - -function style_addEditProps(settings) { - if (!hasStyleSupport(settings)) { - return settings; - } - - const existingGetEditWrapperProps = settings.getEditWrapperProps; - - settings.getEditWrapperProps = attributes => { - let props = {}; - - if (existingGetEditWrapperProps) { - props = existingGetEditWrapperProps(attributes); - } - - return style_addSaveProps(props, settings, attributes, skipSerializationPathsEdit); - }; - - return settings; -} -/** - * Override the default edit UI to include new inspector controls for - * all the custom styles configs. - * - * @param {Function} BlockEdit Original component. - * - * @return {Function} Wrapped component. - */ - -const withBlockControls = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => props => { - const shouldDisplayControls = Object(use_display_block_controls["a" /* default */])(); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, shouldDisplayControls && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(ColorEdit, props), Object(external_wp_element_["createElement"])(TypographyPanel, props), Object(external_wp_element_["createElement"])(BorderPanel, props), Object(external_wp_element_["createElement"])(DimensionsPanel, props)), Object(external_wp_element_["createElement"])(BlockEdit, props)); -}, 'withToolbarControls'); -/** - * Override the default block element to include duotone styles. - * - * @param {Function} BlockListBlock Original component - * @return {Function} Wrapped component - */ - -const withElementsStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => { - var _props$attributes$sty, _props$attributes$sty2; - - const elements = (_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements; - const blockElementsContainerIdentifier = `wp-elements-${Object(external_wp_compose_["useInstanceId"])(BlockListBlock)}`; - const styles = compileElementsStyles(blockElementsContainerIdentifier, (_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements); - const element = Object(external_wp_element_["useContext"])(block_list["c" /* default */].__unstableElementContext); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, elements && element && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])("style", { - dangerouslySetInnerHTML: { - __html: styles - } - }), element), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, { - className: elements ? classnames_default()(props.className, blockElementsContainerIdentifier) : props.className - }))); -}); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/style/addAttribute', style_addAttribute); -Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/style/addSaveProps', style_addSaveProps); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/style/addEditProps', style_addEditProps); -Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/style/with-block-controls', withBlockControls); -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/editor/with-elements-styles', withElementsStyles); - -// EXTERNAL MODULE: ./node_modules/colord/index.mjs -var colord = __webpack_require__("fHnH"); - -// EXTERNAL MODULE: ./node_modules/colord/plugins/names.mjs -var names = __webpack_require__("abaT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/duotone-control/index.js -var duotone_control = __webpack_require__("1uGa"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/duotone.js - - - -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -const duotone_EMPTY_ARRAY = []; -Object(colord["b" /* extend */])([names["a" /* default */]]); -/** - * Convert a list of colors to an object of R, G, and B values. - * - * @param {string[]} colors Array of RBG color strings. - * - * @return {Object} R, G, and B values. - */ - -function getValuesFromColors() { - let colors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - const values = { - r: [], - g: [], - b: [], - a: [] - }; - colors.forEach(color => { - const rgbColor = Object(colord["a" /* colord */])(color).toRgb(); - values.r.push(rgbColor.r / 255); - values.g.push(rgbColor.g / 255); - values.b.push(rgbColor.b / 255); - values.a.push(rgbColor.a); - }); - return values; -} -/** - * Values for the SVG `feComponentTransfer`. - * - * @typedef Values {Object} - * @property {number[]} r Red values. - * @property {number[]} g Green values. - * @property {number[]} b Blue values. - * @property {number[]} a Alpha values. - */ - -/** - * SVG and stylesheet needed for rendering the duotone filter. - * - * @param {Object} props Duotone props. - * @param {string} props.selector Selector to apply the filter to. - * @param {string} props.id Unique id for this duotone filter. - * @param {Values} props.values R, G, B, and A values to filter with. - * - * @return {WPElement} Duotone element. - */ - -function DuotoneFilter(_ref) { - let { - selector, - id, - values - } = _ref; - const stylesheet = ` -${selector} { - filter: url( #${id} ); -} -`; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { - xmlnsXlink: "http://www.w3.org/1999/xlink", - viewBox: "0 0 0 0", - width: "0", - height: "0", - focusable: "false", - role: "none", - style: { - visibility: 'hidden', - position: 'absolute', - left: '-9999px', - overflow: 'hidden' - } - }, Object(external_wp_element_["createElement"])("defs", null, Object(external_wp_element_["createElement"])("filter", { - id: id - }, Object(external_wp_element_["createElement"])("feColorMatrix", { - // Use sRGB instead of linearRGB so transparency looks correct. - colorInterpolationFilters: "sRGB", - type: "matrix" // Use perceptual brightness to convert to grayscale. - , - values: " .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " - }), Object(external_wp_element_["createElement"])("feComponentTransfer", { - // Use sRGB instead of linearRGB to be consistent with how CSS gradients work. - colorInterpolationFilters: "sRGB" - }, Object(external_wp_element_["createElement"])("feFuncR", { - type: "table", - tableValues: values.r.join(' ') - }), Object(external_wp_element_["createElement"])("feFuncG", { - type: "table", - tableValues: values.g.join(' ') - }), Object(external_wp_element_["createElement"])("feFuncB", { - type: "table", - tableValues: values.b.join(' ') - }), Object(external_wp_element_["createElement"])("feFuncA", { - type: "table", - tableValues: values.a.join(' ') - })), Object(external_wp_element_["createElement"])("feComposite", { - // Re-mask the image with the original transparency since the feColorMatrix above loses that information. - in2: "SourceGraphic", - operator: "in" - })))), Object(external_wp_element_["createElement"])("style", { - dangerouslySetInnerHTML: { - __html: stylesheet - } - })); -} - -function DuotonePanel(_ref2) { - var _style$color; - - let { - attributes, - setAttributes - } = _ref2; - const style = attributes === null || attributes === void 0 ? void 0 : attributes.style; - const duotone = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone; - const duotonePalette = Object(use_setting["a" /* default */])('color.duotone') || duotone_EMPTY_ARRAY; - const colorPalette = Object(use_setting["a" /* default */])('color.palette') || duotone_EMPTY_ARRAY; - const disableCustomColors = !Object(use_setting["a" /* default */])('color.custom'); - const disableCustomDuotone = !Object(use_setting["a" /* default */])('color.customDuotone') || (colorPalette === null || colorPalette === void 0 ? void 0 : colorPalette.length) === 0 && disableCustomColors; - - if ((duotonePalette === null || duotonePalette === void 0 ? void 0 : duotonePalette.length) === 0 && disableCustomDuotone) { - return null; - } - - return Object(external_wp_element_["createElement"])(block_controls["b" /* default */], { - group: "block", - __experimentalShareWithChildBlocks: true - }, Object(external_wp_element_["createElement"])(duotone_control["a" /* default */], { - duotonePalette: duotonePalette, - colorPalette: colorPalette, - disableCustomDuotone: disableCustomDuotone, - disableCustomColors: disableCustomColors, - value: duotone, - onChange: newDuotone => { - const newStyle = { ...style, - color: { ...(style === null || style === void 0 ? void 0 : style.color), - duotone: newDuotone - } - }; - setAttributes({ - style: newStyle - }); - } - })); -} -/** - * Filters registered block settings, extending attributes to include - * the `duotone` attribute. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. - */ - - -function addDuotoneAttributes(settings) { - if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, 'color.__experimentalDuotone')) { - return settings; - } // Allow blocks to specify their own attribute definition with default - // values if needed. - - - if (!settings.attributes.style) { - Object.assign(settings.attributes, { - style: { - type: 'object' - } - }); - } - - return settings; -} -/** - * Override the default edit UI to include toolbar controls for duotone if the - * block supports duotone. - * - * @param {Function} BlockEdit Original component. - * - * @return {Function} Wrapped component. - */ - - -const withDuotoneControls = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => props => { - const hasDuotoneSupport = Object(external_wp_blocks_["hasBlockSupport"])(props.name, 'color.__experimentalDuotone'); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(BlockEdit, props), hasDuotoneSupport && Object(external_wp_element_["createElement"])(DuotonePanel, props)); -}, 'withDuotoneControls'); -/** - * Function that scopes a selector with another one. This works a bit like - * SCSS nesting except the `&` operator isn't supported. - * - * @example - * ```js - * const scope = '.a, .b .c'; - * const selector = '> .x, .y'; - * const merged = scopeSelector( scope, selector ); - * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y' - * ``` - * - * @param {string} scope Selector to scope to. - * @param {string} selector Original selector. - * - * @return {string} Scoped selector. - */ - -function scopeSelector(scope, selector) { - const scopes = scope.split(','); - const selectors = selector.split(','); - const selectorsScoped = []; - scopes.forEach(outer => { - selectors.forEach(inner => { - selectorsScoped.push(`${outer.trim()} ${inner.trim()}`); - }); - }); - return selectorsScoped.join(', '); -} -/** - * Override the default block element to include duotone styles. - * - * @param {Function} BlockListBlock Original component. - * - * @return {Function} Wrapped component. - */ - - -const withDuotoneStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => { - var _props$attributes, _props$attributes$sty, _props$attributes$sty2; - - const duotoneSupport = Object(external_wp_blocks_["getBlockSupport"])(props.name, 'color.__experimentalDuotone'); - const values = props === null || props === void 0 ? void 0 : (_props$attributes = props.attributes) === null || _props$attributes === void 0 ? void 0 : (_props$attributes$sty = _props$attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.color) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.duotone; - - if (!duotoneSupport || !values) { - return Object(external_wp_element_["createElement"])(BlockListBlock, props); - } - - const id = `wp-duotone-${Object(external_wp_compose_["useInstanceId"])(BlockListBlock)}`; // Extra .editor-styles-wrapper specificity is needed in the editor - // since we're not using inline styles to apply the filter. We need to - // override duotone applied by global styles and theme.json. - - const selectorsGroup = scopeSelector(`.editor-styles-wrapper .${id}`, duotoneSupport); - const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, id); - const element = Object(external_wp_element_["useContext"])(block_list["c" /* default */].__unstableElementContext); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, element && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(DuotoneFilter, { - selector: selectorsGroup, - id: id, - values: getValuesFromColors(values) - }), element), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, { - className: className - }))); -}, 'withDuotoneStyles'); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/editor/duotone/add-attributes', addDuotoneAttributes); -Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/editor/duotone/with-editor-controls', withDuotoneControls); -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/editor/duotone/with-styles', withDuotoneStyles); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js -var block_list_layout = __webpack_require__("w8sn"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/index.js + 5 modules -var layouts = __webpack_require__("PPMp"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/layout.js - - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - -const layoutBlockSupportKey = '__experimentalLayout'; - -function LayoutPanel(_ref) { - let { - setAttributes, - attributes, - name: blockName - } = _ref; - const { - layout - } = attributes; - const defaultThemeLayout = Object(use_setting["a" /* default */])('layout'); - const themeSupportsLayout = Object(external_wp_data_["useSelect"])(select => { - const { - getSettings - } = select(store["a" /* store */]); - return getSettings().supportsLayout; }, []); - const layoutBlockSupport = Object(external_wp_blocks_["getBlockSupport"])(blockName, layoutBlockSupportKey, {}); - const { - allowSwitching, - allowEditing = true, - allowInheriting = true, - default: defaultBlockLayout - } = layoutBlockSupport; - - if (!allowEditing) { - return null; - } - - const usedLayout = layout || defaultBlockLayout || {}; - const { - inherit = false, - type = 'default' - } = usedLayout; - /** - * `themeSupportsLayout` is only relevant to the `default/flow` - * layout and it should not be taken into account when other - * `layout` types are used. - */ - - if (type === 'default' && !themeSupportsLayout) { - return null; - } - - const layoutType = Object(layouts["a" /* getLayoutType */])(type); - - const onChangeType = newType => setAttributes({ - layout: { - type: newType - } - }); - - const onChangeLayout = newLayout => setAttributes({ - layout: newLayout - }); - - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(inspector_controls["b" /* default */], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Layout') - }, allowInheriting && !!defaultThemeLayout && Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Inherit default layout'), - checked: !!inherit, - onChange: () => setAttributes({ - layout: { - inherit: !inherit - } - }) - }), !inherit && allowSwitching && Object(external_wp_element_["createElement"])(LayoutTypeSwitcher, { - type: type, - onChange: onChangeType - }), !inherit && layoutType && Object(external_wp_element_["createElement"])(layoutType.inspectorControls, { - layout: usedLayout, - onChange: onChangeLayout, - layoutBlockSupport: layoutBlockSupport - }))), !inherit && layoutType && Object(external_wp_element_["createElement"])(layoutType.toolBarControls, { - layout: usedLayout, - onChange: onChangeLayout, - layoutBlockSupport: layoutBlockSupport - })); } -function LayoutTypeSwitcher(_ref2) { - let { - type, - onChange - } = _ref2; - return Object(external_wp_element_["createElement"])(external_wp_components_["ButtonGroup"], null, Object(layouts["b" /* getLayoutTypes */])().map(_ref3 => { - let { - name, - label - } = _ref3; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: name, - isPressed: type === name, - onClick: () => onChange(name) - }, label); - })); -} +;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] +var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-select-all.js /** - * Filters registered block settings, extending attributes to include `layout`. - * - * @param {Object} settings Original block settings. - * - * @return {Object} Filtered block settings. + * External dependencies + */ + +/** + * WordPress dependencies */ -function layout_addAttribute(settings) { - if (Object(external_lodash_["has"])(settings.attributes, ['layout', 'type'])) { - return settings; - } - if (Object(external_wp_blocks_["hasBlockSupport"])(settings, layoutBlockSupportKey)) { - settings.attributes = { ...settings.attributes, - layout: { - type: 'object' + + +/** + * Internal dependencies + */ + + +function useSelectAll() { + const { + getBlockOrder, + getSelectedBlockClientIds, + getBlockRootClientId + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + multiSelect + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)(); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function onKeyDown(event) { + if (!isMatch('core/block-editor/select-all', event)) { + return; } + + if (!(0,external_wp_dom_namespaceObject.isEntirelySelected)(event.target)) { + return; + } + + const selectedClientIds = getSelectedBlockClientIds(); + const [firstSelectedClientId] = selectedClientIds; + const rootClientId = getBlockRootClientId(firstSelectedClientId); + let blockClientIds = getBlockOrder(rootClientId); // If we have selected all sibling nested blocks, try selecting up a + // level. See: https://github.com/WordPress/gutenberg/pull/31859/ + + if (selectedClientIds.length === blockClientIds.length) { + blockClientIds = getBlockOrder(getBlockRootClientId(rootClientId)); + } + + const firstClientId = (0,external_lodash_namespaceObject.first)(blockClientIds); + const lastClientId = (0,external_lodash_namespaceObject.last)(blockClientIds); + + if (firstClientId === lastClientId) { + return; + } + + multiSelect(firstClientId, lastClientId); + event.preventDefault(); + } + + node.addEventListener('keydown', onKeyDown); + return () => { + node.removeEventListener('keydown', onKeyDown); }; - } - - return settings; -} -/** - * Override the default edit UI to include layout controls - * - * @param {Function} BlockEdit Original component. - * - * @return {Function} Wrapped component. - */ - -const withInspectorControls = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => props => { - const { - name: blockName - } = props; - const supportLayout = Object(external_wp_blocks_["hasBlockSupport"])(blockName, layoutBlockSupportKey); - return [supportLayout && Object(external_wp_element_["createElement"])(LayoutPanel, Object(esm_extends["a" /* default */])({ - key: "layout" - }, props)), Object(external_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({ - key: "edit" - }, props))]; -}, 'withInspectorControls'); -/** - * Override the default block element to add the layout styles. - * - * @param {Function} BlockListBlock Original component. - * - * @return {Function} Wrapped component. - */ - -const withLayoutStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => { - const { - name, - attributes - } = props; - const shouldRenderLayoutStyles = Object(external_wp_blocks_["hasBlockSupport"])(name, layoutBlockSupportKey); - const id = Object(external_wp_compose_["useInstanceId"])(BlockListBlock); - const defaultThemeLayout = Object(use_setting["a" /* default */])('layout') || {}; - const element = Object(external_wp_element_["useContext"])(block_list["c" /* default */].__unstableElementContext); - const { - layout - } = attributes; - const { - default: defaultBlockLayout - } = Object(external_wp_blocks_["getBlockSupport"])(name, layoutBlockSupportKey) || {}; - const usedLayout = layout !== null && layout !== void 0 && layout.inherit ? defaultThemeLayout : layout || defaultBlockLayout || {}; - const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, { - [`wp-container-${id}`]: shouldRenderLayoutStyles - }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, shouldRenderLayoutStyles && element && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(block_list_layout["b" /* LayoutStyle */], { - selector: `.wp-container-${id}`, - layout: usedLayout, - style: attributes === null || attributes === void 0 ? void 0 : attributes.style - }), element), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, { - className: className - }))); -}); -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/layout/addAttribute', layout_addAttribute); -Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/editor/layout/with-layout-styles', withLayoutStyles); -Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/editor/layout/with-inspector-controls', withInspectorControls); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-border-props.js -/** - * External dependencies - */ - -/** - * Internal dependencies - */ - - - - // This utility is intended to assist where the serialization of the border -// block support is being skipped for a block but the border related CSS classes -// & styles still need to be generated so they can be applied to inner elements. - -const use_border_props_EMPTY_ARRAY = []; -/** - * Provides the CSS class names and inline styles for a block's border support - * attributes. - * - * @param {Object} attributes Block attributes. - * @param {string} attributes.borderColor Selected named border color. - * @param {Object} attributes.style Block's styles attribute. - * - * @return {Object} Border block support derived CSS classes & styles. - */ - -function getBorderClassesAndStyles(_ref) { - var _style$border; - - let { - borderColor, - style - } = _ref; - const borderStyles = (style === null || style === void 0 ? void 0 : style.border) || {}; - const borderClass = Object(utils["a" /* getColorClassName */])('border-color', borderColor); - const className = classnames_default()({ - [borderClass]: !!borderClass, - 'has-border-color': borderColor || (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.color) - }); - return { - className: className || undefined, - style: getInlineStyles({ - border: borderStyles - }) - }; -} -/** - * Derives the border related props for a block from its border block support - * attributes. - * - * Inline styles are forced for named colors to ensure these selections are - * reflected when themes do not load their color stylesheets in the editor. - * - * @param {Object} attributes Block attributes. - * - * @return {Object} ClassName & style props from border block support. - */ - -function useBorderProps(attributes) { - const colors = Object(use_setting["a" /* default */])('color.palette') || use_border_props_EMPTY_ARRAY; - const borderProps = getBorderClassesAndStyles(attributes); // Force inline style to apply border color when themes do not load their - // color stylesheets in the editor. - - if (attributes.borderColor) { - const borderColorObject = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, attributes.borderColor); - borderProps.style.borderColor = borderColorObject.color; - } - - return borderProps; + }, []); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-color-props.js -/** - * External dependencies - */ +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js -/** - * WordPress dependencies - */ -/** - * Internal dependencies - */ - - - - - // The code in this file has largely been lifted from the color block support -// hook. -// -// This utility is intended to assist where the serialization of the colors -// block support is being skipped for a block but the color related CSS classes -// & styles still need to be generated so they can be applied to inner elements. - -/** - * Provides the CSS class names and inline styles for a block's color support - * attributes. - * - * @param {Object} attributes Block attributes. - * - * @return {Object} Color block support derived CSS classes & styles. - */ - -function getColorClassesAndStyles(attributes) { - var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link; - - const { - backgroundColor, - textColor, - gradient, - style - } = attributes; // Collect color CSS classes. - - const backgroundClass = Object(utils["a" /* getColorClassName */])('background-color', backgroundColor); - const textClass = Object(utils["a" /* getColorClassName */])('color', textColor); - - const gradientClass = Object(use_gradient["a" /* __experimentalGetGradientClass */])(gradient); - - const hasGradient = gradientClass || (style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.gradient); // Determine color CSS class name list. - - const className = classnames_default()(textClass, gradientClass, { - // Don't apply the background class if there's a gradient. - [backgroundClass]: !hasGradient && !!backgroundClass, - 'has-text-color': textColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.text), - 'has-background': backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.background) || gradient || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.gradient), - 'has-link-color': style === null || style === void 0 ? void 0 : (_style$elements = style.elements) === null || _style$elements === void 0 ? void 0 : (_style$elements$link = _style$elements.link) === null || _style$elements$link === void 0 ? void 0 : _style$elements$link.color - }); // Collect inline styles for colors. - - const colorStyles = (style === null || style === void 0 ? void 0 : style.color) || {}; - const styleProp = getInlineStyles({ - color: colorStyles - }); - return { - className: className || undefined, - style: styleProp - }; -} -const EMPTY_OBJECT = {}; -/** - * Determines the color related props for a block derived from its color block - * support attributes. - * - * Inline styles are forced for named colors to ensure these selections are - * reflected when themes do not load their color stylesheets in the editor. - * - * @param {Object} attributes Block attributes. - * - * @return {Object} ClassName & style props from colors block support. - */ - -function useColorProps(attributes) { - const { - backgroundColor, - textColor, - gradient - } = attributes; // Some color settings have a special handling for deprecated flags in `useSetting`, - // so we can't unwrap them by doing const { ... } = useSetting('color') - // until https://github.com/WordPress/gutenberg/issues/37094 is fixed. - - const userPalette = Object(use_setting["a" /* default */])('color.palette.custom') || []; - const themePalette = Object(use_setting["a" /* default */])('color.palette.theme') || []; - const defaultPalette = Object(use_setting["a" /* default */])('color.palette.default') || []; - const gradientsPerOrigin = Object(use_setting["a" /* default */])('color.gradients') || EMPTY_OBJECT; - const colors = Object(external_wp_element_["useMemo"])(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); - const gradients = Object(external_wp_element_["useMemo"])(() => [...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.custom) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.theme) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.default) || [])], [gradientsPerOrigin]); - const colorProps = getColorClassesAndStyles(attributes); // Force inline styles to apply colors when themes do not load their color - // stylesheets in the editor. - - if (backgroundColor) { - const backgroundColorObject = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, backgroundColor); - colorProps.style.backgroundColor = backgroundColorObject.color; - } - - if (gradient) { - colorProps.style.background = Object(use_gradient["e" /* getGradientValueBySlug */])(gradients, gradient); - } - - if (textColor) { - const textColorObject = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, textColor); - colorProps.style.color = textColorObject.color; - } - - return colorProps; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-spacing-props.js -/** - * Internal dependencies - */ - // This utility is intended to assist where the serialization of the spacing -// block support is being skipped for a block but the spacing related CSS -// styles still need to be generated so they can be applied to inner elements. - -/** - * Provides the CSS class names and inline styles for a block's spacing support - * attributes. - * - * @param {Object} attributes Block attributes. - * - * @return {Object} Spacing block support derived CSS classes & styles. - */ - -function getSpacingClassesAndStyles(attributes) { - const { - style - } = attributes; // Collect inline styles for spacing. - - const spacingStyles = (style === null || style === void 0 ? void 0 : style.spacing) || {}; - const styleProp = getInlineStyles({ - spacing: spacingStyles - }); - return { - style: styleProp - }; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-cached-truthy.js -/** - * WordPress dependencies - */ - -/** - * Keeps an up-to-date copy of the passed value and returns it. If value becomes falsy, it will return the last truthy copy. - * - * @param {any} value - * @return {any} value - */ - -function useCachedTruthy(value) { - const [cachedValue, setCachedValue] = Object(external_wp_element_["useState"])(value); - Object(external_wp_element_["useEffect"])(() => { - if (value) { - setCachedValue(value); - } - }, [value]); - return cachedValue; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/index.js -/** - * Internal dependencies - */ - - - - - - - - - - - - - - - - - - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/index.js + 118 modules -var components = __webpack_require__("14PQ"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/index.js + 2 modules -var build_module_utils = __webpack_require__("BCrt"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/defaults.js -var defaults = __webpack_require__("lJLt"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/index.js -/** - * Internal dependencies - */ - - - - - - - - -/***/ }), - -/***/ "uoCR": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlockContextProvider; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); - - -/** - * WordPress dependencies - */ - -/** @typedef {import('react').ReactNode} ReactNode */ - -/** - * @typedef BlockContextProviderProps - * - * @property {Record} value Context value to merge with current - * value. - * @property {ReactNode} children Component children. - */ - -/** @type {import('react').Context>} */ - -const Context = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({}); -/** - * Component which merges passed value with current consumed block context. - * - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-context/README.md - * - * @param {BlockContextProviderProps} props - */ - -function BlockContextProvider(_ref) { - let { - value, - children - } = _ref; - const context = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(Context); - const nextValue = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => ({ ...context, - ...value - }), [context, value]); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Context.Provider, { - value: nextValue, - children: children - }); -} -/* harmony default export */ __webpack_exports__["b"] = (Context); - - -/***/ }), - -/***/ "ur0x": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DEFAULT_BLOCK_EDIT_CONTEXT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Provider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return useBlockEditContext; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - -const DEFAULT_BLOCK_EDIT_CONTEXT = { - name: '', - isSelected: false -}; -const Context = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(DEFAULT_BLOCK_EDIT_CONTEXT); -const { - Provider -} = Context; - -/** - * A hook that returns the block edit context. - * - * @return {Object} Block edit context - */ - -function useBlockEditContext() { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(Context); -} - - -/***/ }), - -/***/ "v5LD": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSetting; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("ur0x"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("BhPs"); /** * External dependencies */ @@ -45872,259 +18774,356 @@ function useBlockEditContext() { + + /** * Internal dependencies */ -const blockedPaths = ['color', 'border', 'typography', 'spacing']; -const deprecatedFlags = { - 'color.palette': settings => settings.colors === undefined ? undefined : settings.colors, - 'color.gradients': settings => settings.gradients === undefined ? undefined : settings.gradients, - 'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors, - 'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients, - 'typography.fontSizes': settings => settings.fontSizes === undefined ? undefined : settings.fontSizes, - 'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes, - 'typography.lineHeight': settings => settings.enableCustomLineHeight, - 'spacing.units': settings => { - if (settings.enableCustomUnits === undefined) { + + + +function useWritingFlow() { + const [before, ref, after] = useTabNav(); + const hasMultiSelection = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasMultiSelection(), []); + return [before, (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, use_multi_selection_useMultiSelection(), useSelectAll(), useArrowNav(), (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + node.tabIndex = -1; + + if (!hasMultiSelection) { return; } - if (settings.enableCustomUnits === true) { - return ['px', 'em', 'rem', 'vh', 'vw', '%']; - } + node.setAttribute('aria-label', (0,external_wp_i18n_namespaceObject.__)('Multiple selected blocks')); + return () => { + node.removeAttribute('aria-label'); + }; + }, [hasMultiSelection])]), after]; +} - return settings.enableCustomUnits; - }, - 'spacing.padding': settings => settings.enableCustomSpacing -}; -const prefixedFlags = { - /* - * These were only available in the plugin - * and can be removed when the minimum WordPress version - * for the plugin is 5.9. - */ - 'border.customColor': 'border.color', - 'border.customStyle': 'border.style', - 'border.customWidth': 'border.width', - 'typography.customFontStyle': 'typography.fontStyle', - 'typography.customFontWeight': 'typography.fontWeight', - 'typography.customLetterSpacing': 'typography.letterSpacing', - 'typography.customTextDecorations': 'typography.textDecoration', - 'typography.customTextTransforms': 'typography.textTransform', - - /* - * These were part of WordPress 5.8 and we need to keep them. - */ - 'border.customRadius': 'border.radius', - 'spacing.customMargin': 'spacing.margin', - 'spacing.customPadding': 'spacing.padding', - 'typography.customLineHeight': 'typography.lineHeight' -}; +function WritingFlow(_ref, forwardedRef) { + let { + children, + ...props + } = _ref; + const [before, ref, after] = useWritingFlow(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, before, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, props, { + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, forwardedRef]), + className: classnames_default()(props.className, 'block-editor-writing-flow') + }), children), after); +} /** - * Remove `custom` prefixes for flags that did not land in 5.8. + * Handles selection and navigation across blocks. This component should be + * wrapped around BlockList. * - * This provides continued support for `custom` prefixed properties. It will - * be removed once third party devs have had sufficient time to update themes, - * plugins, etc. - * - * @see https://github.com/WordPress/gutenberg/pull/34485 - * - * @param {string} path Path to desired value in settings. - * @return {string} The value for defined setting. - */ - -const removeCustomPrefixes = path => { - return prefixedFlags[path] || path; -}; -/** - * Hook that retrieves the editor setting. - * It works with nested objects using by finding the value at path. - * - * @param {string} path The path to the setting. - * @return {any} Returns the value defined for the setting. - * @example - * ```js - * const isEnabled = useSetting( 'typography.dropCap' ); - * ``` + * @param {Object} props Component properties. + * @param {WPElement} props.children Children to be rendered. */ -function useSetting(path) { - const { - name: blockName - } = Object(_block_edit__WEBPACK_IMPORTED_MODULE_3__[/* useBlockEditContext */ "c"])(); - const setting = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => { - var _get; +/* harmony default export */ var writing_flow = ((0,external_wp_element_namespaceObject.forwardRef)(WritingFlow)); - if (blockedPaths.includes(path)) { - // eslint-disable-next-line no-console - console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.'); - return undefined; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/iframe/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +const BODY_CLASS_NAME = 'editor-styles-wrapper'; +const BLOCK_PREFIX = 'wp-block'; +/** + * Clones stylesheets targetting the editor canvas to the given document. A + * stylesheet is considered targetting the editor a canvas if it contains the + * `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors. + * + * Ideally, this hook should be removed in the future and styles should be added + * explicitly as editor styles. + * + * @param {Document} doc The document to append cloned stylesheets to. + */ + +function styleSheetsCompat(doc) { + // Search the document for stylesheets targetting the editor canvas. + Array.from(document.styleSheets).forEach(styleSheet => { + try { + // May fail for external styles. + // eslint-disable-next-line no-unused-expressions + styleSheet.cssRules; + } catch (e) { + return; } - const settings = select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]).getSettings(); // 1 - Use __experimental features, if available. - // We cascade to the all value if the block one is not available. + const { + ownerNode, + cssRules + } = styleSheet; - const normalizedPath = removeCustomPrefixes(path); - const defaultsPath = `__experimentalFeatures.${normalizedPath}`; - const blockPath = `__experimentalFeatures.blocks.${blockName}.${normalizedPath}`; - const experimentalFeaturesResult = (_get = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(settings, blockPath)) !== null && _get !== void 0 ? _get : Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(settings, defaultsPath); + if (!cssRules) { + return; + } // Generally, ignore inline styles. We add inline styles belonging to a + // stylesheet later, which may or may not match the selectors. - if (experimentalFeaturesResult !== undefined) { - if (_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["__EXPERIMENTAL_PATHS_WITH_MERGE"][normalizedPath]) { - var _ref, _experimentalFeatures; - return (_ref = (_experimentalFeatures = experimentalFeaturesResult.custom) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.default; + if (ownerNode.tagName !== 'LINK') { + return; + } // Don't try to add the reset styles, which were removed as a dependency + // from `edit-blocks` for the iframe since we don't need to reset admin + // styles. + + + if (ownerNode.id === 'wp-reset-editor-styles-css') { + return; + } + + const isMatch = Array.from(cssRules).find(_ref => { + let { + selectorText + } = _ref; + return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`)); + }); + + if (isMatch && !doc.getElementById(ownerNode.id)) { + // Display warning once we have a way to add style dependencies to the editor. + // See: https://github.com/WordPress/gutenberg/pull/37466. + doc.head.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet. + + const inlineCssId = ownerNode.id.replace('-css', '-inline-css'); + const inlineCssElement = document.getElementById(inlineCssId); + + if (inlineCssElement) { + doc.head.appendChild(inlineCssElement.cloneNode(true)); } - - return experimentalFeaturesResult; - } // 2 - Use deprecated settings, otherwise. - - - const deprecatedSettingsValue = deprecatedFlags[normalizedPath] ? deprecatedFlags[normalizedPath](settings) : undefined; - - if (deprecatedSettingsValue !== undefined) { - return deprecatedSettingsValue; - } // 3 - Fall back for typography.dropCap: - // This is only necessary to support typography.dropCap. - // when __experimentalFeatures are not present (core without plugin). - // To remove when __experimentalFeatures are ported to core. - - - return normalizedPath === 'typography.dropCap' ? true : undefined; - }, [blockName, path]); - return setting; -} - - -/***/ }), - -/***/ "v8Ku": -/***/ (function(module, exports) { - - - -/***/ }), - -/***/ "vIlp": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export getDistanceFromPointToEdge */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDistanceToNearestEdge; }); -/** - * A string representing the name of an edge. - * - * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName - */ - -/** - * @typedef {Object} WPPoint - * @property {number} x The horizontal position. - * @property {number} y The vertical position. - */ - -/** - * Given a point, a DOMRect and the name of an edge, returns the distance to - * that edge of the rect. - * - * This function works for edges that are horizontal or vertical (e.g. not - * rotated), the following terms are used so that the function works in both - * orientations: - * - * - Forward, meaning the axis running horizontally when an edge is vertical - * and vertically when an edge is horizontal. - * - Lateral, meaning the axis running vertically when an edge is vertical - * and horizontally when an edge is horizontal. - * - * @param {WPPoint} point The point to measure distance from. - * @param {DOMRect} rect A DOM Rect containing edge positions. - * @param {WPEdgeName} edge The edge to measure to. - */ -function getDistanceFromPointToEdge(point, rect, edge) { - const isHorizontal = edge === 'top' || edge === 'bottom'; - const { - x, - y - } = point; - const pointLateralPosition = isHorizontal ? x : y; - const pointForwardPosition = isHorizontal ? y : x; - const edgeStart = isHorizontal ? rect.left : rect.top; - const edgeEnd = isHorizontal ? rect.right : rect.bottom; - const edgeForwardPosition = rect[edge]; // Measure the straight line distance to the edge of the rect, when the - // point is adjacent to the edge. - // Else, if the point is positioned diagonally to the edge of the rect, - // measure diagonally to the nearest corner that the edge meets. - - let edgeLateralPosition; - - if (pointLateralPosition >= edgeStart && pointLateralPosition <= edgeEnd) { - edgeLateralPosition = pointLateralPosition; - } else if (pointLateralPosition < edgeEnd) { - edgeLateralPosition = edgeStart; - } else { - edgeLateralPosition = edgeEnd; - } - - return Math.sqrt((pointLateralPosition - edgeLateralPosition) ** 2 + (pointForwardPosition - edgeForwardPosition) ** 2); -} -/** - * Given a point, a DOMRect and a list of allowed edges returns the name of and - * distance to the nearest edge. - * - * @param {WPPoint} point The point to measure distance from. - * @param {DOMRect} rect A DOM Rect containing edge positions. - * @param {WPEdgeName[]} allowedEdges A list of the edges included in the - * calculation. Defaults to all edges. - * - * @return {[number, string]} An array where the first value is the distance - * and a second is the edge name. - */ - -function getDistanceToNearestEdge(point, rect) { - let allowedEdges = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['top', 'bottom', 'left', 'right']; - let candidateDistance; - let candidateEdge; - allowedEdges.forEach(edge => { - const distance = getDistanceFromPointToEdge(point, rect, edge); - - if (candidateDistance === undefined || distance < candidateDistance) { - candidateDistance = distance; - candidateEdge = edge; } }); - return [candidateDistance, candidateEdge]; +} +/** + * Bubbles some event types (keydown, keypress, and dragover) to parent document + * document to ensure that the keyboard shortcuts and drag and drop work. + * + * Ideally, we should remove event bubbling in the future. Keyboard shortcuts + * should be context dependent, e.g. actions on blocks like Cmd+A should not + * work globally outside the block editor. + * + * @param {Document} doc Document to attach listeners to. + */ + + +function bubbleEvents(doc) { + const { + defaultView + } = doc; + const { + frameElement + } = defaultView; + + function bubbleEvent(event) { + const prototype = Object.getPrototypeOf(event); + const constructorName = prototype.constructor.name; + const Constructor = window[constructorName]; + const init = {}; + + for (const key in event) { + init[key] = event[key]; + } + + if (event instanceof defaultView.MouseEvent) { + const rect = frameElement.getBoundingClientRect(); + init.clientX += rect.left; + init.clientY += rect.top; + } + + const newEvent = new Constructor(event.type, init); + const cancelled = !frameElement.dispatchEvent(newEvent); + + if (cancelled) { + event.preventDefault(); + } + } + + const eventTypes = ['dragover']; + + for (const name of eventTypes) { + doc.addEventListener(name, bubbleEvent); + } } +function useParsedAssets(html) { + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const doc = document.implementation.createHTMLDocument(''); + doc.body.innerHTML = html; + return Array.from(doc.body.children); + }, [html]); +} -/***/ }), +async function loadScript(head, _ref2) { + let { + id, + src + } = _ref2; + return new Promise((resolve, reject) => { + const script = head.ownerDocument.createElement('script'); + script.id = id; -/***/ "vSu0": -/***/ (function(module, __webpack_exports__, __webpack_require__) { + if (src) { + script.src = src; -"use strict"; + script.onload = () => resolve(); -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); + script.onerror = () => reject(); + } else { + resolve(); + } -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); + head.appendChild(script); + }); +} + +function Iframe(_ref3, ref) { + var _window$__editorAsset, _window$__editorAsset2; + + let { + contentRef, + children, + head, + tabIndex = 0, + ...props + } = _ref3; + const [, forceRender] = (0,external_wp_element_namespaceObject.useReducer)(() => ({})); + const [iframeDocument, setIframeDocument] = (0,external_wp_element_namespaceObject.useState)(); + const [bodyClasses, setBodyClasses] = (0,external_wp_element_namespaceObject.useState)([]); + const styles = useParsedAssets((_window$__editorAsset = window.__editorAssets) === null || _window$__editorAsset === void 0 ? void 0 : _window$__editorAsset.styles); + const scripts = useParsedAssets((_window$__editorAsset2 = window.__editorAssets) === null || _window$__editorAsset2 === void 0 ? void 0 : _window$__editorAsset2.scripts); + const clearerRef = useBlockSelectionClearer(); + const [before, writingFlowRef, after] = useWritingFlow(); + const setRef = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function setDocumentIfReady() { + const { + contentDocument, + ownerDocument + } = node; + const { + readyState, + documentElement + } = contentDocument; + + if (readyState !== 'interactive' && readyState !== 'complete') { + return false; + } + + bubbleEvents(contentDocument); + setIframeDocument(contentDocument); + clearerRef(documentElement); // Ideally ALL classes that are added through get_body_class should + // be added in the editor too, which we'll somehow have to get from + // the server in the future (which will run the PHP filters). + + setBodyClasses(Array.from(ownerDocument.body.classList).filter(name => name.startsWith('admin-color-') || name === 'wp-embed-responsive')); + contentDocument.dir = ownerDocument.dir; + documentElement.removeChild(contentDocument.head); + documentElement.removeChild(contentDocument.body); + return true; + } + + if (setDocumentIfReady()) { + return; + } // Document is not immediately loaded in Firefox. + + + node.addEventListener('load', () => { + setDocumentIfReady(); + }); + }, []); + const headRef = (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + scripts.reduce((promise, script) => promise.then(() => loadScript(element, script)), Promise.resolve()).finally(() => { + // When script are loaded, re-render blocks to allow them + // to initialise. + forceRender(); + }); + }, []); + const bodyRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRef, clearerRef, writingFlowRef]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (iframeDocument) { + styleSheetsCompat(iframeDocument); + } + }, [iframeDocument]); + head = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("style", null, 'body{margin:0}'), styles.map(_ref4 => { + let { + tagName, + href, + id, + rel, + media, + textContent + } = _ref4; + const TagName = tagName.toLowerCase(); + + if (TagName === 'style') { + return (0,external_wp_element_namespaceObject.createElement)(TagName, { + id, + key: id + }, textContent); + } + + return (0,external_wp_element_namespaceObject.createElement)(TagName, { + href, + id, + rel, + media, + key: id + }); + }), head); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({}, props, { + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]), + tabIndex: tabIndex, + title: (0,external_wp_i18n_namespaceObject.__)('Editor canvas') + }), iframeDocument && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("head", { + ref: headRef + }, head), (0,external_wp_element_namespaceObject.createElement)("body", { + ref: bodyRef, + className: classnames_default()(BODY_CLASS_NAME, ...bodyClasses) + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, { + document: iframeDocument + }, children))), iframeDocument.documentElement)), tabIndex >= 0 && after); +} + +/* harmony default export */ var iframe = ((0,external_wp_element_namespaceObject.forwardRef)(Iframe)); + +;// CONCATENATED MODULE: ./node_modules/colord/index.mjs +var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^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,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({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(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; + +;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs +/* harmony default export */ function names(e,f){var a={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 d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));ud?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}} // EXTERNAL MODULE: ./node_modules/traverse/index.js -var traverse = __webpack_require__("eGrx"); +var traverse = __webpack_require__(3124); var traverse_default = /*#__PURE__*/__webpack_require__.n(traverse); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/parse.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/parse.js /* eslint-disable @wordpress/no-unused-vars-before-return */ // Adapted from https://github.com/reworkcss/css // because we needed to remove source map support. // http://www.w3.org/TR/CSS21/grammar.htm // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027 const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; -/* harmony default export */ var parse = (function (css, options) { +/* harmony default export */ function parse(css, options) { options = options || {}; /** * Positional. @@ -46769,7 +19768,7 @@ const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; } return addParent(stylesheet()); -}); +} /** * Trim `str`. */ @@ -46812,17 +19811,16 @@ function addParent(obj, parent) { /* eslint-enable @wordpress/no-unused-vars-before-return */ // EXTERNAL MODULE: ./node_modules/inherits/inherits_browser.js -var inherits_browser = __webpack_require__("P7XM"); +var inherits_browser = __webpack_require__(8575); var inherits_browser_default = /*#__PURE__*/__webpack_require__.n(inherits_browser); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/compiler.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/compiler.js // Adapted from https://github.com/reworkcss/css // because we needed to remove source map support. /** * Expose `Compiler`. */ -/* harmony default export */ var stringify_compiler = (Compiler); +/* harmony default export */ var compiler = (Compiler); /** * Initialize a compiler. */ @@ -46866,7 +19864,7 @@ Compiler.prototype.mapVisit = function (nodes, delim) { return buf; }; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/compress.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/compress.js // Adapted from https://github.com/reworkcss/css // because we needed to remove source map support. @@ -46889,14 +19887,14 @@ Compiler.prototype.mapVisit = function (nodes, delim) { */ function compress_Compiler(options) { - stringify_compiler.call(this, options); + compiler.call(this, options); } /** * Inherit from `Base.prototype`. */ -inherits_browser_default()(compress_Compiler, stringify_compiler); +inherits_browser_default()(compress_Compiler, compiler); /** * Compile `node`. */ @@ -47034,7 +20032,7 @@ compress_Compiler.prototype.declaration = function (node) { return this.emit(node.property + ':' + node.value, node.position) + this.emit(';'); }; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/identity.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/identity.js /* eslint-disable @wordpress/no-unused-vars-before-return */ // Adapted from https://github.com/reworkcss/css // because we needed to remove source map support. @@ -47059,7 +20057,7 @@ compress_Compiler.prototype.declaration = function (node) { function identity_Compiler(options) { options = options || {}; - stringify_compiler.call(this, options); + compiler.call(this, options); this.indentation = options.indent; } /** @@ -47067,7 +20065,7 @@ function identity_Compiler(options) { */ -inherits_browser_default()(identity_Compiler, stringify_compiler); +inherits_browser_default()(identity_Compiler, compiler); /** * Compile `node`. */ @@ -47232,7 +20230,7 @@ identity_Compiler.prototype.indent = function (level) { }; /* eslint-enable @wordpress/no-unused-vars-before-return */ -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/ast/stringify/index.js // Adapted from https://github.com/reworkcss/css // because we needed to remove source map support. @@ -47254,14 +20252,14 @@ identity_Compiler.prototype.indent = function (level) { * @return {string} */ -/* harmony default export */ var stringify = (function (node, options) { +/* harmony default export */ function stringify(node, options) { options = options || {}; const compiler = options.compress ? new compress(options) : new identity(options); const code = compiler.compile(node); return code; -}); +} -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/traverse.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/traverse.js /** * External dependencies */ @@ -47275,7 +20273,7 @@ identity_Compiler.prototype.indent = function (level) { function traverseCSS(css, callback) { try { const parsed = parse(css); - const updated = traverse_default.a.map(parsed, function (node) { + const updated = traverse_default().map(parsed, function (node) { if (!node) { return node; } @@ -47293,7 +20291,7 @@ function traverseCSS(css, callback) { /* harmony default export */ var transform_styles_traverse = (traverseCSS); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/transforms/url-rewrite.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/transforms/url-rewrite.js /** * Return `true` if the given path is http/https. * @@ -47429,7 +20427,7 @@ const rewrite = rootURL => node => { /* harmony default export */ var url_rewrite = (rewrite); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/transforms/wrap.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/transforms/wrap.js /** * @constant string IS_ROOT_TAG Regex to check if the selector is a root tag selector. */ @@ -47481,7 +20479,7 @@ const wrap = function (namespace) { /* harmony default export */ var transforms_wrap = (wrap); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js /** * External dependencies */ @@ -47508,7 +20506,7 @@ const wrap = function (namespace) { const transformStyles = function (styles) { let wrapperClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - return Object(external_lodash_["map"])(styles, _ref => { + return (0,external_lodash_namespaceObject.map)(styles, _ref => { let { css, baseURL @@ -47524,106 +20522,2343 @@ const transformStyles = function (styles) { } if (transforms.length) { - return transform_styles_traverse(css, Object(external_wp_compose_["compose"])(transforms)); + return transform_styles_traverse(css, (0,external_wp_compose_namespaceObject.compose)(transforms)); } return css; }); }; -/* harmony default export */ var transform_styles = __webpack_exports__["a"] = (transformStyles); +/* harmony default export */ var transform_styles = (transformStyles); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editor-styles/index.js -/***/ }), +/** + * External dependencies + */ -/***/ "vtO0": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockAlignmentControl; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ BlockAlignmentToolbar; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-none.js /** * WordPress dependencies */ -const alignNone = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z" -})); -/* harmony default export */ var align_none = (alignNone); -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-left.js +/** + * Internal dependencies + */ + + +const EDITOR_STYLES_SELECTOR = '.editor-styles-wrapper'; +k([names, a11y]); + +function useDarkThemeBodyClassName(styles) { + return (0,external_wp_element_namespaceObject.useCallback)(node => { + if (!node) { + return; + } + + const { + ownerDocument + } = node; + const { + defaultView, + body + } = ownerDocument; + const canvas = ownerDocument.querySelector(EDITOR_STYLES_SELECTOR); + let backgroundColor; + + if (!canvas) { + // The real .editor-styles-wrapper element might not exist in the + // DOM, so calculate the background color by creating a fake + // wrapper. + const tempCanvas = ownerDocument.createElement('div'); + tempCanvas.classList.add('editor-styles-wrapper'); + body.appendChild(tempCanvas); + backgroundColor = defaultView.getComputedStyle(tempCanvas, null).getPropertyValue('background-color'); + body.removeChild(tempCanvas); + } else { + backgroundColor = defaultView.getComputedStyle(canvas, null).getPropertyValue('background-color'); + } + + const colordBackgroundColor = w(backgroundColor); // If background is transparent, it should be treated as light color. + + if (colordBackgroundColor.luminance() > 0.5 || colordBackgroundColor.alpha() === 0) { + body.classList.remove('is-dark-theme'); + } else { + body.classList.add('is-dark-theme'); + } + }, [styles]); +} + +function EditorStyles(_ref) { + let { + styles + } = _ref; + const transformedStyles = (0,external_wp_element_namespaceObject.useMemo)(() => transform_styles(styles, EDITOR_STYLES_SELECTOR), [styles]); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("style", { + ref: useDarkThemeBodyClassName(styles) + }), transformedStyles.map((css, index) => (0,external_wp_element_namespaceObject.createElement)("style", { + key: index + }, css))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/auto.js /** * WordPress dependencies */ -const positionLeft = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z" -})); -/* harmony default export */ var position_left = (positionLeft); -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/position-center.js -var position_center = __webpack_require__("EpZT"); -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-right.js + +/** + * Internal dependencies + */ + + + + + // This is used to avoid rendering the block list if the sizes change. + +let MemoizedBlockList; +const MAX_HEIGHT = 2000; + +function AutoBlockPreview(_ref) { + let { + viewportWidth, + __experimentalPadding + } = _ref; + const [containerResizeListener, { + width: containerWidth + }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); + const [contentResizeListener, { + height: contentHeight + }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); + const styles = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(store).getSettings().styles; + }, []); // Avoid scrollbars for pattern previews. + + const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (styles) { + return [...styles, { + css: 'body{height:auto;overflow:hidden;}', + __unstableType: 'presets' + }]; + } + + return styles; + }, [styles]); // Initialize on render instead of module top level, to avoid circular dependency issues. + + MemoizedBlockList = MemoizedBlockList || (0,external_wp_compose_namespaceObject.pure)(BlockList); + const scale = containerWidth / viewportWidth; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-preview__container" + }, containerResizeListener, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, { + className: "block-editor-block-preview__content", + style: { + transform: `scale(${scale})`, + height: contentHeight * scale, + maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined + } + }, (0,external_wp_element_namespaceObject.createElement)(iframe, { + head: (0,external_wp_element_namespaceObject.createElement)(EditorStyles, { + styles: editorStyles + }), + contentRef: (0,external_wp_compose_namespaceObject.useRefEffect)(bodyElement => { + const { + ownerDocument: { + documentElement + } + } = bodyElement; + documentElement.classList.add('block-editor-block-preview__content-iframe'); + documentElement.style.position = 'absolute'; + documentElement.style.width = '100%'; + bodyElement.style.padding = __experimentalPadding + 'px'; // necessary for contentResizeListener to work. + + bodyElement.style.position = 'relative'; + }, []), + "aria-hidden": true, + tabIndex: -1, + style: { + position: 'absolute', + width: viewportWidth, + height: contentHeight, + pointerEvents: 'none', + // This is a catch-all max-height for patterns. + // See: https://github.com/WordPress/gutenberg/pull/38175. + maxHeight: MAX_HEIGHT + } + }, contentResizeListener, (0,external_wp_element_namespaceObject.createElement)(MemoizedBlockList, { + renderAppender: false + })))); +} + +/* harmony default export */ var auto = (AutoBlockPreview); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js + + +/** + * External dependencies + */ /** * WordPress dependencies */ -const positionRight = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { + + + +/** + * Internal dependencies + */ + + + + + + +function BlockPreview(_ref) { + let { + blocks, + __experimentalPadding = 0, + viewportWidth = 1200, + __experimentalLive = false, + __experimentalOnClick + } = _ref; + const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []); + const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { + const _settings = { ...originalSettings + }; + _settings.__experimentalBlockPatterns = []; + return _settings; + }, [originalSettings]); + const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.castArray)(blocks), [blocks]); + + if (!blocks || blocks.length === 0) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(provider, { + value: renderedBlocks, + settings: settings + }, __experimentalLive ? (0,external_wp_element_namespaceObject.createElement)(LiveBlockPreview, { + onClick: __experimentalOnClick + }) : (0,external_wp_element_namespaceObject.createElement)(auto, { + viewportWidth: viewportWidth, + __experimentalPadding: __experimentalPadding + })); +} +/** + * BlockPreview renders a preview of a block or array of blocks. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md + * + * @param {Object} preview options for how the preview should be shown + * @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed. + * @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700. + * + * @return {WPComponent} The component to be rendered. + */ + +/* harmony default export */ var block_preview = ((0,external_wp_element_namespaceObject.memo)(BlockPreview)); +/** + * This hook is used to lightly mark an element as a block preview wrapper + * element. Call this hook and pass the returned props to the element to mark as + * a block preview wrapper, automatically rendering inner blocks as children. If + * you define a ref for the element, it is important to pass the ref to this + * hook, which the hook in turn will pass to the component through the props it + * returns. Optionally, you can also pass any other props through this hook, and + * they will be merged and returned. + * + * @param {Object} options Preview options. + * @param {WPBlock[]} options.blocks Block objects. + * @param {Object} options.props Optional. Props to pass to the element. Must contain + * the ref if one is defined. + * @param {Object} options.__experimentalLayout Layout settings to be used in the preview. + * + */ + +function useBlockPreview(_ref2) { + let { + blocks, + props = {}, + __experimentalLayout + } = _ref2; + const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []); + const disabledRef = (0,external_wp_compose_namespaceObject.__experimentalUseDisabled)(); + const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, disabledRef]); + const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, + __experimentalBlockPatterns: [] + }), [originalSettings]); + const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.castArray)(blocks), [blocks]); + const children = (0,external_wp_element_namespaceObject.createElement)(provider, { + value: renderedBlocks, + settings: settings + }, (0,external_wp_element_namespaceObject.createElement)(BlockListItems, { + renderAppender: false, + __experimentalLayout: __experimentalLayout + })); + return { ...props, + ref, + className: classnames_default()(props.className, 'block-editor-block-preview__live-content', 'components-disabled'), + children: blocks !== null && blocks !== void 0 && blocks.length ? children : null + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/preview-panel.js + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +function InserterPreviewPanel(_ref) { + var _hoveredItemBlockType, _hoveredItemBlockType2; + + let { + item + } = _ref; + const { + name, + title, + icon, + description, + initialAttributes + } = item; + const hoveredItemBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); + const isReusable = (0,external_wp_blocks_namespaceObject.isReusableBlock)(item); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__preview-container" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__preview" + }, isReusable || hoveredItemBlockType !== null && hoveredItemBlockType !== void 0 && hoveredItemBlockType.example ? (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__preview-content" + }, (0,external_wp_element_namespaceObject.createElement)(block_preview, { + __experimentalPadding: 16, + viewportWidth: (_hoveredItemBlockType = (_hoveredItemBlockType2 = hoveredItemBlockType.example) === null || _hoveredItemBlockType2 === void 0 ? void 0 : _hoveredItemBlockType2.viewportWidth) !== null && _hoveredItemBlockType !== void 0 ? _hoveredItemBlockType : 500, + blocks: hoveredItemBlockType.example ? (0,external_wp_blocks_namespaceObject.getBlockFromExample)(item.name, { + attributes: { ...hoveredItemBlockType.example.attributes, + ...initialAttributes + }, + innerBlocks: hoveredItemBlockType.example.innerBlocks + }) : (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes) + })) : (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__preview-content-missing" + }, (0,external_wp_i18n_namespaceObject.__)('No Preview Available.'))), !isReusable && (0,external_wp_element_namespaceObject.createElement)(block_card, { + title: title, + icon: icon, + description: description + })); +} + +/* harmony default export */ var preview_panel = (InserterPreviewPanel); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/context.js +/** + * WordPress dependencies + */ + +const InserterListboxContext = (0,external_wp_element_namespaceObject.createContext)(); +/* harmony default export */ var context = (InserterListboxContext); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/item.js + + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function InserterListboxItem(_ref, ref) { + let { + isFirst, + as: Component, + children, + ...props + } = _ref; + const state = (0,external_wp_element_namespaceObject.useContext)(context); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, _extends({ + ref: ref, + state: state, + role: "option" // Use the CompositeItem `focusable` prop over Button's + // isFocusable. The latter was shown to cause an issue + // with tab order in the inserter list. + , + focusable: true + }, props), htmlProps => { + const propsWithTabIndex = { ...htmlProps, + tabIndex: isFirst ? 0 : htmlProps.tabIndex + }; + + if (Component) { + return (0,external_wp_element_namespaceObject.createElement)(Component, propsWithTabIndex, children); + } + + if (typeof children === 'function') { + return children(propsWithTabIndex); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, propsWithTabIndex, children); + }); +} + +/* harmony default export */ var inserter_listbox_item = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxItem)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drag-handle.js + + +/** + * WordPress dependencies + */ + +const dragHandle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + width: "18", + height: "18", xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z" + viewBox: "0 0 18 18" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z" })); -/* harmony default export */ var position_right = (positionRight); +/* harmony default export */ var drag_handle = (dragHandle); -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js -var stretch_wide = __webpack_require__("beZb"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/draggable-chip.js -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-full-width.js -var stretch_full_width = __webpack_require__("XNw2"); -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/use-available-alignments.js -var use_available_alignments = __webpack_require__("K/rC"); +/** + * WordPress dependencies + */ -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/ui.js +/** + * Internal dependencies + */ + + +function BlockDraggableChip(_ref) { + let { + count, + icon + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-draggable-chip-wrapper" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-draggable-chip" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, { + justify: "center", + className: "block-editor-block-draggable-chip__content" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, icon ? (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: icon + }) : (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %d: Number of blocks. */ + (0,external_wp_i18n_namespaceObject._n)('%d block', '%d blocks', count), count)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: drag_handle + }))))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-draggable-blocks/index.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + +const InserterDraggableBlocks = _ref => { + let { + isEnabled, + blocks, + icon, + children + } = _ref; + const transferData = { + type: 'inserter', + blocks + }; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Draggable, { + __experimentalTransferDataType: "wp-blocks", + transferData: transferData, + __experimentalDragComponent: (0,external_wp_element_namespaceObject.createElement)(BlockDraggableChip, { + count: blocks.length, + icon: icon + }) + }, _ref2 => { + let { + onDraggableStart, + onDraggableEnd + } = _ref2; + return children({ + draggable: isEnabled, + onDragStart: isEnabled ? onDraggableStart : undefined, + onDragEnd: isEnabled ? onDraggableEnd : undefined + }); + }); +}; + +/* harmony default export */ var inserter_draggable_blocks = (InserterDraggableBlocks); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-list-item/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +/** + * Return true if platform is MacOS. + * + * @param {Object} _window window object by default; used for DI testing. + * + * @return {boolean} True if MacOS; false otherwise. + */ + +function isAppleOS() { + let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window; + + const { + platform + } = _window.navigator; + return platform.indexOf('Mac') !== -1 || ['iPad', 'iPhone'].includes(platform); +} + +function InserterListItem(_ref) { + let { + className, + isFirst, + item, + onSelect, + onHover, + isDraggable, + ...props + } = _ref; + const isDragging = (0,external_wp_element_namespaceObject.useRef)(false); + const itemIconStyle = item.icon ? { + backgroundColor: item.icon.background, + color: item.icon.foreground + } : {}; + const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + return [(0,external_wp_blocks_namespaceObject.createBlock)(item.name, item.initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(item.innerBlocks))]; + }, [item.name, item.initialAttributes, item.initialAttributes]); + return (0,external_wp_element_namespaceObject.createElement)(inserter_draggable_blocks, { + isEnabled: isDraggable && !item.disabled, + blocks: blocks, + icon: item.icon + }, _ref2 => { + let { + draggable, + onDragStart, + onDragEnd + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-types-list__list-item", + draggable: draggable, + onDragStart: event => { + isDragging.current = true; + + if (onDragStart) { + onHover(null); + onDragStart(event); + } + }, + onDragEnd: event => { + isDragging.current = false; + + if (onDragEnd) { + onDragEnd(event); + } + } + }, (0,external_wp_element_namespaceObject.createElement)(inserter_listbox_item, _extends({ + isFirst: isFirst, + className: classnames_default()('block-editor-block-types-list__item', className), + disabled: item.isDisabled, + onClick: event => { + event.preventDefault(); + onSelect(item, isAppleOS() ? event.metaKey : event.ctrlKey); + onHover(null); + }, + onKeyDown: event => { + const { + keyCode + } = event; + + if (keyCode === external_wp_keycodes_namespaceObject.ENTER) { + event.preventDefault(); + onSelect(item, isAppleOS() ? event.metaKey : event.ctrlKey); + onHover(null); + } + }, + onFocus: () => { + if (isDragging.current) { + return; + } + + onHover(item); + }, + onMouseEnter: () => { + if (isDragging.current) { + return; + } + + onHover(item); + }, + onMouseLeave: () => onHover(null), + onBlur: () => onHover(null) + }, props), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-block-types-list__item-icon", + style: itemIconStyle + }, (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: item.icon, + showColors: true + })), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-block-types-list__item-title" + }, item.title))); + }); +} + +/* harmony default export */ var inserter_list_item = ((0,external_wp_element_namespaceObject.memo)(InserterListItem)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/group.js + + + +/** + * WordPress dependencies + */ + + + + +function InserterListboxGroup(props, ref) { + const [shouldSpeak, setShouldSpeak] = (0,external_wp_element_namespaceObject.useState)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (shouldSpeak) { + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to move through blocks')); + } + }, [shouldSpeak]); + return (0,external_wp_element_namespaceObject.createElement)("div", _extends({ + ref: ref, + role: "listbox", + "aria-orientation": "horizontal", + onFocus: () => { + setShouldSpeak(true); + }, + onBlur: event => { + const focusingOutsideGroup = !event.currentTarget.contains(event.relatedTarget); + + if (focusingOutsideGroup) { + setShouldSpeak(false); + } + } + }, props)); +} + +/* harmony default export */ var group = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxGroup)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/row.js + + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function InserterListboxRow(props, ref) { + const state = (0,external_wp_element_namespaceObject.useContext)(context); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeGroup, _extends({ + state: state, + role: "presentation", + ref: ref + }, props)); +} + +/* harmony default export */ var inserter_listbox_row = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxRow)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-types-list/index.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +function chunk(array, size) { + const chunks = []; + + for (let i = 0, j = array.length; i < j; i += size) { + chunks.push(array.slice(i, i + size)); + } + + return chunks; +} + +function BlockTypesList(_ref) { + let { + items = [], + onSelect, + onHover = () => {}, + children, + label, + isDraggable = true + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(group, { + className: "block-editor-block-types-list", + "aria-label": label + }, chunk(items, 3).map((row, i) => (0,external_wp_element_namespaceObject.createElement)(inserter_listbox_row, { + key: i + }, row.map((item, j) => (0,external_wp_element_namespaceObject.createElement)(inserter_list_item, { + key: item.id, + item: item, + className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(item.id), + onSelect: onSelect, + onHover: onHover, + isDraggable: isDraggable, + isFirst: i === 0 && j === 0 + })))), children); +} + +/* harmony default export */ var block_types_list = (BlockTypesList); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/panel.js + + +/** + * WordPress dependencies + */ + + +function InserterPanel(_ref) { + let { + title, + icon, + children + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__panel-header" + }, (0,external_wp_element_namespaceObject.createElement)("h2", { + className: "block-editor-inserter__panel-title" + }, title), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, { + icon: icon + })), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__panel-content" + }, children)); +} + +/* harmony default export */ var panel = (InserterPanel); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-block-types-state.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +/** + * Retrieves the block types inserter state. + * + * @param {string=} rootClientId Insertion's root client ID. + * @param {Function} onInsert function called when inserter a list of blocks. + * @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler) + */ + +const useBlockTypesState = (rootClientId, onInsert) => { + const { + categories, + collections, + items + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getInserterItems + } = select(store); + const { + getCategories, + getCollections + } = select(external_wp_blocks_namespaceObject.store); + return { + categories: getCategories(), + collections: getCollections(), + items: getInserterItems(rootClientId) + }; + }, [rootClientId]); + const onSelectItem = (0,external_wp_element_namespaceObject.useCallback)((_ref, shouldFocusBlock) => { + let { + name, + initialAttributes, + innerBlocks + } = _ref; + const insertedBlock = (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocks)); + onInsert(insertedBlock, undefined, shouldFocusBlock); + }, [onInsert]); + return [items, categories, collections, onSelectItem]; +}; + +/* harmony default export */ var use_block_types_state = (useBlockTypesState); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/index.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + + + +function InserterListbox(_ref) { + let { + children + } = _ref; + const compositeState = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)({ + shift: true, + wrap: 'horizontal' + }); + return (0,external_wp_element_namespaceObject.createElement)(context.Provider, { + value: compositeState + }, children); +} + +/* harmony default export */ var inserter_listbox = (InserterListbox); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-types-tab.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + + +const getBlockNamespace = item => item.name.split('/')[0]; + +const MAX_SUGGESTED_ITEMS = 6; +/** + * Shared reference to an empty array for cases where it is important to avoid + * returning a new array reference on every invocation and rerendering the component. + * + * @type {Array} + */ + +const block_types_tab_EMPTY_ARRAY = []; +function BlockTypesTab(_ref) { + let { + rootClientId, + onInsert, + onHover, + showMostUsedBlocks + } = _ref; + const [items, categories, collections, onSelectItem] = use_block_types_state(rootClientId, onInsert); + const suggestedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + return (0,external_lodash_namespaceObject.orderBy)(items, ['frecency'], ['desc']).slice(0, MAX_SUGGESTED_ITEMS); + }, [items]); + const uncategorizedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + return items.filter(item => !item.category); + }, [items]); + const itemsPerCategory = (0,external_wp_element_namespaceObject.useMemo)(() => { + return (0,external_lodash_namespaceObject.flow)(itemList => itemList.filter(item => item.category && item.category !== 'reusable'), itemList => (0,external_lodash_namespaceObject.groupBy)(itemList, 'category'))(items); + }, [items]); + const itemsPerCollection = (0,external_wp_element_namespaceObject.useMemo)(() => { + // Create a new Object to avoid mutating collection. + const result = { ...collections + }; + Object.keys(collections).forEach(namespace => { + result[namespace] = items.filter(item => getBlockNamespace(item) === namespace); + + if (result[namespace].length === 0) { + delete result[namespace]; + } + }); + return result; + }, [items, collections]); // Hide block preview on unmount. + + (0,external_wp_element_namespaceObject.useEffect)(() => () => onHover(null), []); + /** + * The inserter contains a big number of blocks and opening it is a costful operation. + * The rendering is the most costful part of it, in order to improve the responsiveness + * of the "opening" action, these lazy lists allow us to render the inserter category per category, + * once all the categories are rendered, we start rendering the collections and the uncategorized block types. + */ + + const currentlyRenderedCategories = (0,external_wp_compose_namespaceObject.useAsyncList)(categories); + const didRenderAllCategories = categories.length === currentlyRenderedCategories.length; // Async List requires an array + + const collectionEntries = (0,external_wp_element_namespaceObject.useMemo)(() => { + return Object.entries(collections); + }, [collections]); + const currentlyRenderedCollections = (0,external_wp_compose_namespaceObject.useAsyncList)(didRenderAllCategories ? collectionEntries : block_types_tab_EMPTY_ARRAY); + return (0,external_wp_element_namespaceObject.createElement)(inserter_listbox, null, (0,external_wp_element_namespaceObject.createElement)("div", null, showMostUsedBlocks && !!suggestedItems.length && (0,external_wp_element_namespaceObject.createElement)(panel, { + title: (0,external_wp_i18n_namespaceObject._x)('Most used', 'blocks') + }, (0,external_wp_element_namespaceObject.createElement)(block_types_list, { + items: suggestedItems, + onSelect: onSelectItem, + onHover: onHover, + label: (0,external_wp_i18n_namespaceObject._x)('Most used', 'blocks') + })), (0,external_lodash_namespaceObject.map)(currentlyRenderedCategories, category => { + const categoryItems = itemsPerCategory[category.slug]; + + if (!categoryItems || !categoryItems.length) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(panel, { + key: category.slug, + title: category.title, + icon: category.icon + }, (0,external_wp_element_namespaceObject.createElement)(block_types_list, { + items: categoryItems, + onSelect: onSelectItem, + onHover: onHover, + label: category.title + })); + }), didRenderAllCategories && uncategorizedItems.length > 0 && (0,external_wp_element_namespaceObject.createElement)(panel, { + className: "block-editor-inserter__uncategorized-blocks-panel", + title: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') + }, (0,external_wp_element_namespaceObject.createElement)(block_types_list, { + items: uncategorizedItems, + onSelect: onSelectItem, + onHover: onHover, + label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') + })), (0,external_lodash_namespaceObject.map)(currentlyRenderedCollections, _ref2 => { + let [namespace, collection] = _ref2; + const collectionItems = itemsPerCollection[namespace]; + + if (!collectionItems || !collectionItems.length) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(panel, { + key: namespace, + title: collection.title, + icon: collection.icon + }, (0,external_wp_element_namespaceObject.createElement)(block_types_list, { + items: collectionItems, + onSelect: onSelectItem, + onHover: onHover, + label: collection.title + })); + }))); +} +/* harmony default export */ var block_types_tab = (BlockTypesTab); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/pattern-panel.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +function PatternInserterPanel(_ref) { + let { + selectedCategory, + patternCategories, + onClickCategory, + openPatternExplorer + } = _ref; + const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + + const categoryOptions = () => { + const options = []; + patternCategories.map(patternCategory => { + return options.push({ + value: patternCategory.name, + label: patternCategory.label + }); + }); + return options; + }; + + const onChangeSelect = selected => { + onClickCategory(patternCategories.find(patternCategory => selected === patternCategory.name)); + }; + + const className = classnames_default()('block-editor-inserter__panel-header', 'block-editor-inserter__panel-header-patterns'); // In iOS-based mobile devices, the onBlur will fire when selecting an option + // from a Select element. To prevent closing the useDialog on iOS devices, we + // stop propagating the onBlur event if there is no relatedTarget, which means + // that the user most likely did not click on an element within the editor canvas. + + const onBlur = event => { + if (!(event !== null && event !== void 0 && event.relatedTarget)) { + event.stopPropagation(); + } + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, { + justify: "space-between", + align: "start", + gap: "4", + className: className + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, { + isBlock: true + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + className: "block-editor-inserter__panel-dropdown", + label: (0,external_wp_i18n_namespaceObject.__)('Filter patterns'), + hideLabelFromVision: true, + value: selectedCategory.name, + onChange: onChangeSelect, + onBlur: onBlur, + options: categoryOptions() + })), !isMobile && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "secondary", + className: "block-editor-inserter__patterns-explorer-expand", + label: (0,external_wp_i18n_namespaceObject.__)('Explore all patterns'), + onClick: () => openPatternExplorer() + }, (0,external_wp_i18n_namespaceObject._x)('Explore', 'Label for showing all block patterns')))); +} + +/* harmony default export */ var pattern_panel = (PatternInserterPanel); + +;// CONCATENATED MODULE: external ["wp","notices"] +var external_wp_notices_namespaceObject = window["wp"]["notices"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-state.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + +/** + * Retrieves the block patterns inserter state. + * + * @param {Function} onInsert function called when inserter a list of blocks. + * @param {string=} rootClientId Insertion's root client ID. + * + * @return {Array} Returns the patterns state. (patterns, categories, onSelect handler) + */ + +const usePatternsState = (onInsert, rootClientId) => { + const { + patternCategories, + patterns + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + __experimentalGetAllowedPatterns, + getSettings + } = select(store); + return { + patterns: __experimentalGetAllowedPatterns(rootClientId), + patternCategories: getSettings().__experimentalBlockPatternCategories + }; + }, [rootClientId]); + const { + createSuccessNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const onClickPattern = (0,external_wp_element_namespaceObject.useCallback)((pattern, blocks) => { + onInsert((0,external_lodash_namespaceObject.map)(blocks, block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)), pattern.name); + createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: block pattern title. */ + (0,external_wp_i18n_namespaceObject.__)('Block pattern "%s" inserted.'), pattern.title), { + type: 'snackbar' + }); + }, []); + return [patterns, patternCategories, onClickPattern]; +}; + +/* harmony default export */ var use_patterns_state = (usePatternsState); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-patterns-list/index.js + + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function BlockPattern(_ref) { + let { + isDraggable, + pattern, + onClick, + composite + } = _ref; + const { + blocks, + viewportWidth + } = pattern; + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockPattern); + const descriptionId = `block-editor-block-patterns-list__item-description-${instanceId}`; + return (0,external_wp_element_namespaceObject.createElement)(inserter_draggable_blocks, { + isEnabled: isDraggable, + blocks: blocks + }, _ref2 => { + let { + draggable, + onDragStart, + onDragEnd + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-patterns-list__list-item", + "aria-label": pattern.title, + "aria-describedby": pattern.description ? descriptionId : undefined, + draggable: draggable, + onDragStart: onDragStart, + onDragEnd: onDragEnd + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, _extends({ + role: "option", + as: "div" + }, composite, { + className: "block-editor-block-patterns-list__item", + onClick: () => onClick(pattern, blocks) + }), (0,external_wp_element_namespaceObject.createElement)(block_preview, { + blocks: blocks, + viewportWidth: viewportWidth + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-patterns-list__item-title" + }, pattern.title), !!pattern.description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + id: descriptionId + }, pattern.description))); + }); +} + +function BlockPatternPlaceholder() { + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-patterns-list__item is-placeholder" + }); +} + +function BlockPatternList(_ref3) { + let { + isDraggable, + blockPatterns, + shownPatterns, + onClickPattern, + orientation, + label = (0,external_wp_i18n_namespaceObject.__)('Block Patterns') + } = _ref3; + const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)({ + orientation + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, { + role: "listbox", + className: "block-editor-block-patterns-list", + "aria-label": label + }), blockPatterns.map(pattern => { + const isShown = shownPatterns.includes(pattern); + return isShown ? (0,external_wp_element_namespaceObject.createElement)(BlockPattern, { + key: pattern.name, + pattern: pattern, + onClick: onClickPattern, + isDraggable: isDraggable, + composite: composite + }) : (0,external_wp_element_namespaceObject.createElement)(BlockPatternPlaceholder, { + key: pattern.name + }); + })); +} + +/* harmony default export */ var block_patterns_list = (BlockPatternList); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/sidebar.js + + +/** + * WordPress dependencies + */ + + + +function PatternCategoriesList(_ref) { + let { + selectedCategory, + patternCategories, + onClickCategory + } = _ref; + const baseClassName = 'block-editor-block-patterns-explorer__sidebar'; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: `${baseClassName}__categories-list` + }, patternCategories.map(_ref2 => { + let { + name, + label + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: name, + label: label, + className: `${baseClassName}__categories-list__item`, + isPressed: selectedCategory === name, + onClick: () => { + onClickCategory(name); + } + }, label); + })); +} + +function PatternsExplorerSearch(_ref3) { + let { + filterValue, + setFilterValue + } = _ref3; + const baseClassName = 'block-editor-block-patterns-explorer__search'; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: baseClassName + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, { + onChange: setFilterValue, + value: filterValue, + label: (0,external_wp_i18n_namespaceObject.__)('Search for patterns'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') + })); +} + +function PatternExplorerSidebar(_ref4) { + let { + selectedCategory, + patternCategories, + onClickCategory, + filterValue, + setFilterValue + } = _ref4; + const baseClassName = 'block-editor-block-patterns-explorer__sidebar'; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: baseClassName + }, (0,external_wp_element_namespaceObject.createElement)(PatternsExplorerSearch, { + filterValue: filterValue, + setFilterValue: setFilterValue + }), !filterValue && (0,external_wp_element_namespaceObject.createElement)(PatternCategoriesList, { + selectedCategory: selectedCategory, + patternCategories: patternCategories, + onClickCategory: onClickCategory + })); +} + +/* harmony default export */ var sidebar = (PatternExplorerSidebar); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/no-results.js + + +/** + * WordPress dependencies + */ + + + +function InserterNoResults() { + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__no-results" + }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + className: "block-editor-inserter__no-results-icon", + icon: block_default + }), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No results found.'))); +} + +/* harmony default export */ var no_results = (InserterNoResults); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + +/** + * @typedef WPInserterConfig + * + * @property {string=} rootClientId If set, insertion will be into the + * block with this ID. + * @property {number=} insertionIndex If set, insertion will be into this + * explicit position. + * @property {string=} clientId If set, insertion will be after the + * block with this ID. + * @property {boolean=} isAppender Whether the inserter is an appender + * or not. + * @property {Function=} onSelect Called after insertion. + */ + +/** + * Returns the insertion point state given the inserter config. + * + * @param {WPInserterConfig} config Inserter Config. + * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle). + */ + +function useInsertionPoint(_ref) { + let { + rootClientId = '', + insertionIndex, + clientId, + isAppender, + onSelect, + shouldFocusBlock = true + } = _ref; + const { + getSelectedBlock + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + destinationRootClientId, + destinationIndex + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSelectedBlockClientId, + getBlockRootClientId, + getBlockIndex, + getBlockOrder + } = select(store); + const selectedBlockClientId = getSelectedBlockClientId(); + let _destinationRootClientId = rootClientId; + + let _destinationIndex; + + if (insertionIndex !== undefined) { + // Insert into a specific index. + _destinationIndex = insertionIndex; + } else if (clientId) { + // Insert after a specific client ID. + _destinationIndex = getBlockIndex(clientId); + } else if (!isAppender && selectedBlockClientId) { + _destinationRootClientId = getBlockRootClientId(selectedBlockClientId); + _destinationIndex = getBlockIndex(selectedBlockClientId) + 1; + } else { + // Insert at the end of the list. + _destinationIndex = getBlockOrder(_destinationRootClientId).length; + } + + return { + destinationRootClientId: _destinationRootClientId, + destinationIndex: _destinationIndex + }; + }, [rootClientId, insertionIndex, clientId, isAppender]); + const { + replaceBlocks, + insertBlocks, + showInsertionPoint, + hideInsertionPoint + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const onInsertBlocks = (0,external_wp_element_namespaceObject.useCallback)(function (blocks, meta) { + let shouldForceFocusBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const selectedBlock = getSelectedBlock(); + + if (!isAppender && selectedBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(selectedBlock)) { + replaceBlocks(selectedBlock.clientId, blocks, null, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta); + } else { + insertBlocks(blocks, destinationIndex, destinationRootClientId, true, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta); + } + + const message = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: the name of the block that has been added + (0,external_wp_i18n_namespaceObject._n)('%d block added.', '%d blocks added.', (0,external_lodash_namespaceObject.castArray)(blocks).length), (0,external_lodash_namespaceObject.castArray)(blocks).length); + (0,external_wp_a11y_namespaceObject.speak)(message); + + if (onSelect) { + onSelect(); + } + }, [isAppender, getSelectedBlock, replaceBlocks, insertBlocks, destinationRootClientId, destinationIndex, onSelect, shouldFocusBlock]); + const onToggleInsertionPoint = (0,external_wp_element_namespaceObject.useCallback)(show => { + if (show) { + showInsertionPoint(destinationRootClientId, destinationIndex); + } else { + hideInsertionPoint(); + } + }, [showInsertionPoint, hideInsertionPoint, destinationRootClientId, destinationIndex]); + return [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint]; +} + +/* harmony default export */ var use_insertion_point = (useInsertionPoint); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js +/** + * External dependencies + */ + // Default search helpers + +const defaultGetName = item => item.name || ''; + +const defaultGetTitle = item => item.title; + +const defaultGetDescription = item => item.description || ''; + +const defaultGetKeywords = item => item.keywords || []; + +const defaultGetCategory = item => item.category; + +const defaultGetCollection = () => null; +/** + * Sanitizes the search input string. + * + * @param {string} input The search input to normalize. + * + * @return {string} The normalized search input. + */ + + +function normalizeSearchInput() { + let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + // Disregard diacritics. + // Input: "média" + input = (0,external_lodash_namespaceObject.deburr)(input); // Accommodate leading slash, matching autocomplete expectations. + // Input: "/media" + + input = input.replace(/^\//, ''); // Lowercase. + // Input: "MEDIA" + + input = input.toLowerCase(); + return input; +} +/** + * Converts the search term into a list of normalized terms. + * + * @param {string} input The search term to normalize. + * + * @return {string[]} The normalized list of search terms. + */ + + +const getNormalizedSearchTerms = function () { + let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + // Extract words. + return (0,external_lodash_namespaceObject.words)(normalizeSearchInput(input)); +}; + +const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { + return (0,external_lodash_namespaceObject.differenceWith)(unmatchedTerms, getNormalizedSearchTerms(unprocessedTerms), (unmatchedTerm, unprocessedTerm) => unprocessedTerm.includes(unmatchedTerm)); +}; + +const searchBlockItems = (items, categories, collections, searchInput) => { + const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); + + if (normalizedSearchTerms.length === 0) { + return items; + } + + const config = { + getCategory: item => { + var _find; + + return (_find = (0,external_lodash_namespaceObject.find)(categories, { + slug: item.category + })) === null || _find === void 0 ? void 0 : _find.title; + }, + getCollection: item => { + var _collections$item$nam; + + return (_collections$item$nam = collections[item.name.split('/')[0]]) === null || _collections$item$nam === void 0 ? void 0 : _collections$item$nam.title; + } + }; + return searchItems(items, searchInput, config); +}; +/** + * 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 = function () { + let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + let searchInput = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); + + if (normalizedSearchTerms.length === 0) { + return items; + } + + const rankedItems = items.map(item => { + return [item, getItemSearchRank(item, searchInput, config)]; + }).filter(_ref => { + let [, rank] = _ref; + return rank > 0; + }); + rankedItems.sort((_ref2, _ref3) => { + let [, rank1] = _ref2; + let [, rank2] = _ref3; + return rank2 - rank1; + }); + return rankedItems.map(_ref4 => { + let [item] = _ref4; + return 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) { + let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + const { + getName = defaultGetName, + getTitle = defaultGetTitle, + getDescription = defaultGetDescription, + getKeywords = defaultGetKeywords, + getCategory = defaultGetCategory, + getCollection = defaultGetCollection + } = config; + const name = getName(item); + const title = getTitle(item); + const description = getDescription(item); + const keywords = getKeywords(item); + const category = getCategory(item); + const collection = getCollection(item); + const normalizedSearchInput = normalizeSearchInput(searchTerm); + const normalizedTitle = normalizeSearchInput(title); + let rank = 0; // Prefers exact matches + // Then prefers if the beginning of the title matches the search term + // name, keywords, categories, collection, variations match come later. + + if (normalizedSearchInput === normalizedTitle) { + rank += 30; + } else if (normalizedTitle.startsWith(normalizedSearchInput)) { + rank += 20; + } else { + const terms = [name, title, description, ...keywords, category, collection].join(' '); + const normalizedSearchTerms = (0,external_lodash_namespaceObject.words)(normalizedSearchInput); + const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); + + if (unmatchedTerms.length === 0) { + rank += 10; + } + } // Give a better rank to "core" namespaced items. + + + if (rank !== 0 && name.startsWith('core/')) { + rank++; + } + + return rank; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/patterns-list.js + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + + +const INITIAL_INSERTER_RESULTS = 2; + +function PatternsListHeader(_ref) { + let { + filterValue, + filteredBlockPatternsLength + } = _ref; + + if (!filterValue) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { + level: 2, + lineHeight: '48px', + className: "block-editor-block-patterns-explorer__search-results-count" + }, (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %d: number of patterns. %s: block pattern search query */ + (0,external_wp_i18n_namespaceObject._n)('%1$d pattern found for "%2$s"', '%1$d patterns found for "%2$s"', filteredBlockPatternsLength), filteredBlockPatternsLength, filterValue)); +} + +function PatternList(_ref2) { + let { + filterValue, + selectedCategory, + patternCategories + } = _ref2; + const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); + const [destinationRootClientId, onInsertBlocks] = use_insertion_point({ + shouldFocusBlock: true + }); + const [allPatterns,, onSelectBlockPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId); + const registeredPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => patternCategories.map(patternCategory => patternCategory.name), [patternCategories]); + const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!filterValue) { + return allPatterns.filter(pattern => { + var _pattern$categories, _pattern$categories2; + + return selectedCategory === 'uncategorized' ? !((_pattern$categories = pattern.categories) !== null && _pattern$categories !== void 0 && _pattern$categories.length) || pattern.categories.every(category => !registeredPatternCategories.includes(category)) : (_pattern$categories2 = pattern.categories) === null || _pattern$categories2 === void 0 ? void 0 : _pattern$categories2.includes(selectedCategory); + }); + } + + return searchItems(allPatterns, filterValue); + }, [filterValue, selectedCategory, allPatterns]); // Announce search results on change. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!filterValue) { + return; + } + + const count = filteredBlockPatterns.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); + }, [filterValue, debouncedSpeak]); + const currentShownPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredBlockPatterns, { + step: INITIAL_INSERTER_RESULTS + }); + const hasItems = !!(filteredBlockPatterns !== null && filteredBlockPatterns !== void 0 && filteredBlockPatterns.length); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-patterns-explorer__list" + }, hasItems && (0,external_wp_element_namespaceObject.createElement)(PatternsListHeader, { + filterValue: filterValue, + filteredBlockPatternsLength: filteredBlockPatterns.length + }), (0,external_wp_element_namespaceObject.createElement)(inserter_listbox, null, !hasItems && (0,external_wp_element_namespaceObject.createElement)(no_results, null), hasItems && (0,external_wp_element_namespaceObject.createElement)(block_patterns_list, { + shownPatterns: currentShownPatterns, + blockPatterns: filteredBlockPatterns, + onClickPattern: onSelectBlockPattern, + isDraggable: false + }))); +} + +/* harmony default export */ var patterns_list = (PatternList); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/explorer.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function PatternsExplorer(_ref) { + let { + initialCategory, + patternCategories + } = _ref; + const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(''); + const [selectedCategory, setSelectedCategory] = (0,external_wp_element_namespaceObject.useState)(initialCategory === null || initialCategory === void 0 ? void 0 : initialCategory.name); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-patterns-explorer" + }, (0,external_wp_element_namespaceObject.createElement)(sidebar, { + selectedCategory: selectedCategory, + patternCategories: patternCategories, + onClickCategory: setSelectedCategory, + filterValue: filterValue, + setFilterValue: setFilterValue + }), (0,external_wp_element_namespaceObject.createElement)(patterns_list, { + filterValue: filterValue, + selectedCategory: selectedCategory, + patternCategories: patternCategories + })); +} + +function PatternsExplorerModal(_ref2) { + let { + onModalClose, + ...restProps + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { + title: (0,external_wp_i18n_namespaceObject.__)('Patterns'), + closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'), + onRequestClose: onModalClose, + isFullScreen: true + }, (0,external_wp_element_namespaceObject.createElement)(PatternsExplorer, restProps)); +} + +/* harmony default export */ var explorer = (PatternsExplorerModal); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +function BlockPatternsCategory(_ref) { + let { + rootClientId, + onInsert, + selectedCategory, + populatedCategories + } = _ref; + const [allPatterns,, onClick] = use_patterns_state(onInsert, rootClientId); + const getPatternIndex = (0,external_wp_element_namespaceObject.useCallback)(pattern => { + var _pattern$categories; + + if (!((_pattern$categories = pattern.categories) !== null && _pattern$categories !== void 0 && _pattern$categories.length)) { + return Infinity; + } + + const indexedCategories = populatedCategories.reduce((accumulator, _ref2, index) => { + let { + name + } = _ref2; + accumulator[name] = index; + return accumulator; + }, {}); + return Math.min(...pattern.categories.map(cat => indexedCategories[cat] !== undefined ? indexedCategories[cat] : Infinity)); + }, [populatedCategories]); + const currentCategoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => allPatterns.filter(pattern => { + var _pattern$categories2; + + return selectedCategory.name === 'uncategorized' ? getPatternIndex(pattern) === Infinity : (_pattern$categories2 = pattern.categories) === null || _pattern$categories2 === void 0 ? void 0 : _pattern$categories2.includes(selectedCategory.name); + }), [allPatterns, selectedCategory]); // Ordering the patterns is important for the async rendering. + + const orderedPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { + return currentCategoryPatterns.sort((a, b) => { + return getPatternIndex(a) - getPatternIndex(b); + }); + }, [currentCategoryPatterns, getPatternIndex]); + const currentShownPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(orderedPatterns); + + if (!currentCategoryPatterns.length) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__panel-content" + }, (0,external_wp_element_namespaceObject.createElement)(block_patterns_list, { + shownPatterns: currentShownPatterns, + blockPatterns: currentCategoryPatterns, + onClickPattern: onClick, + label: selectedCategory.label, + orientation: "vertical", + isDraggable: true + })); +} + +function BlockPatternsTabs(_ref3) { + let { + rootClientId, + onInsert, + onClickCategory, + selectedCategory + } = _ref3; + const [showPatternsExplorer, setShowPatternsExplorer] = (0,external_wp_element_namespaceObject.useState)(false); + const [allPatterns, allCategories] = use_patterns_state(); + const hasRegisteredCategory = (0,external_wp_element_namespaceObject.useCallback)(pattern => { + if (!pattern.categories || !pattern.categories.length) { + return false; + } + + return pattern.categories.some(cat => allCategories.some(category => category.name === cat)); + }, [allCategories]); // Remove any empty categories + + const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => { + const categories = allCategories.filter(category => allPatterns.some(pattern => { + var _pattern$categories3; + + return (_pattern$categories3 = pattern.categories) === null || _pattern$categories3 === void 0 ? void 0 : _pattern$categories3.includes(category.name); + })).sort((_ref4, _ref5) => { + let { + name: currentName + } = _ref4; + let { + name: nextName + } = _ref5; + + if (![currentName, nextName].includes('featured')) { + return 0; + } + + return currentName === 'featured' ? -1 : 1; + }); + + if (allPatterns.some(pattern => !hasRegisteredCategory(pattern)) && !categories.find(category => category.name === 'uncategorized')) { + categories.push({ + name: 'uncategorized', + label: (0,external_wp_i18n_namespaceObject._x)('Uncategorized') + }); + } + + return categories; + }, [allPatterns, allCategories]); + const patternCategory = selectedCategory ? selectedCategory : populatedCategories[0]; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !showPatternsExplorer && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(pattern_panel, { + selectedCategory: patternCategory, + patternCategories: populatedCategories, + onClickCategory: onClickCategory, + openPatternExplorer: () => setShowPatternsExplorer(true) + }), (0,external_wp_element_namespaceObject.createElement)(BlockPatternsCategory, { + rootClientId: rootClientId, + onInsert: onInsert, + selectedCategory: patternCategory, + populatedCategories: populatedCategories + })), showPatternsExplorer && (0,external_wp_element_namespaceObject.createElement)(explorer, { + initialCategory: patternCategory, + patternCategories: populatedCategories, + onModalClose: () => setShowPatternsExplorer(false) + })); +} + +/* harmony default export */ var block_patterns_tab = (BlockPatternsTabs); + +;// CONCATENATED MODULE: external ["wp","url"] +var external_wp_url_namespaceObject = window["wp"]["url"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/reusable-blocks-tab.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +function ReusableBlocksList(_ref) { + let { + onHover, + onInsert, + rootClientId + } = _ref; + const [items,,, onSelectItem] = use_block_types_state(rootClientId, onInsert); + const filteredItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + return items.filter(_ref2 => { + let { + category + } = _ref2; + return category === 'reusable'; + }); + }, [items]); + + if (filteredItems.length === 0) { + return (0,external_wp_element_namespaceObject.createElement)(no_results, null); + } + + return (0,external_wp_element_namespaceObject.createElement)(panel, { + title: (0,external_wp_i18n_namespaceObject.__)('Reusable blocks') + }, (0,external_wp_element_namespaceObject.createElement)(block_types_list, { + items: filteredItems, + onSelect: onSelectItem, + onHover: onHover, + label: (0,external_wp_i18n_namespaceObject.__)('Reusable blocks') + })); +} // The unwrapped component is only exported for use by unit tests. + +/** + * List of reusable blocks shown in the "Reusable" tab of the inserter. + * + * @param {Object} props Component props. + * @param {?string} props.rootClientId Client id of block to insert into. + * @param {Function} props.onInsert Callback to run when item is inserted. + * @param {Function} props.onHover Callback to run when item is hovered. + * + * @return {WPComponent} The component. + */ + + +function ReusableBlocksTab(_ref3) { + let { + rootClientId, + onInsert, + onHover + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ReusableBlocksList, { + onHover: onHover, + onInsert: onInsert, + rootClientId: rootClientId + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__manage-reusable-blocks-container" + }, (0,external_wp_element_namespaceObject.createElement)("a", { + className: "block-editor-inserter__manage-reusable-blocks", + href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { + post_type: 'wp_block' + }) + }, (0,external_wp_i18n_namespaceObject.__)('Manage Reusable blocks')))); +} +/* harmony default export */ var reusable_blocks_tab = (ReusableBlocksTab); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-menu-extension/index.js +/** + * WordPress dependencies + */ + +const { + Fill: __unstableInserterMenuExtension, + Slot +} = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableInserterMenuExtension'); +__unstableInserterMenuExtension.Slot = Slot; +/* harmony default export */ var inserter_menu_extension = (__unstableInserterMenuExtension); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-results.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + + + + + +const search_results_INITIAL_INSERTER_RESULTS = 9; +/** + * Shared reference to an empty array for cases where it is important to avoid + * returning a new array reference on every invocation and rerendering the component. + * + * @type {Array} + */ + +const search_results_EMPTY_ARRAY = []; + +function InserterSearchResults(_ref) { + let { + filterValue, + onSelect, + onHover, + rootClientId, + clientId, + isAppender, + __experimentalInsertionIndex, + maxBlockPatterns, + maxBlockTypes, + showBlockDirectory = false, + isDraggable = true, + shouldFocusBlock = true + } = _ref; + const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); + const [destinationRootClientId, onInsertBlocks] = use_insertion_point({ + onSelect, + rootClientId, + clientId, + isAppender, + insertionIndex: __experimentalInsertionIndex, + shouldFocusBlock + }); + const [blockTypes, blockTypeCategories, blockTypeCollections, onSelectBlockType] = use_block_types_state(destinationRootClientId, onInsertBlocks); + const [patterns,, onSelectBlockPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId); + const filteredBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { + const results = searchBlockItems((0,external_lodash_namespaceObject.orderBy)(blockTypes, ['frecency'], ['desc']), blockTypeCategories, blockTypeCollections, filterValue); + return maxBlockTypes !== undefined ? results.slice(0, maxBlockTypes) : results; + }, [filterValue, blockTypes, blockTypeCategories, blockTypeCollections, maxBlockTypes]); + const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { + const results = searchItems(patterns, filterValue); + return maxBlockPatterns !== undefined ? results.slice(0, maxBlockPatterns) : results; + }, [filterValue, patterns, maxBlockPatterns]); // Announce search results on change + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!filterValue) { + return; + } + + const count = filteredBlockTypes.length + filteredBlockPatterns.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); + }, [filterValue, debouncedSpeak]); + const currentShownBlockTypes = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredBlockTypes, { + step: search_results_INITIAL_INSERTER_RESULTS + }); + const currentShownPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(currentShownBlockTypes.length === filteredBlockTypes.length ? filteredBlockPatterns : search_results_EMPTY_ARRAY); + const hasItems = !(0,external_lodash_namespaceObject.isEmpty)(filteredBlockTypes) || !(0,external_lodash_namespaceObject.isEmpty)(filteredBlockPatterns); + return (0,external_wp_element_namespaceObject.createElement)(inserter_listbox, null, !showBlockDirectory && !hasItems && (0,external_wp_element_namespaceObject.createElement)(no_results, null), !!filteredBlockTypes.length && (0,external_wp_element_namespaceObject.createElement)(panel, { + title: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('Blocks')) + }, (0,external_wp_element_namespaceObject.createElement)(block_types_list, { + items: currentShownBlockTypes, + onSelect: onSelectBlockType, + onHover: onHover, + label: (0,external_wp_i18n_namespaceObject.__)('Blocks'), + isDraggable: isDraggable + })), !!filteredBlockTypes.length && !!filteredBlockPatterns.length && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__quick-inserter-separator" + }), !!filteredBlockPatterns.length && (0,external_wp_element_namespaceObject.createElement)(panel, { + title: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('Block Patterns')) + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__quick-inserter-patterns" + }, (0,external_wp_element_namespaceObject.createElement)(block_patterns_list, { + shownPatterns: currentShownPatterns, + blockPatterns: filteredBlockPatterns, + onClickPattern: onSelectBlockPattern, + isDraggable: isDraggable + }))), showBlockDirectory && (0,external_wp_element_namespaceObject.createElement)(inserter_menu_extension.Slot, { + fillProps: { + onSelect: onSelectBlockType, + onHover, + filterValue, + hasItems, + rootClientId: destinationRootClientId + } + }, fills => { + if (fills.length) { + return fills; + } + + if (!hasItems) { + return (0,external_wp_element_namespaceObject.createElement)(no_results, null); + } + + return null; + })); +} + +/* harmony default export */ var search_results = (InserterSearchResults); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/tabs.js + + +/** + * WordPress dependencies + */ + + + +const blocksTab = { + name: 'blocks', + + /* translators: Blocks tab title in the block inserter. */ + title: (0,external_wp_i18n_namespaceObject.__)('Blocks') +}; +const patternsTab = { + name: 'patterns', + + /* translators: Patterns tab title in the block inserter. */ + title: (0,external_wp_i18n_namespaceObject.__)('Patterns') +}; +const reusableBlocksTab = { + name: 'reusable', + + /* translators: Reusable blocks tab title in the block inserter. */ + title: (0,external_wp_i18n_namespaceObject.__)('Reusable') +}; + +function InserterTabs(_ref) { + let { + children, + showPatterns = false, + showReusableBlocks = false, + onSelect + } = _ref; + const tabs = (0,external_wp_element_namespaceObject.useMemo)(() => { + const tempTabs = [blocksTab]; + + if (showPatterns) { + tempTabs.push(patternsTab); + } + + if (showReusableBlocks) { + tempTabs.push(reusableBlocksTab); + } + + return tempTabs; + }, [blocksTab, showPatterns, patternsTab, showReusableBlocks, reusableBlocksTab]); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TabPanel, { + className: "block-editor-inserter__tabs", + tabs: tabs, + onSelect: onSelect + }, children); +} + +/* harmony default export */ var tabs = (InserterTabs); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/menu.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + + + + + + + +function InserterMenu(_ref) { + let { + rootClientId, + clientId, + isAppender, + __experimentalInsertionIndex, + onSelect, + showInserterHelpPanel, + showMostUsedBlocks, + __experimentalFilterValue = '', + shouldFocusBlock = true + } = _ref; + const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(__experimentalFilterValue); + const [hoveredItem, setHoveredItem] = (0,external_wp_element_namespaceObject.useState)(null); + const [selectedPatternCategory, setSelectedPatternCategory] = (0,external_wp_element_namespaceObject.useState)(null); + const [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint] = use_insertion_point({ + rootClientId, + clientId, + isAppender, + insertionIndex: __experimentalInsertionIndex, + shouldFocusBlock + }); + const { + showPatterns, + hasReusableBlocks + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getSettings$__experi; + + const { + __experimentalGetAllowedPatterns, + getSettings + } = select(store); + return { + showPatterns: !!__experimentalGetAllowedPatterns(destinationRootClientId).length, + hasReusableBlocks: !!((_getSettings$__experi = getSettings().__experimentalReusableBlocks) !== null && _getSettings$__experi !== void 0 && _getSettings$__experi.length) + }; + }, [destinationRootClientId]); + const onInsert = (0,external_wp_element_namespaceObject.useCallback)((blocks, meta, shouldForceFocusBlock) => { + onInsertBlocks(blocks, meta, shouldForceFocusBlock); + onSelect(); + }, [onInsertBlocks, onSelect]); + const onInsertPattern = (0,external_wp_element_namespaceObject.useCallback)((blocks, patternName) => { + onInsertBlocks(blocks, { + patternName + }); + onSelect(); + }, [onInsertBlocks, onSelect]); + const onHover = (0,external_wp_element_namespaceObject.useCallback)(item => { + onToggleInsertionPoint(!!item); + setHoveredItem(item); + }, [onToggleInsertionPoint, setHoveredItem]); + const onClickPatternCategory = (0,external_wp_element_namespaceObject.useCallback)(patternCategory => { + setSelectedPatternCategory(patternCategory); + }, [setSelectedPatternCategory]); + const blocksTab = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__block-list" + }, (0,external_wp_element_namespaceObject.createElement)(block_types_tab, { + rootClientId: destinationRootClientId, + onInsert: onInsert, + onHover: onHover, + showMostUsedBlocks: showMostUsedBlocks + })), showInserterHelpPanel && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__tips" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "h2" + }, (0,external_wp_i18n_namespaceObject.__)('A tip for using the block editor')), (0,external_wp_element_namespaceObject.createElement)(tips, null))), [destinationRootClientId, onInsert, onHover, filterValue, showMostUsedBlocks, showInserterHelpPanel]); + const patternsTab = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(block_patterns_tab, { + rootClientId: destinationRootClientId, + onInsert: onInsertPattern, + onClickCategory: onClickPatternCategory, + selectedCategory: selectedPatternCategory + }), [destinationRootClientId, onInsertPattern, onClickPatternCategory, selectedPatternCategory]); + const reusableBlocksTab = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(reusable_blocks_tab, { + rootClientId: destinationRootClientId, + onInsert: onInsert, + onHover: onHover + }), [destinationRootClientId, onInsert, onHover]); + const getCurrentTab = (0,external_wp_element_namespaceObject.useCallback)(tab => { + if (tab.name === 'blocks') { + return blocksTab; + } else if (tab.name === 'patterns') { + return patternsTab; + } + + return reusableBlocksTab; + }, [blocksTab, patternsTab, reusableBlocksTab]); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__menu" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__main-area" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__content" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, { + className: "block-editor-inserter__search", + onChange: value => { + if (hoveredItem) setHoveredItem(null); + setFilterValue(value); + }, + value: filterValue, + label: (0,external_wp_i18n_namespaceObject.__)('Search for blocks and patterns'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') + }), !!filterValue && (0,external_wp_element_namespaceObject.createElement)(search_results, { + filterValue: filterValue, + onSelect: onSelect, + onHover: onHover, + rootClientId: rootClientId, + clientId: clientId, + isAppender: isAppender, + __experimentalInsertionIndex: __experimentalInsertionIndex, + showBlockDirectory: true, + shouldFocusBlock: shouldFocusBlock + }), !filterValue && (showPatterns || hasReusableBlocks) && (0,external_wp_element_namespaceObject.createElement)(tabs, { + showPatterns: showPatterns, + showReusableBlocks: hasReusableBlocks + }, getCurrentTab), !filterValue && !showPatterns && !hasReusableBlocks && blocksTab)), showInserterHelpPanel && hoveredItem && (0,external_wp_element_namespaceObject.createElement)(preview_panel, { + item: hoveredItem + })); +} + +/* harmony default export */ var menu = (InserterMenu); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/quick-inserter.js + /** * External dependencies @@ -47642,121 +22877,527 @@ var use_available_alignments = __webpack_require__("K/rC"); */ -const BLOCK_ALIGNMENTS_CONTROLS = { - none: { - icon: align_none, - title: Object(external_wp_i18n_["__"])('None') - }, - left: { - icon: position_left, - title: Object(external_wp_i18n_["__"])('Align left') - }, - center: { - icon: position_center["a" /* default */], - title: Object(external_wp_i18n_["__"])('Align center') - }, - right: { - icon: position_right, - title: Object(external_wp_i18n_["__"])('Align right') - }, - wide: { - icon: stretch_wide["a" /* default */], - title: Object(external_wp_i18n_["__"])('Wide width') - }, - full: { - icon: stretch_full_width["a" /* default */], - title: Object(external_wp_i18n_["__"])('Full width') - } -}; -const DEFAULT_CONTROL = 'none'; -const POPOVER_PROPS = { - isAlternate: true -}; -function BlockAlignmentUI(_ref) { + + + +const SEARCH_THRESHOLD = 6; +const SHOWN_BLOCK_TYPES = 6; +const SHOWN_BLOCK_PATTERNS = 2; +function QuickInserter(_ref) { let { - value, - onChange, - controls, - isToolbar, - isCollapsed = true + onSelect, + rootClientId, + clientId, + isAppender } = _ref; - const enabledControls = Object(use_available_alignments["a" /* default */])(controls); - const hasEnabledControls = !!enabledControls.length; + const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(''); + const [destinationRootClientId, onInsertBlocks] = use_insertion_point({ + onSelect, + rootClientId, + clientId, + isAppender + }); + const [blockTypes] = use_block_types_state(destinationRootClientId, onInsertBlocks); + const [patterns] = use_patterns_state(onInsertBlocks, destinationRootClientId); + const showPatterns = patterns.length && !!filterValue; + const showSearch = showPatterns && patterns.length > SEARCH_THRESHOLD || blockTypes.length > SEARCH_THRESHOLD; + const { + setInserterIsOpened, + insertionIndex + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings, + getBlockIndex, + getBlockCount + } = select(store); + const index = getBlockIndex(clientId); + return { + setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened, + insertionIndex: index === -1 ? getBlockCount() : index + }; + }, [clientId, rootClientId]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (setInserterIsOpened) { + setInserterIsOpened(false); + } + }, [setInserterIsOpened]); // When clicking Browse All select the appropriate block so as + // the insertion point can work as expected - if (!hasEnabledControls) { + const onBrowseAll = () => { + setInserterIsOpened({ + rootClientId, + insertionIndex, + filterValue + }); + }; + + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: classnames_default()('block-editor-inserter__quick-inserter', { + 'has-search': showSearch, + 'has-expand': setInserterIsOpened + }) + }, showSearch && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, { + className: "block-editor-inserter__search", + value: filterValue, + onChange: value => { + setFilterValue(value); + }, + label: (0,external_wp_i18n_namespaceObject.__)('Search for blocks and patterns'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inserter__quick-inserter-results" + }, (0,external_wp_element_namespaceObject.createElement)(search_results, { + filterValue: filterValue, + onSelect: onSelect, + rootClientId: rootClientId, + clientId: clientId, + isAppender: isAppender, + maxBlockPatterns: showPatterns ? SHOWN_BLOCK_PATTERNS : 0, + maxBlockTypes: SHOWN_BLOCK_TYPES, + isDraggable: false + })), setInserterIsOpened && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-inserter__quick-inserter-expand", + onClick: onBrowseAll, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Browse all. This will open the main inserter panel in the editor toolbar.') + }, (0,external_wp_i18n_namespaceObject.__)('Browse all'))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + + +const defaultRenderToggle = _ref => { + let { + onToggle, + disabled, + isOpen, + blockTitle, + hasSingleBlockType, + toggleProps = {} + } = _ref; + let label; + + if (hasSingleBlockType) { + label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one + (0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle); + } else { + label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button'); + } + + const { + onClick, + ...rest + } = toggleProps; // Handle both onClick functions from the toggle and the parent component + + function handleClick(event) { + if (onToggle) { + onToggle(event); + } + + if (onClick) { + onClick(event); + } + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({ + icon: library_plus, + label: label, + tooltipPosition: "bottom", + onClick: handleClick, + className: "block-editor-inserter__toggle", + "aria-haspopup": !hasSingleBlockType ? 'true' : false, + "aria-expanded": !hasSingleBlockType ? isOpen : false, + disabled: disabled + }, rest)); +}; + +class Inserter extends external_wp_element_namespaceObject.Component { + constructor() { + super(...arguments); + this.onToggle = this.onToggle.bind(this); + this.renderToggle = this.renderToggle.bind(this); + this.renderContent = this.renderContent.bind(this); + } + + onToggle(isOpen) { + const { + onToggle + } = this.props; // Surface toggle callback to parent component + + if (onToggle) { + onToggle(isOpen); + } + } + /** + * Render callback to display Dropdown toggle element. + * + * @param {Object} options + * @param {Function} options.onToggle Callback to invoke when toggle is + * pressed. + * @param {boolean} options.isOpen Whether dropdown is currently open. + * + * @return {WPElement} Dropdown toggle element. + */ + + + renderToggle(_ref2) { + let { + onToggle, + isOpen + } = _ref2; + const { + disabled, + blockTitle, + hasSingleBlockType, + directInsertBlock, + toggleProps, + hasItems, + renderToggle = defaultRenderToggle + } = this.props; + return renderToggle({ + onToggle, + isOpen, + disabled: disabled || !hasItems, + blockTitle, + hasSingleBlockType, + directInsertBlock, + toggleProps + }); + } + /** + * Render callback to display Dropdown content element. + * + * @param {Object} options + * @param {Function} options.onClose Callback to invoke when dropdown is + * closed. + * + * @return {WPElement} Dropdown content element. + */ + + + renderContent(_ref3) { + let { + onClose + } = _ref3; + const { + rootClientId, + clientId, + isAppender, + showInserterHelpPanel, + // This prop is experimental to give some time for the quick inserter to mature + // Feel free to make them stable after a few releases. + __experimentalIsQuick: isQuick + } = this.props; + + if (isQuick) { + return (0,external_wp_element_namespaceObject.createElement)(QuickInserter, { + onSelect: () => { + onClose(); + }, + rootClientId: rootClientId, + clientId: clientId, + isAppender: isAppender + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(menu, { + onSelect: () => { + onClose(); + }, + rootClientId: rootClientId, + clientId: clientId, + isAppender: isAppender, + showInserterHelpPanel: showInserterHelpPanel + }); + } + + render() { + const { + position, + hasSingleBlockType, + directInsertBlock, + insertOnlyAllowedBlock, + __experimentalIsQuick: isQuick, + onSelectOrClose + } = this.props; + + if (hasSingleBlockType || directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length) { + return this.renderToggle({ + onToggle: insertOnlyAllowedBlock + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + className: "block-editor-inserter", + contentClassName: classnames_default()('block-editor-inserter__popover', { + 'is-quick': isQuick + }), + position: position, + onToggle: this.onToggle, + expandOnMobile: true, + headerTitle: (0,external_wp_i18n_namespaceObject.__)('Add a block'), + renderToggle: this.renderToggle, + renderContent: this.renderContent, + onClose: onSelectOrClose + }); + } + +} + +/* harmony default export */ var inserter = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, _ref4) => { + let { + clientId, + rootClientId + } = _ref4; + const { + getBlockRootClientId, + hasInserterItems, + __experimentalGetAllowedBlocks, + __experimentalGetDirectInsertBlock + } = select(store); + const { + getBlockVariations + } = select(external_wp_blocks_namespaceObject.store); + rootClientId = rootClientId || getBlockRootClientId(clientId) || undefined; + + const allowedBlocks = __experimentalGetAllowedBlocks(rootClientId); + + const directInsertBlock = __experimentalGetDirectInsertBlock(rootClientId); + + const hasSingleBlockType = (0,external_lodash_namespaceObject.size)(allowedBlocks) === 1 && (0,external_lodash_namespaceObject.size)(getBlockVariations(allowedBlocks[0].name, 'inserter')) === 0; + let allowedBlockType = false; + + if (hasSingleBlockType) { + allowedBlockType = allowedBlocks[0]; + } + + return { + hasItems: hasInserterItems(rootClientId), + hasSingleBlockType, + blockTitle: allowedBlockType ? allowedBlockType.title : '', + allowedBlockType, + directInsertBlock, + rootClientId + }; +}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, _ref5) => { + let { + select + } = _ref5; + return { + insertOnlyAllowedBlock() { + const { + rootClientId, + clientId, + isAppender, + hasSingleBlockType, + allowedBlockType, + directInsertBlock, + onSelectOrClose + } = ownProps; + + if (!hasSingleBlockType && !(directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length)) { + return; + } + + function getInsertionIndex() { + const { + getBlockIndex, + getBlockSelectionEnd, + getBlockOrder, + getBlockRootClientId + } = select(store); // If the clientId is defined, we insert at the position of the block. + + if (clientId) { + return getBlockIndex(clientId); + } // If there a selected block, we insert after the selected block. + + + const end = getBlockSelectionEnd(); + + if (!isAppender && end && getBlockRootClientId(end) === rootClientId) { + return getBlockIndex(end) + 1; + } // Otherwise, we insert at the end of the current rootClientId + + + return getBlockOrder(rootClientId).length; + } + + const { + insertBlock + } = dispatch(store); + const blockToInsert = directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length ? (0,external_wp_blocks_namespaceObject.createBlock)(...directInsertBlock) : (0,external_wp_blocks_namespaceObject.createBlock)(allowedBlockType.name); + insertBlock(blockToInsert, getInsertionIndex(), rootClientId); + + if (onSelectOrClose) { + onSelectOrClose(); + } + + const message = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block that has been added + (0,external_wp_i18n_namespaceObject.__)('%s block added'), allowedBlockType.title); + (0,external_wp_a11y_namespaceObject.speak)(message); + } + + }; +}), // The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as +// a way to detect the global Inserter. +(0,external_wp_compose_namespaceObject.ifCondition)(_ref6 => { + let { + hasItems, + isAppender, + rootClientId, + clientId + } = _ref6; + return hasItems || !isAppender && !rootClientId && !clientId; +})])(Inserter)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +/** + * Zero width non-breaking space, used as padding for the paragraph when it is + * empty. + */ + +const ZWNBSP = '\ufeff'; +function DefaultBlockAppender(_ref) { + let { + isLocked, + isVisible, + onAppend, + showPrompt, + placeholder, + rootClientId + } = _ref; + + if (isLocked || !isVisible) { return null; } - function onChangeAlignment(align) { - onChange([value, 'none'].includes(align) ? undefined : align); - } + const value = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'); - const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[value]; - const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL]; - const UIComponent = isToolbar ? external_wp_components_["ToolbarGroup"] : external_wp_components_["ToolbarDropdownMenu"]; - const commonProps = { - popoverProps: POPOVER_PROPS, - icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon, - label: Object(external_wp_i18n_["__"])('Align'), - toggleProps: { - describedBy: Object(external_wp_i18n_["__"])('Change alignment') - } - }; - const extraProps = isToolbar || external_wp_element_["Platform"].isNative ? { - isCollapsed: isToolbar ? isCollapsed : undefined, - controls: enabledControls.map(_ref2 => { - let { - name: controlName - } = _ref2; - return { ...BLOCK_ALIGNMENTS_CONTROLS[controlName], - isActive: value === controlName || !value && controlName === 'none', - role: isCollapsed ? 'menuitemradio' : undefined, - onClick: () => onChangeAlignment(controlName) - }; + return (0,external_wp_element_namespaceObject.createElement)("div", { + "data-root-client-id": rootClientId || '', + className: classnames_default()('block-editor-default-block-appender', { + 'has-visible-prompt': showPrompt }) - } : { - children: _ref3 => { - let { - onClose - } = _ref3; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { - className: "block-editor-block-alignment-control__menu-group" - }, enabledControls.map(_ref4 => { - let { - name: controlName, - info - } = _ref4; - const { - icon, - title - } = BLOCK_ALIGNMENTS_CONTROLS[controlName]; // If no value is provided, mark as selected the `none` option. - - const isSelected = controlName === value || !value && controlName === 'none'; - return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { - key: controlName, - icon: icon, - iconPosition: "left", - className: classnames_default()('components-dropdown-menu__menu-item', { - 'is-active': isSelected - }), - isSelected: isSelected, - onClick: () => { - onChangeAlignment(controlName); - onClose(); - }, - role: "menuitemradio", - info: info - }, title); - }))); - } - }; - return Object(external_wp_element_["createElement"])(UIComponent, Object(esm_extends["a" /* default */])({}, commonProps, extraProps)); + }, (0,external_wp_element_namespaceObject.createElement)("p", { + tabIndex: "0" // Only necessary for `useCanvasClickRedirect` to consider it + // as a target. Ideally it should consider any tabbable target, + // but the inserter is rendered in place while it should be + // rendered in a popover, just like it does for an empty + // paragraph block. + , + contentEditable: true, + suppressContentEditableWarning: true // We want this element to be styled as a paragraph by themes. + // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role + , + role: "button", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Add block') // A wrapping container for this one already has the wp-block className. + , + className: "block-editor-default-block-appender__content", + onFocus: onAppend + }, showPrompt ? value : ZWNBSP), (0,external_wp_element_namespaceObject.createElement)(inserter, { + rootClientId: rootClientId, + position: "bottom right", + isAppender: true, + __experimentalIsQuick: true + })); } +/* harmony default export */ var default_block_appender = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => { + const { + getBlockCount, + getBlockName, + isBlockValid, + getSettings, + getTemplateLock + } = select(store); + const isEmpty = !getBlockCount(ownProps.rootClientId); + const isLastBlockDefault = getBlockName(ownProps.lastBlockClientId) === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); + const isLastBlockValid = isBlockValid(ownProps.lastBlockClientId); + const { + bodyPlaceholder + } = getSettings(); + return { + isVisible: isEmpty || !isLastBlockDefault || !isLastBlockValid, + showPrompt: isEmpty, + isLocked: !!getTemplateLock(ownProps.rootClientId), + placeholder: bodyPlaceholder + }; +}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps) => { + const { + insertDefaultBlock, + startTyping + } = dispatch(store); + return { + onAppend() { + const { + rootClientId + } = ownProps; + insertDefaultBlock(undefined, rootClientId); + startTyping(); + } + + }; +}))(DefaultBlockAppender)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + -/* harmony default export */ var ui = (BlockAlignmentUI); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js @@ -47764,114 +23405,757 @@ function BlockAlignmentUI(_ref) { * Internal dependencies */ -function BlockAlignmentControl(props) { - return Object(external_wp_element_["createElement"])(ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: false - })); -} -function BlockAlignmentToolbar(props) { - return Object(external_wp_element_["createElement"])(ui, Object(esm_extends["a" /* default */])({}, props, { - isToolbar: true - })); + + +function ButtonBlockAppender(_ref, ref) { + let { + rootClientId, + className, + onFocus, + tabIndex + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(inserter, { + position: "bottom center", + rootClientId: rootClientId, + __experimentalIsQuick: true, + renderToggle: _ref2 => { + let { + onToggle, + disabled, + isOpen, + blockTitle, + hasSingleBlockType + } = _ref2; + let label; + + if (hasSingleBlockType) { + label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one + (0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle); + } else { + label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button'); + } + + const isToggleButton = !hasSingleBlockType; + let inserterButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + ref: ref, + onFocus: onFocus, + tabIndex: tabIndex, + className: classnames_default()(className, 'block-editor-button-block-appender'), + onClick: onToggle, + "aria-haspopup": isToggleButton ? 'true' : undefined, + "aria-expanded": isToggleButton ? isOpen : undefined, + disabled: disabled, + label: label + }, !hasSingleBlockType && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "span" + }, label), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: library_plus + })); + + if (isToggleButton || hasSingleBlockType) { + inserterButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, { + text: label + }, inserterButton); + } + + return inserterButton; + }, + isAppender: true + }); } +/** + * Use `ButtonBlockAppender` instead. + * + * @deprecated + */ -/***/ }), +const ButtonBlockerAppender = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { + external_wp_deprecated_default()(`wp.blockEditor.ButtonBlockerAppender`, { + alternative: 'wp.blockEditor.ButtonBlockAppender' + }); + return ButtonBlockAppender(props, ref); +}); +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md + */ -/***/ "w8sn": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* harmony default export */ var button_block_appender = ((0,external_wp_element_namespaceObject.forwardRef)(ButtonBlockAppender)); -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return defaultLayout; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LayoutProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return useLayout; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LayoutStyle; }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _layouts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PPMp"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js +/** + * External dependencies + */ + /** * WordPress dependencies */ + + /** * Internal dependencies */ -const defaultLayout = { - type: 'default' -}; -const Layout = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createContext"])(defaultLayout); -/** - * Allows to define the layout. - */ -const LayoutProvider = Layout.Provider; -/** - * React hook used to retrieve the layout config. - */ -function useLayout() { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(Layout); -} -function LayoutStyle(_ref) { + +function BlockListAppender(_ref) { let { - layout = {}, - ...props + blockClientIds, + rootClientId, + canInsertDefaultBlock, + isLocked, + renderAppender: CustomAppender, + className, + selectedBlockClientId, + tagName: TagName = 'div' } = _ref; - const layoutType = Object(_layouts__WEBPACK_IMPORTED_MODULE_2__[/* getLayoutType */ "a"])(layout.type); - if (layoutType) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(layoutType.save, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - layout: layout - }, props)); + if (isLocked || CustomAppender === false) { + return null; } + let appender; + + if (CustomAppender) { + // Prefer custom render prop if provided. + appender = (0,external_wp_element_namespaceObject.createElement)(CustomAppender, null); + } else { + const isDocumentAppender = !rootClientId; + const isParentSelected = selectedBlockClientId === rootClientId; + const isAnotherDefaultAppenderAlreadyDisplayed = selectedBlockClientId && !blockClientIds.includes(selectedBlockClientId); + + if (!isDocumentAppender && !isParentSelected && (!selectedBlockClientId || isAnotherDefaultAppenderAlreadyDisplayed)) { + return null; + } + + if (canInsertDefaultBlock) { + // Render the default block appender when renderAppender has not been + // provided and the context supports use of the default appender. + appender = (0,external_wp_element_namespaceObject.createElement)(default_block_appender, { + rootClientId: rootClientId, + lastBlockClientId: (0,external_lodash_namespaceObject.last)(blockClientIds) + }); + } else { + // Fallback in the case no renderAppender has been provided and the + // default block can't be inserted. + appender = (0,external_wp_element_namespaceObject.createElement)(button_block_appender, { + rootClientId: rootClientId, + className: "block-list-appender__toggle" + }); + } + } + + return (0,external_wp_element_namespaceObject.createElement)(TagName // A `tabIndex` is used on the wrapping `div` element in order to + // force a focus event to occur when an appender `button` element + // is clicked. In some browsers (Firefox, Safari), button clicks do + // not emit a focus event, which could cause this event to propagate + // unexpectedly. The `tabIndex` ensures that the interaction is + // captured as a focus, without also adding an extra tab stop. + // + // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus + , { + tabIndex: -1, + className: classnames_default()('block-list-appender wp-block', className) // The appender exists to let you add the first Paragraph before + // any is inserted. To that end, this appender should visually be + // presented as a block. That means theme CSS should style it as if + // it were an empty paragraph block. That means a `wp-block` class to + // ensure the width is correct, and a [data-block] attribute to ensure + // the correct margin is applied, especially for classic themes which + // have commonly targeted that attribute for margins. + , + "data-block": true + }, appender); +} + +/* harmony default export */ var block_list_appender = ((0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => { + let { + rootClientId + } = _ref2; + const { + getBlockOrder, + canInsertBlockType, + getTemplateLock, + getSelectedBlockClientId + } = select(store); + return { + isLocked: !!getTemplateLock(rootClientId), + blockClientIds: getBlockOrder(rootClientId), + canInsertDefaultBlock: canInsertBlockType((0,external_wp_blocks_namespaceObject.getDefaultBlockName)(), rootClientId), + selectedBlockClientId: getSelectedBlockClientId() + }; +})(BlockListAppender)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-popover-scroll.js +/** + * WordPress dependencies + */ + +/** + * Allow scrolling "through" popovers over the canvas. This is only called for + * as long as the pointer is over a popover. Do not use React events because it + * will bubble through portals. + * + * @param {Object} scrollableRef + */ + +function usePopoverScroll(scrollableRef) { + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + if (!scrollableRef) { + return; + } + + function onWheel(event) { + const { + deltaX, + deltaY + } = event; + scrollableRef.current.scrollBy(deltaX, deltaY); + } // Tell the browser that we do not call event.preventDefault + // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners + + + const options = { + passive: true + }; + node.addEventListener('wheel', onWheel, options); + return () => { + node.removeEventListener('wheel', onWheel, options); + }; + }, [scrollableRef]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/insertion-point.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + +const InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)(); + +function InsertionPointPopover(_ref) { + let { + __unstablePopoverSlot, + __unstableContentRef + } = _ref; + const { + selectBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const openRef = (0,external_wp_element_namespaceObject.useContext)(InsertionPointOpenRef); + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const { + orientation, + previousClientId, + nextClientId, + rootClientId, + isInserterShown + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getBlockListSettings; + + const { + getBlockOrder, + getBlockListSettings, + getBlockInsertionPoint, + isBlockBeingDragged, + getPreviousBlockClientId, + getNextBlockClientId + } = select(store); + const insertionPoint = getBlockInsertionPoint(); + const order = getBlockOrder(insertionPoint.rootClientId); + + if (!order.length) { + return {}; + } + + let _previousClientId = order[insertionPoint.index - 1]; + let _nextClientId = order[insertionPoint.index]; + + while (isBlockBeingDragged(_previousClientId)) { + _previousClientId = getPreviousBlockClientId(_previousClientId); + } + + while (isBlockBeingDragged(_nextClientId)) { + _nextClientId = getNextBlockClientId(_nextClientId); + } + + return { + previousClientId: _previousClientId, + nextClientId: _nextClientId, + orientation: ((_getBlockListSettings = getBlockListSettings(insertionPoint.rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical', + rootClientId: insertionPoint.rootClientId, + isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter + }; + }, []); + const previousElement = useBlockElement(previousClientId); + const nextElement = useBlockElement(nextClientId); + const isVertical = orientation === 'vertical'; + const style = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!previousElement && !nextElement) { + return {}; + } + + const previousRect = previousElement ? previousElement.getBoundingClientRect() : null; + const nextRect = nextElement ? nextElement.getBoundingClientRect() : null; + + if (isVertical) { + return { + width: previousElement ? previousElement.offsetWidth : nextElement.offsetWidth, + height: nextRect && previousRect ? nextRect.top - previousRect.bottom : 0 + }; + } + + let width = 0; + + if (previousRect && nextRect) { + width = (0,external_wp_i18n_namespaceObject.isRTL)() ? previousRect.left - nextRect.right : nextRect.left - previousRect.right; + } + + return { + width, + height: previousElement ? previousElement.offsetHeight : nextElement.offsetHeight + }; + }, [previousElement, nextElement]); + const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => { + if (!previousElement && !nextElement) { + return {}; + } + + const { + ownerDocument + } = previousElement || nextElement; + const previousRect = previousElement ? previousElement.getBoundingClientRect() : null; + const nextRect = nextElement ? nextElement.getBoundingClientRect() : null; + + if (isVertical) { + if ((0,external_wp_i18n_namespaceObject.isRTL)()) { + return { + top: previousRect ? previousRect.bottom : nextRect.top, + left: previousRect ? previousRect.right : nextRect.right, + right: previousRect ? previousRect.left : nextRect.left, + bottom: nextRect ? nextRect.top : previousRect.bottom, + ownerDocument + }; + } + + return { + top: previousRect ? previousRect.bottom : nextRect.top, + left: previousRect ? previousRect.left : nextRect.left, + right: previousRect ? previousRect.right : nextRect.right, + bottom: nextRect ? nextRect.top : previousRect.bottom, + ownerDocument + }; + } + + if ((0,external_wp_i18n_namespaceObject.isRTL)()) { + return { + top: previousRect ? previousRect.top : nextRect.top, + left: previousRect ? previousRect.left : nextRect.right, + right: nextRect ? nextRect.right : previousRect.left, + bottom: previousRect ? previousRect.bottom : nextRect.bottom, + ownerDocument + }; + } + + return { + top: previousRect ? previousRect.top : nextRect.top, + left: previousRect ? previousRect.right : nextRect.left, + right: nextRect ? nextRect.left : previousRect.right, + bottom: previousRect ? previousRect.bottom : nextRect.bottom, + ownerDocument + }; + }, [previousElement, nextElement]); + const popoverScrollRef = usePopoverScroll(__unstableContentRef); + const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); + const className = classnames_default()('block-editor-block-list__insertion-point', 'is-' + orientation); + + function onClick(event) { + if (event.target === ref.current && nextClientId) { + selectBlock(nextClientId, -1); + } + } + + function onFocus(event) { + // Only handle click on the wrapper specifically, and not an event + // bubbled from the inserter itself. + if (event.target !== ref.current) { + openRef.current = true; + } + } // Only show the in-between inserter between blocks, so when there's a + // previous and a next element. + + + const showInsertionPointInserter = previousElement && nextElement && isInserterShown; // Define animation variants for the line element. + + const horizontalLine = { + start: { + width: 0, + top: '50%', + bottom: '50%', + x: 0 + }, + rest: { + width: 4, + top: 0, + bottom: 0, + x: -2 + }, + hover: { + width: 4, + top: 0, + bottom: 0, + x: -2 + } + }; + const verticalLine = { + start: { + height: 0, + left: '50%', + right: '50%', + y: 0 + }, + rest: { + height: 4, + left: 0, + right: 0, + y: -2 + }, + hover: { + height: 4, + left: 0, + right: 0, + y: -2 + } + }; + const lineVariants = { + // Initial position starts from the center and invisible. + start: { ...(!isVertical ? horizontalLine.start : verticalLine.start), + opacity: 0 + }, + // The line expands to fill the container. If the inserter is visible it + // is delayed so it appears orchestrated. + rest: { ...(!isVertical ? horizontalLine.rest : verticalLine.rest), + opacity: 1, + borderRadius: '2px', + transition: { + delay: showInsertionPointInserter ? 0.4 : 0 + } + }, + hover: { ...(!isVertical ? horizontalLine.hover : verticalLine.hover), + opacity: 1, + borderRadius: '2px', + transition: { + delay: 0.4 + } + } + }; + const inserterVariants = { + start: { + scale: disableMotion ? 1 : 0 + }, + rest: { + scale: 1, + transition: { + delay: 0.2 + } + } + }; + /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ + // While ideally it would be enough to capture the + // bubbling focus event from the Inserter, due to the + // characteristics of click focusing of `button`s in + // Firefox and Safari, it is not reliable. + // + // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { + ref: popoverScrollRef, + noArrow: true, + animate: false, + getAnchorRect: getAnchorRect, + focusOnMount: false, + className: "block-editor-block-list__insertion-point-popover" // Render in the old slot if needed for backward compatibility, + // otherwise render in place (not in the the default popover slot). + , + __unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes + // This makes sure the popover doesn't animate from its previous position. + , + key: nextClientId + '--' + rootClientId + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { + layout: !disableMotion, + initial: disableMotion ? 'rest' : 'start', + animate: "rest", + whileHover: "hover", + whileTap: "pressed", + exit: "start", + ref: ref, + tabIndex: -1, + onClick: onClick, + onFocus: onFocus, + className: classnames_default()(className, { + 'is-with-inserter': showInsertionPointInserter + }), + style: style + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { + variants: lineVariants, + className: "block-editor-block-list__insertion-point-indicator" + }), showInsertionPointInserter && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { + variants: inserterVariants, + className: classnames_default()('block-editor-block-list__insertion-point-inserter') + }, (0,external_wp_element_namespaceObject.createElement)(inserter, { + position: "bottom center", + clientId: nextClientId, + rootClientId: rootClientId, + __experimentalIsQuick: true, + onToggle: isOpen => { + openRef.current = isOpen; + }, + onSelectOrClose: () => { + openRef.current = false; + } + })))); + /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ +} + +function InsertionPoint(_ref2) { + let { + children, + __unstablePopoverSlot, + __unstableContentRef + } = _ref2; + const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(store).isBlockInsertionPointVisible(); + }, []); + return (0,external_wp_element_namespaceObject.createElement)(InsertionPointOpenRef.Provider, { + value: (0,external_wp_element_namespaceObject.useRef)(false) + }, isVisible && (0,external_wp_element_namespaceObject.createElement)(InsertionPointPopover, { + __unstablePopoverSlot: __unstablePopoverSlot, + __unstableContentRef: __unstableContentRef + }), children); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-in-between-inserter.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function useInBetweenInserter() { + const openRef = (0,external_wp_element_namespaceObject.useContext)(InsertionPointOpenRef); + const hasReducedUI = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().hasReducedUI, []); + const { + getBlockListSettings, + getBlockRootClientId, + getBlockIndex, + isBlockInsertionPointVisible, + isMultiSelecting, + getSelectedBlockClientIds, + getTemplateLock + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + showInsertionPoint, + hideInsertionPoint + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + if (hasReducedUI) { + return; + } + + function onMouseMove(event) { + var _getBlockListSettings, _element$parentElemen; + + if (openRef.current) { + return; + } + + if (isMultiSelecting()) { + return; + } + + if (!event.target.classList.contains('block-editor-block-list__layout')) { + if (isBlockInsertionPointVisible()) { + hideInsertionPoint(); + } + + return; + } + + let rootClientId; + + if (!event.target.classList.contains('is-root-container')) { + const blockElement = !!event.target.getAttribute('data-block') ? event.target : event.target.closest('[data-block]'); + rootClientId = blockElement.getAttribute('data-block'); + } // Don't set the insertion point if the template is locked. + + + if (getTemplateLock(rootClientId)) { + return; + } + + const orientation = ((_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical'; + const rect = event.target.getBoundingClientRect(); + const offsetTop = event.clientY - rect.top; + const offsetLeft = event.clientX - rect.left; + const children = Array.from(event.target.children); + let element = children.find(blockEl => { + return blockEl.classList.contains('wp-block') && orientation === 'vertical' && blockEl.offsetTop > offsetTop || blockEl.classList.contains('wp-block') && orientation === 'horizontal' && blockEl.offsetLeft > offsetLeft; + }); + + if (!element) { + return; + } // The block may be in an alignment wrapper, so check the first direct + // child if the element has no ID. + + + if (!element.id) { + element = element.firstElementChild; + + if (!element) { + return; + } + } // Don't show the insertion point if a parent block has an "overlay" + // See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337 + + + const parentOverlay = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.closest('.block-editor-block-content-overlay.overlay-active'); + + if (parentOverlay) { + return; + } + + const clientId = element.id.slice('block-'.length); + + if (!clientId) { + return; + } // Don't show the inserter when hovering above (conflicts with + // block toolbar) or inside selected block(s). + + + if (getSelectedBlockClientIds().includes(clientId)) { + return; + } + + const elementRect = element.getBoundingClientRect(); + + if (orientation === 'horizontal' && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === 'vertical' && (event.clientX > elementRect.right || event.clientX < elementRect.left)) { + if (isBlockInsertionPointVisible()) { + hideInsertionPoint(); + } + + return; + } + + const index = getBlockIndex(clientId); // Don't show the in-between inserter before the first block in + // the list (preserves the original behaviour). + + if (index === 0) { + if (isBlockInsertionPointVisible()) { + hideInsertionPoint(); + } + + return; + } + + showInsertionPoint(rootClientId, index, { + __unstableWithInserter: true + }); + } + + node.addEventListener('mousemove', onMouseMove); + return () => { + node.removeEventListener('mousemove', onMouseMove); + }; + }, [openRef, getBlockListSettings, getBlockRootClientId, getBlockIndex, isBlockInsertionPointVisible, isMultiSelecting, showInsertionPoint, hideInsertionPoint, getSelectedBlockClientIds]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/pre-parse-patterns.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const requestIdleCallback = (() => { + if (typeof window === 'undefined') { + return callback => { + setTimeout(() => callback(Date.now()), 0); + }; + } + + return window.requestIdleCallback || window.requestAnimationFrame; +})(); + +const cancelIdleCallback = (() => { + if (typeof window === 'undefined') { + return clearTimeout; + } + + return window.cancelIdleCallback || window.cancelAnimationFrame; +})(); + +function usePreParsePatterns() { + const patterns = (0,external_wp_data_namespaceObject.useSelect)(_select => _select(store).getSettings().__experimentalBlockPatterns, []); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!(patterns !== null && patterns !== void 0 && patterns.length)) { + return; + } + + let handle; + let index = -1; + + const callback = () => { + index++; + + if (index >= patterns.length) { + return; + } + + (0,external_wp_data_namespaceObject.select)(store).__experimentalGetParsedPattern(patterns[index].name); + + handle = requestIdleCallback(callback); + }; + + handle = requestIdleCallback(callback); + return () => cancelIdleCallback(handle); + }, [patterns]); return null; } - -/***/ }), - -/***/ "w95h": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" -})); -/* harmony default export */ __webpack_exports__["a"] = (close); - - -/***/ }), - -/***/ "wC17": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBlockDisplayInformation; }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("HSyU"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BhPs"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-display-information/index.js /** * WordPress dependencies */ @@ -47910,16 +24194,16 @@ const close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElem */ function useBlockDisplayInformation(clientId) { - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(select => { + return (0,external_wp_data_namespaceObject.useSelect)(select => { if (!clientId) return null; const { getBlockName, getBlockAttributes - } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]); + } = select(store); const { getBlockType, getActiveBlockVariation - } = select(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["store"]); + } = select(external_wp_blocks_namespaceObject.store); const blockName = getBlockName(clientId); const blockType = getBlockType(blockName); if (!blockType) return null; @@ -47940,67 +24224,11 @@ function useBlockDisplayInformation(clientId) { }, [clientId]); } - -/***/ }), - -/***/ "wJiJ": -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__("1K8p"); - - -/***/ }), - -/***/ "weEX": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ LineHeightControl; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/utils.js -const BASE_DEFAULT_VALUE = 1.5; -const STEP = 0.1; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js /** - * There are varying value types within LineHeightControl: - * - * {undefined} Initial value. No changes from the user. - * {string} Input value. Value consumed/outputted by the input. Empty would be ''. - * {number} Block attribute type. Input value needs to be converted for attribute setting. - * - * Note: If the value is undefined, the input requires it to be an empty string ('') - * in order to be considered "controlled" by props (rather than internal state). + * External dependencies */ -const RESET_VALUE = ''; -/** - * Determines if the lineHeight attribute has been properly defined. - * - * @param {any} lineHeight The value to check. - * - * @return {boolean} Whether the lineHeight attribute is valid. - */ - -function isLineHeightDefined(lineHeight) { - return lineHeight !== undefined && lineHeight !== RESET_VALUE; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js - - /** * WordPress dependencies */ @@ -48012,299 +24240,271 @@ function isLineHeightDefined(lineHeight) { */ -function LineHeightControl(_ref) { - let { - value: lineHeight, - onChange - } = _ref; - const isDefined = isLineHeightDefined(lineHeight); - const handleOnKeyDown = event => { +/** + * Renders the block's configured title as a string, or empty if the title + * cannot be determined. + * + * @example + * + * ```jsx + * + * ``` + * + * @param {Object} props + * @param {string} props.clientId Client ID of block. + * + * @return {?string} Block title. + */ + +function BlockTitle(_ref) { + let { + clientId + } = _ref; + const { + attributes, + name, + reusableBlockTitle + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + if (!clientId) { + return {}; + } + const { - keyCode - } = event; + getBlockName, + getBlockAttributes, + __experimentalGetReusableBlockTitle + } = select(store); + const blockName = getBlockName(clientId); - if (keyCode === external_wp_keycodes_["ZERO"] && !isDefined) { - /** - * Prevents the onChange callback from firing, which prevents - * the logic from assuming the change was triggered from - * an input arrow CLICK. - */ - event.preventDefault(); - onChange('0'); - } - }; - - const handleOnChange = nextValue => { - // Set the next value without modification if lineHeight has been defined - if (isDefined) { - onChange(nextValue); - return; - } // Otherwise... - - /** - * The following logic handles the initial up/down arrow CLICK of the - * input element. This is so that the next values (from an undefined value state) - * are more better suited for line-height rendering. - */ - - - let adjustedNextValue = nextValue; - - switch (nextValue) { - case `${STEP}`: - // Increment by step value - adjustedNextValue = BASE_DEFAULT_VALUE + STEP; - break; - - case '0': - // Decrement by step value - adjustedNextValue = BASE_DEFAULT_VALUE - STEP; - break; + if (!blockName) { + return {}; } - onChange(adjustedNextValue); - }; + const isReusable = (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(blockName)); + return { + attributes: getBlockAttributes(clientId), + name: blockName, + reusableBlockTitle: isReusable && __experimentalGetReusableBlockTitle(getBlockAttributes(clientId).ref) + }; + }, [clientId]); + const blockInformation = useBlockDisplayInformation(clientId); + if (!name || !blockInformation) return null; + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); + const blockLabel = blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : null; + const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current + // label context. If the label is defined we prioritize it over possible + // possible block variation title match. - const value = isDefined ? lineHeight : RESET_VALUE; - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-line-height-control" - }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - autoComplete: "off", - onKeyDown: handleOnKeyDown, - onChange: handleOnChange, - label: Object(external_wp_i18n_["__"])('Line height'), - placeholder: BASE_DEFAULT_VALUE, - step: STEP, - type: "number", - value: value, - min: 0 - })); + if (label && label !== blockType.title) { + return (0,external_lodash_namespaceObject.truncate)(label, { + length: 35 + }); + } + + return blockInformation.title; } - -/***/ }), - -/***/ "wiT/": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("GOly"); - - +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js /** * WordPress dependencies */ + +const SCROLL_INACTIVE_DISTANCE_PX = 50; +const SCROLL_INTERVAL_MS = 25; +const PIXELS_PER_SECOND_PER_PERCENTAGE = 1000; +const VELOCITY_MULTIPLIER = PIXELS_PER_SECOND_PER_PERCENTAGE * (SCROLL_INTERVAL_MS / 1000); /** - * Internal dependencies + * React hook that scrolls the scroll container when a block is being dragged. + * + * @return {Function[]} `startScrolling`, `scrollOnDragOver`, `stopScrolling` + * functions to be called in `onDragStart`, `onDragOver` + * and `onDragEnd` events respectively. */ +function useScrollWhenDragging() { + const dragStartY = (0,external_wp_element_namespaceObject.useRef)(null); + const velocityY = (0,external_wp_element_namespaceObject.useRef)(null); + const scrollParentY = (0,external_wp_element_namespaceObject.useRef)(null); + const scrollEditorInterval = (0,external_wp_element_namespaceObject.useRef)(null); // Clear interval when unmounting. + (0,external_wp_element_namespaceObject.useEffect)(() => () => { + if (scrollEditorInterval.current) { + clearInterval(scrollEditorInterval.current); + scrollEditorInterval.current = null; + } + }, []); + const startScrolling = (0,external_wp_element_namespaceObject.useCallback)(event => { + dragStartY.current = event.clientY; // Find nearest parent(s) to scroll. + scrollParentY.current = (0,external_wp_dom_namespaceObject.getScrollContainer)(event.target); + scrollEditorInterval.current = setInterval(() => { + if (scrollParentY.current && velocityY.current) { + const newTop = scrollParentY.current.scrollTop + velocityY.current; // Setting `behavior: 'smooth'` as a scroll property seems to hurt performance. + // Better to use a small scroll interval. - - -function InserterListbox(_ref) { - let { - children - } = _ref; - const compositeState = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["__unstableUseCompositeState"])({ - shift: true, - wrap: 'horizontal' - }); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_context__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].Provider, { - value: compositeState - }, children); -} - -/* harmony default export */ __webpack_exports__["a"] = (InserterListbox); - - -/***/ }), - -/***/ "wx14": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); -function _extends() { - _extends = Object.assign || 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]; - } + scrollParentY.current.scroll({ + top: newTop + }); } + }, SCROLL_INTERVAL_MS); + }, []); + const scrollOnDragOver = (0,external_wp_element_namespaceObject.useCallback)(event => { + if (!scrollParentY.current) { + return; } - return target; + const scrollParentHeight = scrollParentY.current.offsetHeight; + const offsetDragStartPosition = dragStartY.current - scrollParentY.current.offsetTop; + const offsetDragPosition = event.clientY - scrollParentY.current.offsetTop; + + if (event.clientY > offsetDragStartPosition) { + // User is dragging downwards. + const moveableDistance = Math.max(scrollParentHeight - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); + const dragDistance = Math.max(offsetDragPosition - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); + const distancePercentage = dragDistance / moveableDistance; + velocityY.current = VELOCITY_MULTIPLIER * distancePercentage; + } else if (event.clientY < offsetDragStartPosition) { + // User is dragging upwards. + const moveableDistance = Math.max(offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); + const dragDistance = Math.max(offsetDragStartPosition - offsetDragPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); + const distancePercentage = dragDistance / moveableDistance; + velocityY.current = -VELOCITY_MULTIPLIER * distancePercentage; + } else { + velocityY.current = 0; + } + }, []); + + const stopScrolling = () => { + dragStartY.current = null; + scrollParentY.current = null; + + if (scrollEditorInterval.current) { + clearInterval(scrollEditorInterval.current); + scrollEditorInterval.current = null; + } }; - return _extends.apply(this, arguments); + return [startScrolling, scrollOnDragOver, stopScrolling]; } -/***/ }), - -/***/ "wzfx": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js /** * WordPress dependencies */ -const stack = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z" -})); -/* harmony default export */ __webpack_exports__["a"] = (stack); -/***/ }), - -/***/ "xBDm": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LetterSpacingControl; }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _components_use_setting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("v5LD"); - - -/** - * WordPress dependencies - */ - /** * Internal dependencies */ -/** - * Control for letter-spacing. - * - * @param {Object} props Component props. - * @param {string} props.value Currently selected letter-spacing. - * @param {Function} props.onChange Handles change in letter-spacing selection. - * @param {boolean} props.__unstableInputWidth Input width to pass through to inner UnitControl. - * - * @return {WPElement} Letter-spacing control. - */ -function LetterSpacingControl(_ref) { + + +const BlockDraggable = _ref => { let { - value, - onChange, - __unstableInputWidth = '60px' + children, + clientIds, + cloneClassname, + onDragStart, + onDragEnd } = _ref; - const units = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["__experimentalUseCustomUnits"])({ - availableUnits: Object(_components_use_setting__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])('spacing.units') || ['px', 'em', 'rem'], - defaultValues: { - px: '2', - em: '.2', - rem: '.2' - } + const { + srcRootClientId, + isDraggable, + icon + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getBlockType; + + const { + getBlockRootClientId, + getTemplateLock, + getBlockName + } = select(store); + const rootClientId = getBlockRootClientId(clientIds[0]); + const templateLock = rootClientId ? getTemplateLock(rootClientId) : null; + const blockName = getBlockName(clientIds[0]); + return { + srcRootClientId: rootClientId, + isDraggable: 'all' !== templateLock, + icon: (_getBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon + }; + }, [clientIds]); + const isDragging = (0,external_wp_element_namespaceObject.useRef)(false); + const [startScrolling, scrollOnDragOver, stopScrolling] = useScrollWhenDragging(); + const { + startDraggingBlocks, + stopDraggingBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Stop dragging blocks if the block draggable is unmounted + + (0,external_wp_element_namespaceObject.useEffect)(() => { + return () => { + if (isDragging.current) { + stopDraggingBlocks(); + } + }; + }, []); + + if (!isDraggable) { + return children({ + isDraggable: false + }); + } + + const transferData = { + type: 'block', + srcClientIds: clientIds, + srcRootClientId + }; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Draggable, { + cloneClassname: cloneClassname, + __experimentalTransferDataType: "wp-blocks", + transferData: transferData, + onDragStart: event => { + startDraggingBlocks(clientIds); + isDragging.current = true; + startScrolling(event); + + if (onDragStart) { + onDragStart(); + } + }, + onDragOver: scrollOnDragOver, + onDragEnd: () => { + stopDraggingBlocks(); + isDragging.current = false; + stopScrolling(); + + if (onDragEnd) { + onDragEnd(); + } + }, + __experimentalDragComponent: (0,external_wp_element_namespaceObject.createElement)(BlockDraggableChip, { + count: clientIds.length, + icon: icon + }) + }, _ref2 => { + let { + onDraggableStart, + onDraggableEnd + } = _ref2; + return children({ + draggable: true, + onDragStart: onDraggableStart, + onDragEnd: onDraggableEnd + }); }); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["__experimentalUnitControl"], { - label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Letter-spacing'), - value: value, - __unstableInputWidth: __unstableInputWidth, - units: units, - onChange: onChange - }); -} +}; +/* harmony default export */ var block_draggable = (BlockDraggable); -/***/ }), - -/***/ "xCFn": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ WrappedBlockPopover; }); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","keyboardShortcuts"] -var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","dom"] -var external_wp_dom_ = __webpack_require__("1CF3"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/drag-handle.js -var drag_handle = __webpack_require__("xN+R"); - -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); - -// EXTERNAL MODULE: external ["wp","a11y"] -var external_wp_a11y_ = __webpack_require__("gdqT"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js -var block_title = __webpack_require__("f8JO"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js -var block_icon = __webpack_require__("7SSY"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js + 1 modules -var block_draggable = __webpack_require__("ZAjO"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-display-information/index.js -var use_block_display_information = __webpack_require__("wC17"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-selection-button.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-selection-button.js @@ -48351,8 +24551,8 @@ function BlockSelectionButton(_ref) { rootClientId, blockElement } = _ref; - const blockInformation = Object(use_block_display_information["a" /* default */])(clientId); - const selected = Object(external_wp_data_["useSelect"])(select => { + const blockInformation = useBlockDisplayInformation(clientId); + const selected = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getBlockListSettings; const { @@ -48360,7 +24560,7 @@ function BlockSelectionButton(_ref) { getBlockIndex, hasBlockMovingClientId, getBlockListSettings - } = select(store["a" /* store */]); + } = select(store); const index = getBlockIndex(clientId); const { name, @@ -48385,14 +24585,14 @@ function BlockSelectionButton(_ref) { const { setNavigationMode, removeBlock - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); - const ref = Object(external_wp_element_["useRef"])(); - const blockType = Object(external_wp_blocks_["getBlockType"])(name); - const label = Object(external_wp_blocks_["__experimentalGetAccessibleBlockLabel"])(blockType, attributes, index + 1, orientation); // Focus the breadcrumb in navigation mode. + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); + const label = (0,external_wp_blocks_namespaceObject.__experimentalGetAccessibleBlockLabel)(blockType, attributes, index + 1, orientation); // Focus the breadcrumb in navigation mode. - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { ref.current.focus(); - Object(external_wp_a11y_["speak"])(label); + (0,external_wp_a11y_namespaceObject.speak)(label); }, [label]); const { hasBlockMovingClientId, @@ -48404,29 +24604,29 @@ function BlockSelectionButton(_ref) { getPreviousBlockClientId, getNextBlockClientId, isNavigationMode - } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); + } = (0,external_wp_data_namespaceObject.useSelect)(store); const { selectBlock, clearSelectedBlock, setBlockMovingClientId, moveBlockToPosition - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); + } = (0,external_wp_data_namespaceObject.useDispatch)(store); function onKeyDown(event) { const { keyCode } = event; - const isUp = keyCode === external_wp_keycodes_["UP"]; - const isDown = keyCode === external_wp_keycodes_["DOWN"]; - const isLeft = keyCode === external_wp_keycodes_["LEFT"]; - const isRight = keyCode === external_wp_keycodes_["RIGHT"]; - const isTab = keyCode === external_wp_keycodes_["TAB"]; - const isEscape = keyCode === external_wp_keycodes_["ESCAPE"]; - const isEnter = keyCode === external_wp_keycodes_["ENTER"]; - const isSpace = keyCode === external_wp_keycodes_["SPACE"]; + const isUp = keyCode === external_wp_keycodes_namespaceObject.UP; + const isDown = keyCode === external_wp_keycodes_namespaceObject.DOWN; + const isLeft = keyCode === external_wp_keycodes_namespaceObject.LEFT; + const isRight = keyCode === external_wp_keycodes_namespaceObject.RIGHT; + const isTab = keyCode === external_wp_keycodes_namespaceObject.TAB; + const isEscape = keyCode === external_wp_keycodes_namespaceObject.ESCAPE; + const isEnter = keyCode === external_wp_keycodes_namespaceObject.ENTER; + const isSpace = keyCode === external_wp_keycodes_namespaceObject.SPACE; const isShift = event.shiftKey; - if (keyCode === external_wp_keycodes_["BACKSPACE"] || keyCode === external_wp_keycodes_["DELETE"]) { + if (keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || keyCode === external_wp_keycodes_namespaceObject.DELETE) { removeBlock(clientId); event.preventDefault(); return; @@ -48493,14 +24693,14 @@ function BlockSelectionButton(_ref) { let nextTabbable; if (navigateDown) { - nextTabbable = external_wp_dom_["focus"].tabbable.findNext(blockElement); + nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findNext(blockElement); if (!nextTabbable) { nextTabbable = blockElement.ownerDocument.defaultView.frameElement; - nextTabbable = external_wp_dom_["focus"].tabbable.findNext(nextTabbable); + nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findNext(nextTabbable); } } else { - nextTabbable = external_wp_dom_["focus"].tabbable.findPrevious(blockElement); + nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findPrevious(blockElement); } if (nextTabbable) { @@ -48516,52 +24716,2945 @@ function BlockSelectionButton(_ref) { 'is-block-moving-mode': !!blockMovingMode }); - const dragHandleLabel = Object(external_wp_i18n_["__"])('Drag'); + const dragHandleLabel = (0,external_wp_i18n_namespaceObject.__)('Drag'); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: classNames - }, Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, { justify: "center", className: "block-editor-block-list__block-selection-button__content" - }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(block_icon["a" /* default */], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(block_icon, { icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon, showColors: true - })), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(block_draggable["a" /* default */], { + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(block_draggable, { clientIds: [clientId] - }, draggableProps => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({ - icon: drag_handle["a" /* default */], + }, draggableProps => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({ + icon: drag_handle, className: "block-selection-button_drag-handle", "aria-hidden": "true", label: dragHandleLabel // Should not be able to tab to drag handle as this // button can only be used with a pointer device. , tabIndex: "-1" - }, draggableProps)))), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + }, draggableProps)))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { ref: ref, onClick: () => setNavigationMode(false), onKeyDown: onKeyDown, label: label, className: "block-selection-button_select-button" - }, Object(external_wp_element_["createElement"])(block_title["a" /* default */], { + }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, { clientId: clientId }))))); } /* harmony default export */ var block_selection_button = (BlockSelectionButton); -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-contextual-toolbar.js -var block_contextual_toolbar = __webpack_require__("JUfZ"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/navigable-toolbar/index.js -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js + 1 modules -var inserter = __webpack_require__("qrxh"); -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js -var use_block_refs = __webpack_require__("PKbb"); -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-popover-scroll.js -var use_popover_scroll = __webpack_require__("2z9l"); +/** + * WordPress dependencies + */ -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-popover.js + + + + + +function hasOnlyToolbarItem(elements) { + const dataProp = 'toolbarItem'; + return !elements.some(element => !(dataProp in element.dataset)); +} + +function getAllToolbarItemsIn(container) { + return Array.from(container.querySelectorAll('[data-toolbar-item]')); +} + +function hasFocusWithin(container) { + return container.contains(container.ownerDocument.activeElement); +} + +function focusFirstTabbableIn(container) { + const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(container); + + if (firstTabbable) { + firstTabbable.focus(); + } +} + +function useIsAccessibleToolbar(ref) { + /* + * By default, we'll assume the starting accessible state of the Toolbar + * is true, as it seems to be the most common case. + * + * Transitioning from an (initial) false to true state causes the + * component to mount twice, which is causing undesired + * side-effects. These side-effects appear to only affect certain + * E2E tests. + * + * This was initial discovered in this pull-request: + * https://github.com/WordPress/gutenberg/pull/23425 + */ + const initialAccessibleToolbarState = true; // By default, it's gonna render NavigableMenu. If all the tabbable elements + // inside the toolbar are ToolbarItem components (or derived components like + // ToolbarButton), then we can wrap them with the accessible Toolbar + // component. + + const [isAccessibleToolbar, setIsAccessibleToolbar] = (0,external_wp_element_namespaceObject.useState)(initialAccessibleToolbarState); + const determineIsAccessibleToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => { + const tabbables = external_wp_dom_namespaceObject.focus.tabbable.find(ref.current); + const onlyToolbarItem = hasOnlyToolbarItem(tabbables); + + if (!onlyToolbarItem) { + external_wp_deprecated_default()('Using custom components as toolbar controls', { + since: '5.6', + alternative: 'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components', + link: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols' + }); + } + + setIsAccessibleToolbar(onlyToolbarItem); + }, []); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + // Toolbar buttons may be rendered asynchronously, so we use + // MutationObserver to check if the toolbar subtree has been modified + const observer = new window.MutationObserver(determineIsAccessibleToolbar); + observer.observe(ref.current, { + childList: true, + subtree: true + }); + return () => observer.disconnect(); + }, [isAccessibleToolbar]); + return isAccessibleToolbar; +} + +function useToolbarFocus(ref, focusOnMount, isAccessibleToolbar, defaultIndex, onIndexChange) { + // Make sure we don't use modified versions of this prop + const [initialFocusOnMount] = (0,external_wp_element_namespaceObject.useState)(focusOnMount); + const [initialIndex] = (0,external_wp_element_namespaceObject.useState)(defaultIndex); + const focusToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => { + focusFirstTabbableIn(ref.current); + }, []); // Focus on toolbar when pressing alt+F10 when the toolbar is visible + + (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', focusToolbar); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (initialFocusOnMount) { + focusToolbar(); + } + }, [isAccessibleToolbar, initialFocusOnMount, focusToolbar]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // If initialIndex is passed, we focus on that toolbar item when the + // toolbar gets mounted and initial focus is not forced. + // We have to wait for the next browser paint because block controls aren't + // rendered right away when the toolbar gets mounted. + let raf = 0; + + if (initialIndex && !initialFocusOnMount) { + raf = window.requestAnimationFrame(() => { + const items = getAllToolbarItemsIn(ref.current); + const index = initialIndex || 0; + + if (items[index] && hasFocusWithin(ref.current)) { + items[index].focus(); + } + }); + } + + return () => { + window.cancelAnimationFrame(raf); + if (!onIndexChange || !ref.current) return; // When the toolbar element is unmounted and onIndexChange is passed, we + // pass the focused toolbar item index so it can be hydrated later. + + const items = getAllToolbarItemsIn(ref.current); + const index = items.findIndex(item => item.tabIndex === 0); + onIndexChange(index); + }; + }, [initialIndex, initialFocusOnMount]); +} + +function NavigableToolbar(_ref) { + let { + children, + focusOnMount, + __experimentalInitialIndex: initialIndex, + __experimentalOnIndexChange: onIndexChange, + ...props + } = _ref; + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const isAccessibleToolbar = useIsAccessibleToolbar(ref); + useToolbarFocus(ref, focusOnMount, isAccessibleToolbar, initialIndex, onIndexChange); + + if (isAccessibleToolbar) { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Toolbar, _extends({ + label: props['aria-label'], + ref: ref + }, props), children); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, _extends({ + orientation: "horizontal", + role: "toolbar", + ref: ref + }, props), children); +} + +/* harmony default export */ var navigable_toolbar = (NavigableToolbar); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js + + +/** + * WordPress dependencies + */ + +const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var chevron_right = (chevronRight); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js + + +/** + * WordPress dependencies + */ + +const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" +})); +/* harmony default export */ var chevron_left = (chevronLeft); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js + + +/** + * WordPress dependencies + */ + +const chevronUp = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var chevron_up = (chevronUp); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js + + +/** + * WordPress dependencies + */ + +const chevronDown = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var chevron_down = (chevronDown); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/mover-description.js +/** + * WordPress dependencies + */ + +/** + * Return a label for the block movement controls depending on block position. + * + * @param {number} selectedCount Number of blocks selected. + * @param {string} type Block type - in the case of a single block, should + * define its 'type'. I.e. 'Text', 'Heading', 'Image' etc. + * @param {number} firstIndex The index (position - 1) of the first block selected. + * @param {boolean} isFirst This is the first block. + * @param {boolean} isLast This is the last block. + * @param {number} dir Direction of movement (> 0 is considered to be going + * down, < 0 is up). + * @param {string} orientation The orientation of the block movers, vertical or + * horizontal. + * + * @return {string} Label for the block movement controls. + */ + +function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLast, dir, orientation) { + const position = firstIndex + 1; + + const getMovementDirection = moveDirection => { + if (moveDirection === 'up') { + if (orientation === 'horizontal') { + return (0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left'; + } + + return 'up'; + } else if (moveDirection === 'down') { + if (orientation === 'horizontal') { + return (0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right'; + } + + return 'down'; + } + + return null; + }; + + if (selectedCount > 1) { + return getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir); + } + + if (isFirst && isLast) { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Type of block (i.e. Text, Image etc) + (0,external_wp_i18n_namespaceObject.__)('Block %s is the only block, and cannot be moved'), type); + } + + if (dir > 0 && !isLast) { + // moving down + const movementDirection = getMovementDirection('down'); + + if (movementDirection === 'down') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position + (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d down to position %3$d'), type, position, position + 1); + } + + if (movementDirection === 'left') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position + (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d left to position %3$d'), type, position, position + 1); + } + + if (movementDirection === 'right') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position + (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d right to position %3$d'), type, position, position + 1); + } + } + + if (dir > 0 && isLast) { + // moving down, and is the last item + const movementDirection = getMovementDirection('down'); + + if (movementDirection === 'down') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) + (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the end of the content and can’t be moved down'), type); + } + + if (movementDirection === 'left') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) + (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the end of the content and can’t be moved left'), type); + } + + if (movementDirection === 'right') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) + (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the end of the content and can’t be moved right'), type); + } + } + + if (dir < 0 && !isFirst) { + // moving up + const movementDirection = getMovementDirection('up'); + + if (movementDirection === 'up') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position + (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d up to position %3$d'), type, position, position - 1); + } + + if (movementDirection === 'left') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position + (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d left to position %3$d'), type, position, position - 1); + } + + if (movementDirection === 'right') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position + (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d right to position %3$d'), type, position, position - 1); + } + } + + if (dir < 0 && isFirst) { + // moving up, and is the first item + const movementDirection = getMovementDirection('up'); + + if (movementDirection === 'up') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) + (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the beginning of the content and can’t be moved up'), type); + } + + if (movementDirection === 'left') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) + (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the beginning of the content and can’t be moved left'), type); + } + + if (movementDirection === 'right') { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) + (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the beginning of the content and can’t be moved right'), type); + } + } +} +/** + * Return a label for the block movement controls depending on block position. + * + * @param {number} selectedCount Number of blocks selected. + * @param {number} firstIndex The index (position - 1) of the first block selected. + * @param {boolean} isFirst This is the first block. + * @param {boolean} isLast This is the last block. + * @param {number} dir Direction of movement (> 0 is considered to be going + * down, < 0 is up). + * + * @return {string} Label for the block movement controls. + */ + +function getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir) { + const position = firstIndex + 1; + + if (dir < 0 && isFirst) { + return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved up as they are already at the top'); + } + + if (dir > 0 && isLast) { + return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved down as they are already at the bottom'); + } + + if (dir < 0 && !isFirst) { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks + (0,external_wp_i18n_namespaceObject._n)('Move %1$d block from position %2$d up by one place', 'Move %1$d blocks from position %2$d up by one place', selectedCount), selectedCount, position); + } + + if (dir > 0 && !isLast) { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks + (0,external_wp_i18n_namespaceObject._n)('Move %1$d block from position %2$d down by one place', 'Move %1$d blocks from position %2$d down by one place', selectedCount), selectedCount, position); + } +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/button.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + +const getArrowIcon = (direction, orientation) => { + if (direction === 'up') { + if (orientation === 'horizontal') { + return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; + } + + return chevron_up; + } else if (direction === 'down') { + if (orientation === 'horizontal') { + return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right; + } + + return chevron_down; + } + + return null; +}; + +const getMovementDirectionLabel = (moveDirection, orientation) => { + if (moveDirection === 'up') { + if (orientation === 'horizontal') { + return (0,external_wp_i18n_namespaceObject.isRTL)() ? (0,external_wp_i18n_namespaceObject.__)('Move right') : (0,external_wp_i18n_namespaceObject.__)('Move left'); + } + + return (0,external_wp_i18n_namespaceObject.__)('Move up'); + } else if (moveDirection === 'down') { + if (orientation === 'horizontal') { + return (0,external_wp_i18n_namespaceObject.isRTL)() ? (0,external_wp_i18n_namespaceObject.__)('Move left') : (0,external_wp_i18n_namespaceObject.__)('Move right'); + } + + return (0,external_wp_i18n_namespaceObject.__)('Move down'); + } + + return null; +}; + +const BlockMoverButton = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => { + let { + clientIds, + direction, + orientation: moverOrientation, + ...props + } = _ref; + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockMoverButton); + const blocksCount = (0,external_lodash_namespaceObject.castArray)(clientIds).length; + const { + blockType, + isDisabled, + rootClientId, + isFirst, + isLast, + firstIndex, + orientation = 'vertical' + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockIndex, + getBlockRootClientId, + getBlockOrder, + getBlock, + getBlockListSettings + } = select(store); + const normalizedClientIds = (0,external_lodash_namespaceObject.castArray)(clientIds); + const firstClientId = (0,external_lodash_namespaceObject.first)(normalizedClientIds); + const blockRootClientId = getBlockRootClientId(firstClientId); + const firstBlockIndex = getBlockIndex(firstClientId); + const lastBlockIndex = getBlockIndex((0,external_lodash_namespaceObject.last)(normalizedClientIds)); + const blockOrder = getBlockOrder(blockRootClientId); + const block = getBlock(firstClientId); + const isFirstBlock = firstBlockIndex === 0; + const isLastBlock = lastBlockIndex === blockOrder.length - 1; + const { + orientation: blockListOrientation + } = getBlockListSettings(blockRootClientId) || {}; + return { + blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null, + isDisabled: direction === 'up' ? isFirstBlock : isLastBlock, + rootClientId: blockRootClientId, + firstIndex: firstBlockIndex, + isFirst: isFirstBlock, + isLast: isLastBlock, + orientation: moverOrientation || blockListOrientation + }; + }, [clientIds, direction]); + const { + moveBlocksDown, + moveBlocksUp + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const moverFunction = direction === 'up' ? moveBlocksUp : moveBlocksDown; + + const onClick = event => { + moverFunction(clientIds, rootClientId); + + if (props.onClick) { + props.onClick(event); + } + }; + + const descriptionId = `block-editor-block-mover-button__description-${instanceId}`; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({ + ref: ref, + className: classnames_default()('block-editor-block-mover-button', `is-${direction}-button`), + icon: getArrowIcon(direction, orientation), + label: getMovementDirectionLabel(direction, orientation), + "aria-describedby": descriptionId + }, props, { + onClick: isDisabled ? null : onClick, + "aria-disabled": isDisabled + })), (0,external_wp_element_namespaceObject.createElement)("span", { + id: descriptionId, + className: "block-editor-block-mover-button__description" + }, getBlockMoverDescription(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, direction === 'up' ? -1 : 1, orientation))); +}); +const BlockMoverUpButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { + return (0,external_wp_element_namespaceObject.createElement)(BlockMoverButton, _extends({ + direction: "up", + ref: ref + }, props)); +}); +const BlockMoverDownButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { + return (0,external_wp_element_namespaceObject.createElement)(BlockMoverButton, _extends({ + direction: "down", + ref: ref + }, props)); +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/index.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + +function BlockMover(_ref) { + let { + isFirst, + isLast, + clientIds, + canMove, + isHidden, + rootClientId, + orientation, + hideDragHandle + } = _ref; + const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); + + const onFocus = () => setIsFocused(true); + + const onBlur = () => setIsFocused(false); + + if (!canMove || isFirst && isLast && !rootClientId) { + return null; + } + + const dragHandleLabel = (0,external_wp_i18n_namespaceObject.__)('Drag'); // We emulate a disabled state because forcefully applying the `disabled` + // attribute on the buttons while it has focus causes the screen to change + // to an unfocused state (body as active element) without firing blur on, + // the rendering parent, leaving it unable to react to focus out. + + + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: classnames_default()('block-editor-block-mover', { + 'is-visible': isFocused || !isHidden, + 'is-horizontal': orientation === 'horizontal' + }) + }, !hideDragHandle && (0,external_wp_element_namespaceObject.createElement)(block_draggable, { + clientIds: clientIds, + cloneClassname: "block-editor-block-mover__drag-clone" + }, draggableProps => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({ + icon: drag_handle, + className: "block-editor-block-mover__drag-handle", + "aria-hidden": "true", + label: dragHandleLabel // Should not be able to tab to drag handle as this + // button can only be used with a pointer device. + , + tabIndex: "-1" + }, draggableProps))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, { + className: "block-editor-block-mover__move-button-container" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, { + onFocus: onFocus, + onBlur: onBlur + }, itemProps => (0,external_wp_element_namespaceObject.createElement)(BlockMoverUpButton, _extends({ + clientIds: clientIds + }, itemProps))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, { + onFocus: onFocus, + onBlur: onBlur + }, itemProps => (0,external_wp_element_namespaceObject.createElement)(BlockMoverDownButton, _extends({ + clientIds: clientIds + }, itemProps))))); +} + +/* harmony default export */ var block_mover = ((0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => { + var _getBlockListSettings; + + let { + clientIds + } = _ref2; + const { + getBlock, + getBlockIndex, + getBlockListSettings, + canMoveBlocks, + getBlockOrder, + getBlockRootClientId + } = select(store); + const normalizedClientIds = (0,external_lodash_namespaceObject.castArray)(clientIds); + const firstClientId = (0,external_lodash_namespaceObject.first)(normalizedClientIds); + const block = getBlock(firstClientId); + const rootClientId = getBlockRootClientId((0,external_lodash_namespaceObject.first)(normalizedClientIds)); + const firstIndex = getBlockIndex(firstClientId); + const lastIndex = getBlockIndex((0,external_lodash_namespaceObject.last)(normalizedClientIds)); + const blockOrder = getBlockOrder(rootClientId); + const isFirst = firstIndex === 0; + const isLast = lastIndex === blockOrder.length - 1; + return { + blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null, + canMove: canMoveBlocks(clientIds, rootClientId), + rootClientId, + firstIndex, + isFirst, + isLast, + orientation: (_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation + }; +})(BlockMover)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/utils.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +const { + clearTimeout: utils_clearTimeout, + setTimeout: utils_setTimeout +} = window; +const DEBOUNCE_TIMEOUT = 200; +/** + * Hook that creates a showMover state, as well as debounced show/hide callbacks. + * + * @param {Object} props Component props. + * @param {Object} props.ref Element reference. + * @param {boolean} props.isFocused Whether the component has current focus. + * @param {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. + * @param {Function} [props.onChange=noop] Callback function. + */ + +function useDebouncedShowMovers(_ref) { + let { + ref, + isFocused, + debounceTimeout = DEBOUNCE_TIMEOUT, + onChange = external_lodash_namespaceObject.noop + } = _ref; + const [showMovers, setShowMovers] = (0,external_wp_element_namespaceObject.useState)(false); + const timeoutRef = (0,external_wp_element_namespaceObject.useRef)(); + + const handleOnChange = nextIsFocused => { + if (ref !== null && ref !== void 0 && ref.current) { + setShowMovers(nextIsFocused); + } + + onChange(nextIsFocused); + }; + + const getIsHovered = () => { + return (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.matches(':hover'); + }; + + const shouldHideMovers = () => { + const isHovered = getIsHovered(); + return !isFocused && !isHovered; + }; + + const clearTimeoutRef = () => { + const timeout = timeoutRef.current; + + if (timeout && utils_clearTimeout) { + utils_clearTimeout(timeout); + } + }; + + const debouncedShowMovers = event => { + if (event) { + event.stopPropagation(); + } + + clearTimeoutRef(); + + if (!showMovers) { + handleOnChange(true); + } + }; + + const debouncedHideMovers = event => { + if (event) { + event.stopPropagation(); + } + + clearTimeoutRef(); + timeoutRef.current = utils_setTimeout(() => { + if (shouldHideMovers()) { + handleOnChange(false); + } + }, debounceTimeout); + }; + + (0,external_wp_element_namespaceObject.useEffect)(() => () => clearTimeoutRef(), []); + return { + showMovers, + debouncedShowMovers, + debouncedHideMovers + }; +} +/** + * Hook that provides a showMovers state and gesture events for DOM elements + * that interact with the showMovers state. + * + * @param {Object} props Component props. + * @param {Object} props.ref Element reference. + * @param {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. + * @param {Function} [props.onChange=noop] Callback function. + */ + +function useShowMoversGestures(_ref2) { + let { + ref, + debounceTimeout = DEBOUNCE_TIMEOUT, + onChange = external_lodash_namespaceObject.noop + } = _ref2; + const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); + const { + showMovers, + debouncedShowMovers, + debouncedHideMovers + } = useDebouncedShowMovers({ + ref, + debounceTimeout, + isFocused, + onChange + }); + const registerRef = (0,external_wp_element_namespaceObject.useRef)(false); + + const isFocusedWithin = () => { + return (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.contains(ref.current.ownerDocument.activeElement); + }; + + (0,external_wp_element_namespaceObject.useEffect)(() => { + const node = ref.current; + + const handleOnFocus = () => { + if (isFocusedWithin()) { + setIsFocused(true); + debouncedShowMovers(); + } + }; + + const handleOnBlur = () => { + if (!isFocusedWithin()) { + setIsFocused(false); + debouncedHideMovers(); + } + }; + /** + * Events are added via DOM events (vs. React synthetic events), + * as the child React components swallow mouse events. + */ + + + if (node && !registerRef.current) { + node.addEventListener('focus', handleOnFocus, true); + node.addEventListener('blur', handleOnBlur, true); + registerRef.current = true; + } + + return () => { + if (node) { + node.removeEventListener('focus', handleOnFocus); + node.removeEventListener('blur', handleOnBlur); + } + }; + }, [ref, registerRef, setIsFocused, debouncedShowMovers, debouncedHideMovers]); + return { + showMovers, + gestures: { + onMouseMove: debouncedShowMovers, + onMouseLeave: debouncedHideMovers + } + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-parent-selector/index.js + + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + +/** + * Block parent selector component, displaying the hierarchy of the + * current block selection as a single icon to "go up" a level. + * + * @return {WPComponent} Parent block selector. + */ + +function BlockParentSelector() { + const { + selectBlock, + toggleBlockHighlight + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + firstParentClientId, + shouldHide, + hasReducedUI + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockName, + getBlockParents, + getSelectedBlockClientId, + getSettings + } = select(store); + const { + hasBlockSupport + } = select(external_wp_blocks_namespaceObject.store); + const selectedBlockClientId = getSelectedBlockClientId(); + const parents = getBlockParents(selectedBlockClientId); + const _firstParentClientId = parents[parents.length - 1]; + const parentBlockName = getBlockName(_firstParentClientId); + + const _parentBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName); + + const settings = getSettings(); + return { + firstParentClientId: _firstParentClientId, + shouldHide: !hasBlockSupport(_parentBlockType, '__experimentalParentSelector', true), + hasReducedUI: settings.hasReducedUI + }; + }, []); + const blockInformation = useBlockDisplayInformation(firstParentClientId); // Allows highlighting the parent block outline when focusing or hovering + // the parent block selector within the child. + + const nodeRef = (0,external_wp_element_namespaceObject.useRef)(); + const { + gestures: showMoversGestures + } = useShowMoversGestures({ + ref: nodeRef, + + onChange(isFocused) { + if (isFocused && hasReducedUI) { + return; + } + + toggleBlockHighlight(firstParentClientId, isFocused); + } + + }); + + if (shouldHide || firstParentClientId === undefined) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)("div", _extends({ + className: "block-editor-block-parent-selector", + key: firstParentClientId, + ref: nodeRef + }, showMoversGestures), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + className: "block-editor-block-parent-selector__button", + onClick: () => selectBlock(firstParentClientId), + label: (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: Name of the block's parent. */ + (0,external_wp_i18n_namespaceObject.__)('Select %s'), blockInformation.title), + showTooltip: true, + icon: (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: blockInformation.icon + }) + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js + + +/** + * WordPress dependencies + */ + +const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z" +})); +/* harmony default export */ var library_stack = (stack); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/preview-block-popover.js + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function PreviewBlockPopover(_ref) { + let { + blocks + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__popover__preview__parent" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__popover__preview__container" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { + className: "block-editor-block-switcher__preview__popover", + position: "bottom right", + focusOnMount: false + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__preview" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__preview-title" + }, (0,external_wp_i18n_namespaceObject.__)('Preview')), (0,external_wp_element_namespaceObject.createElement)(block_preview, { + viewportWidth: 500, + blocks: blocks + }))))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-transformations-menu.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +const BlockTransformationsMenu = _ref => { + let { + className, + possibleBlockTransformations, + onSelect, + blocks + } = _ref; + const [hoveredTransformItemName, setHoveredTransformItemName] = (0,external_wp_element_namespaceObject.useState)(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Transform to'), + className: className + }, hoveredTransformItemName && (0,external_wp_element_namespaceObject.createElement)(PreviewBlockPopover, { + blocks: (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, hoveredTransformItemName) + }), possibleBlockTransformations.map(item => { + const { + name, + icon, + title, + isDisabled + } = item; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + key: name, + className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(name), + onClick: event => { + event.preventDefault(); + onSelect(name); + }, + disabled: isDisabled, + onMouseLeave: () => setHoveredTransformItemName(null), + onMouseEnter: () => setHoveredTransformItemName(name) + }, (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: icon, + showColors: true + }), title); + })); +}; + +/* harmony default export */ var block_transformations_menu = (BlockTransformationsMenu); + +;// CONCATENATED MODULE: external ["wp","tokenList"] +var external_wp_tokenList_namespaceObject = window["wp"]["tokenList"]; +var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_namespaceObject); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/utils.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Returns the active style from the given className. + * + * @param {Array} styles Block style variations. + * @param {string} className Class name + * + * @return {Object?} The active style. + */ + +function getActiveStyle(styles, className) { + for (const style of new (external_wp_tokenList_default())(className).values()) { + if (style.indexOf('is-style-') === -1) { + continue; + } + + const potentialStyleName = style.substring(9); + const activeStyle = (0,external_lodash_namespaceObject.find)(styles, { + name: potentialStyleName + }); + + if (activeStyle) { + return activeStyle; + } + } + + return (0,external_lodash_namespaceObject.find)(styles, 'isDefault'); +} +/** + * Replaces the active style in the block's className. + * + * @param {string} className Class name. + * @param {Object?} activeStyle The replaced style. + * @param {Object} newStyle The replacing style. + * + * @return {string} The updated className. + */ + +function replaceActiveStyle(className, activeStyle, newStyle) { + const list = new (external_wp_tokenList_default())(className); + + if (activeStyle) { + list.remove('is-style-' + activeStyle.name); + } + + list.add('is-style-' + newStyle.name); + return list.value; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +const EMPTY_OBJECT = {}; + +function useGenericPreviewBlock(block, type) { + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const example = type === null || type === void 0 ? void 0 : type.example; + const blockName = type === null || type === void 0 ? void 0 : type.name; + + if (example && blockName) { + return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockName, { + attributes: example.attributes, + innerBlocks: example.innerBlocks + }); + } + + if (block) { + return (0,external_wp_blocks_namespaceObject.cloneBlock)(block); + } + }, [type !== null && type !== void 0 && type.example ? block === null || block === void 0 ? void 0 : block.name : block, type]); +} + +function BlockStyles(_ref) { + let { + clientId, + onSwitch = external_lodash_namespaceObject.noop, + onHoverClassName = external_lodash_namespaceObject.noop, + itemRole + } = _ref; + + const selector = select => { + const { + getBlock + } = select(store); + const block = getBlock(clientId); + + if (!block) { + return EMPTY_OBJECT; + } + + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); + const { + getBlockStyles + } = select(external_wp_blocks_namespaceObject.store); + return { + block, + type: blockType, + styles: getBlockStyles(block.name), + className: block.attributes.className || '' + }; + }; + + const { + styles, + block, + type, + className + } = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]); + const { + updateBlockAttributes + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const genericPreviewBlock = useGenericPreviewBlock(block, type); + + if (!styles || styles.length === 0) { + return null; + } + + const renderedStyles = (0,external_lodash_namespaceObject.find)(styles, 'isDefault') ? styles : [{ + name: 'default', + label: (0,external_wp_i18n_namespaceObject._x)('Default', 'block style'), + isDefault: true + }, ...styles]; + const activeStyle = getActiveStyle(renderedStyles, className); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-styles" + }, renderedStyles.map(style => { + var _type$example$viewpor, _type$example; + + const styleClassName = replaceActiveStyle(className, activeStyle, style); + return (0,external_wp_element_namespaceObject.createElement)(BlockStyleItem, { + genericPreviewBlock: genericPreviewBlock, + viewportWidth: (_type$example$viewpor = (_type$example = type.example) === null || _type$example === void 0 ? void 0 : _type$example.viewportWidth) !== null && _type$example$viewpor !== void 0 ? _type$example$viewpor : 500, + className: className, + isActive: activeStyle === style, + key: style.name, + onSelect: () => { + updateBlockAttributes(clientId, { + className: styleClassName + }); + onHoverClassName(null); + onSwitch(); + }, + onBlur: () => onHoverClassName(null), + onHover: () => onHoverClassName(styleClassName), + style: style, + styleClassName: styleClassName, + itemRole: itemRole + }); + })); +} + +function BlockStyleItem(_ref2) { + let { + genericPreviewBlock, + viewportWidth, + style, + isActive, + onBlur, + onHover, + onSelect, + styleClassName, + itemRole + } = _ref2; + const previewBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + return { ...genericPreviewBlock, + attributes: { ...genericPreviewBlock.attributes, + className: styleClassName + } + }; + }, [genericPreviewBlock, styleClassName]); + return (0,external_wp_element_namespaceObject.createElement)("div", { + key: style.name, + className: classnames_default()('block-editor-block-styles__item', { + 'is-active': isActive + }), + onClick: () => onSelect(), + onKeyDown: event => { + if (external_wp_keycodes_namespaceObject.ENTER === event.keyCode || external_wp_keycodes_namespaceObject.SPACE === event.keyCode) { + event.preventDefault(); + onSelect(); + } + }, + onMouseEnter: onHover, + onMouseLeave: onBlur, + role: itemRole || 'button', + tabIndex: "0", + "aria-label": style.label || style.name + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-styles__item-preview" + }, (0,external_wp_element_namespaceObject.createElement)(block_preview, { + viewportWidth: viewportWidth, + blocks: previewBlocks + })), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-styles__item-label" + }, style.label || style.name)); +} + +/* harmony default export */ var block_styles = (BlockStyles); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-styles-menu.js + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +function BlockStylesMenu(_ref) { + let { + hoveredBlock, + onSwitch + } = _ref; + const { + name, + clientId + } = hoveredBlock; + const [hoveredClassName, setHoveredClassName] = (0,external_wp_element_namespaceObject.useState)(); + const blockType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockType(name), [name]); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Styles'), + className: "block-editor-block-switcher__styles__menugroup" + }, hoveredClassName && (0,external_wp_element_namespaceObject.createElement)(PreviewBlockPopover, { + blocks: blockType && blockType.example ? (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockType.name, { + attributes: { ...blockType.example.attributes, + className: hoveredClassName + }, + innerBlocks: blockType.example.innerBlocks + }) : (0,external_wp_blocks_namespaceObject.cloneBlock)(hoveredBlock, { + className: hoveredClassName + }) + }), (0,external_wp_element_namespaceObject.createElement)(block_styles, { + clientId: clientId, + onSwitch: onSwitch, + onHoverClassName: setHoveredClassName, + itemRole: "menuitem" + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/utils.js +/** + * WordPress dependencies + */ + +/** + * Try to find a matching block by a block's name in a provided + * block. We recurse through InnerBlocks and return the reference + * of the matched block (it could be an InnerBlock). + * If no match is found return nothing. + * + * @param {WPBlock} block The block to try to find a match. + * @param {string} selectedBlockName The block's name to use for matching condition. + * @param {Set} consumedBlocks A set holding the previously matched/consumed blocks. + * + * @return {WPBlock?} The matched block if found or nothing(`undefined`). + */ + +const getMatchingBlockByName = function (block, selectedBlockName) { + let consumedBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set(); + const { + clientId, + name, + innerBlocks = [] + } = block; // Check if block has been consumed already. + + if (consumedBlocks.has(clientId)) return; + if (name === selectedBlockName) return block; // Try to find a matching block from InnerBlocks recursively. + + for (const innerBlock of innerBlocks) { + const match = getMatchingBlockByName(innerBlock, selectedBlockName, consumedBlocks); + if (match) return match; + } +}; +/** + * Find and return the block attributes to retain through + * the transformation, based on Block Type's `role:content` + * attributes. If no `role:content` attributes exist, + * return selected block's attributes. + * + * @param {string} name Block type's namespaced name. + * @param {Object} attributes Selected block's attributes. + * @return {Object} The block's attributes to retain. + */ + +const getRetainedBlockAttributes = (name, attributes) => { + const contentAttributes = (0,external_wp_blocks_namespaceObject.__experimentalGetBlockAttributesNamesByRole)(name, 'content'); + if (!(contentAttributes !== null && contentAttributes !== void 0 && contentAttributes.length)) return attributes; + return contentAttributes.reduce((_accumulator, attribute) => { + if (attributes[attribute]) _accumulator[attribute] = attributes[attribute]; + return _accumulator; + }, {}); +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/use-transformed-patterns.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * Mutate the matched block's attributes by getting + * which block type's attributes to retain and prioritize + * them in the merging of the attributes. + * + * @param {WPBlock} match The matched block. + * @param {WPBlock} selectedBlock The selected block. + * @return {void} + */ + +const transformMatchingBlock = (match, selectedBlock) => { + // Get the block attributes to retain through the transformation. + const retainedBlockAttributes = getRetainedBlockAttributes(selectedBlock.name, selectedBlock.attributes); + match.attributes = { ...match.attributes, + ...retainedBlockAttributes + }; +}; +/** + * By providing the selected blocks and pattern's blocks + * find the matching blocks, transform them and return them. + * If not all selected blocks are matched, return nothing. + * + * @param {WPBlock[]} selectedBlocks The selected blocks. + * @param {WPBlock[]} patternBlocks The pattern's blocks. + * @return {WPBlock[]|void} The transformed pattern's blocks or undefined if not all selected blocks have been matched. + */ + +const getPatternTransformedBlocks = (selectedBlocks, patternBlocks) => { + // Clone Pattern's blocks to produce new clientIds and be able to mutate the matches. + const _patternBlocks = patternBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); + /** + * Keep track of the consumed pattern blocks. + * This is needed because we loop the selected blocks + * and for example we may have selected two paragraphs and + * the pattern's blocks could have more `paragraphs`. + */ + + + const consumedBlocks = new Set(); + + for (const selectedBlock of selectedBlocks) { + let isMatch = false; + + for (const patternBlock of _patternBlocks) { + const match = getMatchingBlockByName(patternBlock, selectedBlock.name, consumedBlocks); + if (!match) continue; + isMatch = true; + consumedBlocks.add(match.clientId); // We update (mutate) the matching pattern block. + + transformMatchingBlock(match, selectedBlock); // No need to loop through other pattern's blocks. + + break; + } // Bail eary if a selected block has not been matched. + + + if (!isMatch) return; + } + + return _patternBlocks; +}; +/** + * @typedef {WPBlockPattern & {transformedBlocks: WPBlock[]}} TransformedBlockPattern + */ + +/** + * Custom hook that accepts patterns from state and the selected + * blocks and tries to match these with the pattern's blocks. + * If all selected blocks are matched with a Pattern's block, + * we transform them by retaining block's attributes with `role:content`. + * The transformed pattern's blocks are set to a new pattern + * property `transformedBlocks`. + * + * @param {WPBlockPattern[]} patterns Patterns from state. + * @param {WPBlock[]} selectedBlocks The currently selected blocks. + * @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks. + */ +// TODO tests + +const useTransformedPatterns = (patterns, selectedBlocks) => { + return (0,external_wp_element_namespaceObject.useMemo)(() => patterns.reduce((accumulator, _pattern) => { + const transformedBlocks = getPatternTransformedBlocks(selectedBlocks, _pattern.blocks); + + if (transformedBlocks) { + accumulator.push({ ..._pattern, + transformedBlocks + }); + } + + return accumulator; + }, []), [patterns, selectedBlocks]); +}; + +/* harmony default export */ var use_transformed_patterns = (useTransformedPatterns); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/pattern-transformations-menu.js + + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +function PatternTransformationsMenu(_ref) { + let { + blocks, + patterns: statePatterns, + onSelect + } = _ref; + const [showTransforms, setShowTransforms] = (0,external_wp_element_namespaceObject.useState)(false); + const patterns = use_transformed_patterns(statePatterns, blocks); + if (!patterns.length) return null; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { + className: "block-editor-block-switcher__pattern__transforms__menugroup" + }, showTransforms && (0,external_wp_element_namespaceObject.createElement)(PreviewPatternsPopover, { + patterns: patterns, + onSelect: onSelect + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: event => { + event.preventDefault(); + setShowTransforms(!showTransforms); + }, + icon: chevron_right + }, (0,external_wp_i18n_namespaceObject.__)('Patterns'))); +} + +function PreviewPatternsPopover(_ref2) { + let { + patterns, + onSelect + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__popover__preview__parent" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__popover__preview__container" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { + className: "block-editor-block-switcher__preview__popover", + position: "bottom right" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__preview" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__preview-title" + }, (0,external_wp_i18n_namespaceObject.__)('Preview')), (0,external_wp_element_namespaceObject.createElement)(BlockPatternsList, { + patterns: patterns, + onSelect: onSelect + }))))); +} + +function BlockPatternsList(_ref3) { + let { + patterns, + onSelect + } = _ref3; + const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, { + role: "listbox", + className: "block-editor-block-switcher__preview-patterns-container", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Patterns list') + }), patterns.map(pattern => (0,external_wp_element_namespaceObject.createElement)(pattern_transformations_menu_BlockPattern, { + key: pattern.name, + pattern: pattern, + onSelect: onSelect, + composite: composite + }))); +} + +function pattern_transformations_menu_BlockPattern(_ref4) { + let { + pattern, + onSelect, + composite + } = _ref4; + // TODO check pattern/preview width... + const baseClassName = 'block-editor-block-switcher__preview-patterns-container'; + const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(pattern_transformations_menu_BlockPattern, `${baseClassName}-list__item-description`); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: `${baseClassName}-list__list-item`, + "aria-label": pattern.title, + "aria-describedby": pattern.description ? descriptionId : undefined + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, _extends({ + role: "option", + as: "div" + }, composite, { + className: `${baseClassName}-list__item`, + onClick: () => onSelect(pattern.transformedBlocks) + }), (0,external_wp_element_namespaceObject.createElement)(block_preview, { + blocks: pattern.transformedBlocks, + viewportWidth: pattern.viewportWidth || 500 + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: `${baseClassName}-list__item-title` + }, pattern.title)), !!pattern.description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + id: descriptionId + }, pattern.description)); +} + +/* harmony default export */ var pattern_transformations_menu = (PatternTransformationsMenu); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + + +const BlockSwitcherDropdownMenu = _ref => { + let { + clientIds, + blocks + } = _ref; + const { + replaceBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const blockInformation = useBlockDisplayInformation(blocks[0].clientId); + const { + possibleBlockTransformations, + canRemove, + hasBlockStyles, + icon, + blockTitle, + patterns + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getBlockType2; + + const { + getBlockRootClientId, + getBlockTransformItems, + __experimentalGetPatternTransformItems + } = select(store); + const { + getBlockStyles, + getBlockType + } = select(external_wp_blocks_namespaceObject.store); + const { + canRemoveBlocks + } = select(store); + const rootClientId = getBlockRootClientId((0,external_lodash_namespaceObject.castArray)(clientIds)[0]); + const [{ + name: firstBlockName + }] = blocks; + + const _isSingleBlockSelected = blocks.length === 1; + + const styles = _isSingleBlockSelected && getBlockStyles(firstBlockName); + + let _icon; + + if (_isSingleBlockSelected) { + _icon = blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon; // Take into account active block variations. + } else { + var _getBlockType; + + const isSelectionOfSameType = (0,external_lodash_namespaceObject.uniq)(blocks.map(_ref2 => { + let { + name + } = _ref2; + return name; + })).length === 1; // When selection consists of blocks of multiple types, display an + // appropriate icon to communicate the non-uniformity. + + _icon = isSelectionOfSameType ? (_getBlockType = getBlockType(firstBlockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon : library_stack; + } + + return { + possibleBlockTransformations: getBlockTransformItems(blocks, rootClientId), + canRemove: canRemoveBlocks(clientIds, rootClientId), + hasBlockStyles: !!(styles !== null && styles !== void 0 && styles.length), + icon: _icon, + blockTitle: (_getBlockType2 = getBlockType(firstBlockName)) === null || _getBlockType2 === void 0 ? void 0 : _getBlockType2.title, + patterns: __experimentalGetPatternTransformItems(blocks, rootClientId) + }; + }, [clientIds, blocks, blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon]); + const isReusable = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]); + const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]); // Simple block tranformation based on the `Block Transforms` API. + + const onBlockTransform = name => replaceBlocks(clientIds, (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name)); // Pattern transformation through the `Patterns` API. + + + const onPatternTransform = transformedBlocks => replaceBlocks(clientIds, transformedBlocks); + + const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove; + const hasPatternTransformation = !!(patterns !== null && patterns !== void 0 && patterns.length) && canRemove; + + if (!hasBlockStyles && !hasPossibleBlockTransformations) { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + disabled: true, + className: "block-editor-block-switcher__no-switcher-icon", + title: blockTitle, + icon: (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: icon, + showColors: true + }) + })); + } + + const blockSwitcherLabel = blockTitle; + const blockSwitcherDescription = 1 === blocks.length ? (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: block title. */ + (0,external_wp_i18n_namespaceObject.__)('%s: Change block type or style'), blockTitle) : (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %d: number of blocks. */ + (0,external_wp_i18n_namespaceObject._n)('Change type of %d block', 'Change type of %d blocks', blocks.length), blocks.length); + const showDropDown = hasBlockStyles || hasPossibleBlockTransformations || hasPatternTransformation; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, toggleProps => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { + className: "block-editor-block-switcher", + label: blockSwitcherLabel, + popoverProps: { + position: 'bottom right', + isAlternate: true, + className: 'block-editor-block-switcher__popover' + }, + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: icon, + className: "block-editor-block-switcher__toggle", + showColors: true + }), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-block-switcher__toggle-text" + }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, { + clientId: clientIds + }))), + toggleProps: { + describedBy: blockSwitcherDescription, + ...toggleProps + }, + menuProps: { + orientation: 'both' + } + }, _ref3 => { + let { + onClose + } = _ref3; + return showDropDown && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-switcher__container" + }, hasPatternTransformation && (0,external_wp_element_namespaceObject.createElement)(pattern_transformations_menu, { + blocks: blocks, + patterns: patterns, + onSelect: transformedBlocks => { + onPatternTransform(transformedBlocks); + onClose(); + } + }), hasPossibleBlockTransformations && (0,external_wp_element_namespaceObject.createElement)(block_transformations_menu, { + className: "block-editor-block-switcher__transforms__menugroup", + possibleBlockTransformations: possibleBlockTransformations, + blocks: blocks, + onSelect: name => { + onBlockTransform(name); + onClose(); + } + }), hasBlockStyles && (0,external_wp_element_namespaceObject.createElement)(BlockStylesMenu, { + hoveredBlock: blocks[0], + onSwitch: onClose + })); + }))); +}; +const BlockSwitcher = _ref4 => { + let { + clientIds + } = _ref4; + const blocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlocksByClientId(clientIds), [clientIds]); + + if (!blocks.length || blocks.some(block => !block)) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(BlockSwitcherDropdownMenu, { + clientIds: clientIds, + blocks: blocks + }); +}; +/* harmony default export */ var block_switcher = (BlockSwitcher); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js + + +/** + * WordPress dependencies + */ + +const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" +})); +/* harmony default export */ var more_vertical = (moreVertical); + +;// CONCATENATED MODULE: external ["wp","blob"] +var external_wp_blob_namespaceObject = window["wp"]["blob"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/get-paste-event-data.js +/** + * WordPress dependencies + */ + + +function getPasteEventData(_ref) { + let { + clipboardData + } = _ref; + let plainText = ''; + let html = ''; // IE11 only supports `Text` as an argument for `getData` and will + // otherwise throw an invalid argument error, so we try the standard + // arguments first, then fallback to `Text` if they fail. + + try { + plainText = clipboardData.getData('text/plain'); + html = clipboardData.getData('text/html'); + } catch (error1) { + try { + html = clipboardData.getData('Text'); + } catch (error2) { + // Some browsers like UC Browser paste plain text by default and + // don't support clipboardData at all, so allow default + // behaviour. + return; + } + } + + const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(clipboardData).filter(_ref2 => { + let { + type + } = _ref2; + return /^image\/(?:jpe?g|png|gif)$/.test(type); + }); // Only process files if no HTML is present. + // A pasted file may have the URL as plain text. + + if (files.length && !html) { + html = files.map(file => ``).join(''); + plainText = ''; + } + + return { + html, + plainText + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + +function useNotifyCopy() { + const { + getBlockName + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + getBlockType + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); + const { + createSuccessNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + return (0,external_wp_element_namespaceObject.useCallback)((eventType, selectedBlockClientIds) => { + let notice = ''; + + if (selectedBlockClientIds.length === 1) { + var _getBlockType; + + const clientId = selectedBlockClientIds[0]; + const title = (_getBlockType = getBlockType(getBlockName(clientId))) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title; + notice = eventType === 'copy' ? (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: Name of the block being copied, e.g. "Paragraph". + (0,external_wp_i18n_namespaceObject.__)('Copied "%s" to clipboard.'), title) : (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: Name of the block being cut, e.g. "Paragraph". + (0,external_wp_i18n_namespaceObject.__)('Moved "%s" to clipboard.'), title); + } else { + notice = eventType === 'copy' ? (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %d: Number of blocks being copied. + (0,external_wp_i18n_namespaceObject._n)('Copied %d block to clipboard.', 'Copied %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length) : (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %d: Number of blocks being cut. + (0,external_wp_i18n_namespaceObject._n)('Moved %d block to clipboard.', 'Moved %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length); + } + + createSuccessNotice(notice, { + type: 'snackbar' + }); + }, []); +} +function useClipboardHandler() { + const { + getBlocksByClientId, + getSelectedBlockClientIds, + hasMultiSelection, + getSettings + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + flashBlock, + removeBlocks, + replaceBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const notifyCopy = useNotifyCopy(); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function handler(event) { + const selectedBlockClientIds = getSelectedBlockClientIds(); + + if (selectedBlockClientIds.length === 0) { + return; + } // Always handle multiple selected blocks. + + + if (!hasMultiSelection()) { + const { + target + } = event; + const { + ownerDocument + } = target; // If copying, only consider actual text selection as selection. + // Otherwise, any focus on an input field is considered. + + const hasSelection = event.type === 'copy' || event.type === 'cut' ? (0,external_wp_dom_namespaceObject.documentHasUncollapsedSelection)(ownerDocument) : (0,external_wp_dom_namespaceObject.documentHasSelection)(ownerDocument); // Let native copy behaviour take over in input fields. + + if (hasSelection) { + return; + } + } + + if (!node.contains(event.target.ownerDocument.activeElement)) { + return; + } + + const eventDefaultPrevented = event.defaultPrevented; + event.preventDefault(); + + if (event.type === 'copy' || event.type === 'cut') { + if (selectedBlockClientIds.length === 1) { + flashBlock(selectedBlockClientIds[0]); + } + + notifyCopy(event.type, selectedBlockClientIds); + const blocks = getBlocksByClientId(selectedBlockClientIds); + const serialized = (0,external_wp_blocks_namespaceObject.serialize)(blocks); + event.clipboardData.setData('text/plain', serialized); + event.clipboardData.setData('text/html', serialized); + } + + if (event.type === 'cut') { + removeBlocks(selectedBlockClientIds); + } else if (event.type === 'paste') { + if (eventDefaultPrevented) { + // This was likely already handled in rich-text/use-paste-handler.js + return; + } + + const { + __experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML + } = getSettings(); + const { + plainText, + html + } = getPasteEventData(event); + const blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({ + HTML: html, + plainText, + mode: 'BLOCKS', + canUserUseUnfilteredHTML + }); + replaceBlocks(selectedBlockClientIds, blocks, blocks.length - 1, -1); + } + } + + node.ownerDocument.addEventListener('copy', handler); + node.ownerDocument.addEventListener('cut', handler); + node.ownerDocument.addEventListener('paste', handler); + return () => { + node.ownerDocument.removeEventListener('copy', handler); + node.ownerDocument.removeEventListener('cut', handler); + node.ownerDocument.removeEventListener('paste', handler); + }; + }, []); +} + +function CopyHandler(_ref) { + let { + children + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + ref: useClipboardHandler() + }, children); +} + +/* harmony default export */ var copy_handler = (CopyHandler); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-actions/index.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function BlockActions(_ref) { + let { + clientIds, + children, + __experimentalUpdateSelection: updateSelection + } = _ref; + const { + canInsertBlockType, + getBlockRootClientId, + getBlocksByClientId, + canMoveBlocks, + canRemoveBlocks + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + getDefaultBlockName, + getGroupingBlockName + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); + const blocks = getBlocksByClientId(clientIds); + const rootClientId = getBlockRootClientId(clientIds[0]); + const canDuplicate = (0,external_lodash_namespaceObject.every)(blocks, block => { + return !!block && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'multiple', true) && canInsertBlockType(block.name, rootClientId); + }); + const canInsertDefaultBlock = canInsertBlockType(getDefaultBlockName(), rootClientId); + const canMove = canMoveBlocks(clientIds, rootClientId); + const canRemove = canRemoveBlocks(clientIds, rootClientId); + const { + removeBlocks, + replaceBlocks, + duplicateBlocks, + insertAfterBlock, + insertBeforeBlock, + flashBlock, + setBlockMovingClientId, + setNavigationMode, + selectBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const notifyCopy = useNotifyCopy(); + return children({ + canDuplicate, + canInsertDefaultBlock, + canMove, + canRemove, + rootClientId, + blocks, + + onDuplicate() { + return duplicateBlocks(clientIds, updateSelection); + }, + + onRemove() { + return removeBlocks(clientIds, updateSelection); + }, + + onInsertBefore() { + insertBeforeBlock((0,external_lodash_namespaceObject.first)((0,external_lodash_namespaceObject.castArray)(clientIds))); + }, + + onInsertAfter() { + insertAfterBlock((0,external_lodash_namespaceObject.last)((0,external_lodash_namespaceObject.castArray)(clientIds))); + }, + + onMoveTo() { + setNavigationMode(true); + selectBlock(clientIds[0]); + setBlockMovingClientId(clientIds[0]); + }, + + onGroup() { + if (!blocks.length) { + return; + } + + const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion + + const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName); + + if (!newBlocks) { + return; + } + + replaceBlocks(clientIds, newBlocks); + }, + + onUngroup() { + if (!blocks.length) { + return; + } + + const innerBlocks = blocks[0].innerBlocks; + + if (!innerBlocks.length) { + return; + } + + replaceBlocks(clientIds, innerBlocks); + }, + + onCopy() { + const selectedBlockClientIds = blocks.map(_ref2 => { + let { + clientId + } = _ref2; + return clientId; + }); + + if (blocks.length === 1) { + flashBlock(selectedBlockClientIds[0]); + } + + notifyCopy('copy', selectedBlockClientIds); + } + + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-mode-toggle.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + +function BlockModeToggle(_ref) { + let { + blockType, + mode, + onToggleMode, + small = false, + isCodeEditingEnabled = true + } = _ref; + + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'html', true) || !isCodeEditingEnabled) { + return null; + } + + const label = mode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Edit as HTML') : (0,external_wp_i18n_namespaceObject.__)('Edit visually'); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: onToggleMode + }, !small && label); +} +/* harmony default export */ var block_mode_toggle = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => { + let { + clientId + } = _ref2; + const { + getBlock, + getBlockMode, + getSettings + } = select(store); + const block = getBlock(clientId); + const isCodeEditingEnabled = getSettings().codeEditingEnabled; + return { + mode: getBlockMode(clientId), + blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null, + isCodeEditingEnabled + }; +}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref3) => { + let { + onToggle = external_lodash_namespaceObject.noop, + clientId + } = _ref3; + return { + onToggleMode() { + dispatch(store).toggleBlockMode(clientId); + onToggle(); + } + + }; +})])(BlockModeToggle)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-convert-button.js + + +/** + * WordPress dependencies + */ + + +function BlockConvertButton(_ref) { + let { + shouldRender, + onClick, + small + } = _ref; + + if (!shouldRender) { + return null; + } + + const label = (0,external_wp_i18n_namespaceObject.__)('Convert to Blocks'); + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: onClick + }, !small && label); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-html-convert-button.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +/* harmony default export */ var block_html_convert_button = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, _ref) => { + let { + clientId + } = _ref; + const block = select(store).getBlock(clientId); + return { + block, + shouldRender: block && block.name === 'core/html' + }; +}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref2) => { + let { + block + } = _ref2; + return { + onClick: () => dispatch(store).replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({ + HTML: (0,external_wp_blocks_namespaceObject.getBlockContent)(block) + })) + }; +}))(BlockConvertButton)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js +/** + * WordPress dependencies + */ + +const { + Fill: __unstableBlockSettingsMenuFirstItem, + Slot: block_settings_menu_first_item_Slot +} = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableBlockSettingsMenuFirstItem'); +__unstableBlockSettingsMenuFirstItem.Slot = block_settings_menu_first_item_Slot; +/* harmony default export */ var block_settings_menu_first_item = (__unstableBlockSettingsMenuFirstItem); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +function ConvertToGroupButton(_ref) { + let { + clientIds, + isGroupable, + isUngroupable, + blocksSelection, + groupingBlockName, + onClose = () => {} + } = _ref; + const { + replaceBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + + const onConvertToGroup = () => { + // Activate the `transform` on the Grouping Block which does the conversion + const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName); + + if (newBlocks) { + replaceBlocks(clientIds, newBlocks); + } + }; + + const onConvertFromGroup = () => { + const innerBlocks = blocksSelection[0].innerBlocks; + + if (!innerBlocks.length) { + return; + } + + replaceBlocks(clientIds, innerBlocks); + }; + + if (!isGroupable && !isUngroupable) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isGroupable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onConvertToGroup(); + onClose(); + } + }, (0,external_wp_i18n_namespaceObject._x)('Group', 'verb')), isUngroupable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onConvertFromGroup(); + onClose(); + } + }, (0,external_wp_i18n_namespaceObject._x)('Ungroup', 'Ungrouping blocks from within a Group block back into individual blocks within the Editor '))); +} + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * Contains the properties `ConvertToGroupButton` component needs. + * + * @typedef {Object} ConvertToGroupButtonProps + * @property {string[]} clientIds An array of the selected client ids. + * @property {boolean} isGroupable Indicates if the selected blocks can be grouped. + * @property {boolean} isUngroupable Indicates if the selected blocks can be ungrouped. + * @property {WPBlock[]} blocksSelection An array of the selected blocks. + * @property {string} groupingBlockName The name of block used for handling grouping interactions. + */ + +/** + * Returns the properties `ConvertToGroupButton` component needs to work properly. + * It is used in `BlockSettingsMenuControls` to know if `ConvertToGroupButton` + * should be rendered, to avoid ending up with an empty MenuGroup. + * + * @return {ConvertToGroupButtonProps} Returns the properties needed by `ConvertToGroupButton`. + */ + +function useConvertToGroupButtonProps() { + const { + clientIds, + isGroupable, + isUngroupable, + blocksSelection, + groupingBlockName + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _blocksSelection$; + + const { + getBlockRootClientId, + getBlocksByClientId, + canInsertBlockType, + getSelectedBlockClientIds + } = select(store); + const { + getGroupingBlockName + } = select(external_wp_blocks_namespaceObject.store); + + const _clientIds = getSelectedBlockClientIds(); + + const _groupingBlockName = getGroupingBlockName(); + + const rootClientId = !!(_clientIds !== null && _clientIds !== void 0 && _clientIds.length) ? getBlockRootClientId(_clientIds[0]) : undefined; + const groupingBlockAvailable = canInsertBlockType(_groupingBlockName, rootClientId); + + const _blocksSelection = getBlocksByClientId(_clientIds); + + const isSingleGroupingBlock = _blocksSelection.length === 1 && ((_blocksSelection$ = _blocksSelection[0]) === null || _blocksSelection$ === void 0 ? void 0 : _blocksSelection$.name) === _groupingBlockName; // Do we have + // 1. Grouping block available to be inserted? + // 2. One or more blocks selected + // (we allow single Blocks to become groups unless + // they are a soltiary group block themselves) + + const _isGroupable = groupingBlockAvailable && _blocksSelection.length && !isSingleGroupingBlock; // Do we have a single Group Block selected and does that group have inner blocks? + + + const _isUngroupable = isSingleGroupingBlock && !!_blocksSelection[0].innerBlocks.length; + + return { + clientIds: _clientIds, + isGroupable: _isGroupable, + isUngroupable: _isUngroupable, + blocksSelection: _blocksSelection, + groupingBlockName: _groupingBlockName + }; + }, []); + return { + clientIds, + isGroupable, + isUngroupable, + blocksSelection, + groupingBlockName + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const { + Fill, + Slot: block_settings_menu_controls_Slot +} = (0,external_wp_components_namespaceObject.createSlotFill)('BlockSettingsMenuControls'); + +const BlockSettingsMenuControlsSlot = _ref => { + let { + fillProps, + clientIds = null + } = _ref; + const { + selectedBlocks, + selectedClientIds + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlocksByClientId, + getSelectedBlockClientIds + } = select(store); + const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds(); + return { + selectedBlocks: (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.compact)(getBlocksByClientId(ids)), block => block.name), + selectedClientIds: ids + }; + }, [clientIds]); // Check if current selection of blocks is Groupable or Ungroupable + // and pass this props down to ConvertToGroupButton. + + const convertToGroupButtonProps = useConvertToGroupButtonProps(); + const { + isGroupable, + isUngroupable + } = convertToGroupButtonProps; + const showConvertToGroupButton = isGroupable || isUngroupable; + return (0,external_wp_element_namespaceObject.createElement)(block_settings_menu_controls_Slot, { + fillProps: { ...fillProps, + selectedBlocks, + selectedClientIds + } + }, fills => { + if ((fills === null || fills === void 0 ? void 0 : fills.length) > 0 || showConvertToGroupButton) { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, fills, (0,external_wp_element_namespaceObject.createElement)(ConvertToGroupButton, _extends({}, convertToGroupButtonProps, { + onClose: fillProps === null || fillProps === void 0 ? void 0 : fillProps.onClose + }))); + } + }); +}; +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md + * + * @param {Object} props Fill props. + * @return {WPElement} Element. + */ + + +function BlockSettingsMenuControls(_ref2) { + let { ...props + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, { + document: document + }, (0,external_wp_element_namespaceObject.createElement)(Fill, props)); +} + +BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot; +/* harmony default export */ var block_settings_menu_controls = (BlockSettingsMenuControls); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-dropdown.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const block_settings_dropdown_POPOVER_PROPS = { + className: 'block-editor-block-settings-menu__popover', + position: 'bottom right', + isAlternate: true +}; + +function CopyMenuItem(_ref) { + let { + blocks, + onCopy + } = _ref; + const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(() => (0,external_wp_blocks_namespaceObject.serialize)(blocks), onCopy); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + ref: ref + }, (0,external_wp_i18n_namespaceObject.__)('Copy')); +} + +function BlockSettingsDropdown(_ref2) { + let { + clientIds, + __experimentalSelectBlock, + children, + ...props + } = _ref2; + const blockClientIds = (0,external_lodash_namespaceObject.castArray)(clientIds); + const count = blockClientIds.length; + const firstBlockClientId = blockClientIds[0]; + const { + onlyBlock, + title + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getBlockType; + + const { + getBlockCount, + getBlockName + } = select(store); + const { + getBlockType + } = select(external_wp_blocks_namespaceObject.store); + return { + onlyBlock: 1 === getBlockCount(), + title: (_getBlockType = getBlockType(getBlockName(firstBlockClientId))) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title + }; + }, [firstBlockClientId]); + const shortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getShortcutRepresentation + } = select(external_wp_keyboardShortcuts_namespaceObject.store); + return { + duplicate: getShortcutRepresentation('core/block-editor/duplicate'), + remove: getShortcutRepresentation('core/block-editor/remove'), + insertAfter: getShortcutRepresentation('core/block-editor/insert-after'), + insertBefore: getShortcutRepresentation('core/block-editor/insert-before') + }; + }, []); + const updateSelection = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? async clientIdsPromise => { + const ids = await clientIdsPromise; + + if (ids && ids[0]) { + __experimentalSelectBlock(ids[0]); + } + } : external_lodash_namespaceObject.noop, [__experimentalSelectBlock]); + const label = (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: block name */ + (0,external_wp_i18n_namespaceObject.__)('Remove %s'), title); + const removeBlockLabel = count === 1 ? label : (0,external_wp_i18n_namespaceObject.__)('Remove blocks'); + return (0,external_wp_element_namespaceObject.createElement)(BlockActions, { + clientIds: clientIds, + __experimentalUpdateSelection: !__experimentalSelectBlock + }, _ref3 => { + let { + canDuplicate, + canInsertDefaultBlock, + canMove, + canRemove, + onDuplicate, + onInsertAfter, + onInsertBefore, + onRemove, + onCopy, + onMoveTo, + blocks + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, _extends({ + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Options'), + className: "block-editor-block-settings-menu", + popoverProps: block_settings_dropdown_POPOVER_PROPS, + noIcons: true + }, props), _ref4 => { + let { + onClose + } = _ref4; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(block_settings_menu_first_item.Slot, { + fillProps: { + onClose + } + }), count === 1 && (0,external_wp_element_namespaceObject.createElement)(block_html_convert_button, { + clientId: firstBlockClientId + }), (0,external_wp_element_namespaceObject.createElement)(CopyMenuItem, { + blocks: blocks, + onCopy: onCopy + }), canDuplicate && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: (0,external_lodash_namespaceObject.flow)(onClose, onDuplicate, updateSelection), + shortcut: shortcuts.duplicate + }, (0,external_wp_i18n_namespaceObject.__)('Duplicate')), canInsertDefaultBlock && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: (0,external_lodash_namespaceObject.flow)(onClose, onInsertBefore), + shortcut: shortcuts.insertBefore + }, (0,external_wp_i18n_namespaceObject.__)('Insert before')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: (0,external_lodash_namespaceObject.flow)(onClose, onInsertAfter), + shortcut: shortcuts.insertAfter + }, (0,external_wp_i18n_namespaceObject.__)('Insert after'))), canMove && !onlyBlock && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: (0,external_lodash_namespaceObject.flow)(onClose, onMoveTo) + }, (0,external_wp_i18n_namespaceObject.__)('Move to')), count === 1 && (0,external_wp_element_namespaceObject.createElement)(block_mode_toggle, { + clientId: firstBlockClientId, + onToggle: onClose + })), (0,external_wp_element_namespaceObject.createElement)(block_settings_menu_controls.Slot, { + fillProps: { + onClose + }, + clientIds: clientIds + }), typeof children === 'function' ? children({ + onClose + }) : external_wp_element_namespaceObject.Children.map(child => (0,external_wp_element_namespaceObject.cloneElement)(child, { + onClose + })), canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + onClick: (0,external_lodash_namespaceObject.flow)(onClose, onRemove, updateSelection), + shortcut: shortcuts.remove + }, removeBlockLabel))); + }); + }); +} +/* harmony default export */ var block_settings_dropdown = (BlockSettingsDropdown); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/index.js + + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +function BlockSettingsMenu(_ref) { + let { + clientIds, + ...props + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, toggleProps => (0,external_wp_element_namespaceObject.createElement)(block_settings_dropdown, _extends({ + clientIds: clientIds, + toggleProps: toggleProps + }, props)))); +} +/* harmony default export */ var block_settings_menu = (BlockSettingsMenu); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + + +function BlockToolbar(_ref) { + let { + hideDragHandle + } = _ref; + const { + blockClientIds, + blockClientId, + blockType, + hasFixedToolbar, + hasReducedUI, + isValid, + isVisual + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockName, + getBlockMode, + getSelectedBlockClientIds, + isBlockValid, + getBlockRootClientId, + getSettings + } = select(store); + const selectedBlockClientIds = getSelectedBlockClientIds(); + const selectedBlockClientId = selectedBlockClientIds[0]; + const blockRootClientId = getBlockRootClientId(selectedBlockClientId); + const settings = getSettings(); + return { + blockClientIds: selectedBlockClientIds, + blockClientId: selectedBlockClientId, + blockType: selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(getBlockName(selectedBlockClientId)), + hasFixedToolbar: settings.hasFixedToolbar, + hasReducedUI: settings.hasReducedUI, + rootClientId: blockRootClientId, + isValid: selectedBlockClientIds.every(id => isBlockValid(id)), + isVisual: selectedBlockClientIds.every(id => getBlockMode(id) === 'visual') + }; + }, []); // Handles highlighting the current block outline on hover or focus of the + // block type toolbar area. + + const { + toggleBlockHighlight + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const nodeRef = (0,external_wp_element_namespaceObject.useRef)(); + const { + showMovers, + gestures: showMoversGestures + } = useShowMoversGestures({ + ref: nodeRef, + + onChange(isFocused) { + if (isFocused && hasReducedUI) { + return; + } + + toggleBlockHighlight(blockClientId, isFocused); + } + + }); // Account for the cases where the block toolbar is rendered within the + // header area and not contextually to the block. + + const displayHeaderToolbar = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<') || hasFixedToolbar; + + if (blockType) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, '__experimentalToolbar', true)) { + return null; + } + } + + const shouldShowMovers = displayHeaderToolbar || showMovers; + + if (blockClientIds.length === 0) { + return null; + } + + const shouldShowVisualToolbar = isValid && isVisual; + const isMultiToolbar = blockClientIds.length > 1; + const classes = classnames_default()('block-editor-block-toolbar', shouldShowMovers && 'is-showing-movers'); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: classes + }, !isMultiToolbar && !displayHeaderToolbar && (0,external_wp_element_namespaceObject.createElement)(BlockParentSelector, { + clientIds: blockClientIds + }), (0,external_wp_element_namespaceObject.createElement)("div", _extends({ + ref: nodeRef + }, showMoversGestures), (shouldShowVisualToolbar || isMultiToolbar) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, { + className: "block-editor-block-toolbar__block-controls" + }, (0,external_wp_element_namespaceObject.createElement)(block_switcher, { + clientIds: blockClientIds + }), (0,external_wp_element_namespaceObject.createElement)(block_mover, { + clientIds: blockClientIds, + hideDragHandle: hideDragHandle || hasReducedUI + }))), shouldShowVisualToolbar && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, { + group: "parent", + className: "block-editor-block-toolbar__slot" + }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, { + group: "block", + className: "block-editor-block-toolbar__slot" + }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, { + className: "block-editor-block-toolbar__slot" + }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, { + group: "inline", + className: "block-editor-block-toolbar__slot" + }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, { + group: "other", + className: "block-editor-block-toolbar__slot" + })), (0,external_wp_element_namespaceObject.createElement)(block_settings_menu, { + clientIds: blockClientIds + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-contextual-toolbar.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + +function BlockContextualToolbar(_ref) { + let { + focusOnMount, + isFixed, + ...props + } = _ref; + const { + blockType, + hasParents, + showParentSelector + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockName, + getBlockParents, + getSelectedBlockClientIds + } = select(store); + const { + getBlockType + } = select(external_wp_blocks_namespaceObject.store); + const selectedBlockClientIds = getSelectedBlockClientIds(); + const selectedBlockClientId = selectedBlockClientIds[0]; + const parents = getBlockParents(selectedBlockClientId); + const firstParentClientId = parents[parents.length - 1]; + const parentBlockName = getBlockName(firstParentClientId); + const parentBlockType = getBlockType(parentBlockName); + return { + blockType: selectedBlockClientId && getBlockType(getBlockName(selectedBlockClientId)), + hasParents: parents.length, + showParentSelector: (0,external_wp_blocks_namespaceObject.hasBlockSupport)(parentBlockType, '__experimentalParentSelector', true) && selectedBlockClientIds.length <= 1 + }; + }, []); + + if (blockType) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, '__experimentalToolbar', true)) { + return null; + } + } // Shifts the toolbar to make room for the parent block selector. + + + const classes = classnames_default()('block-editor-block-contextual-toolbar', { + 'has-parent': hasParents && showParentSelector, + 'is-fixed': isFixed + }); + return (0,external_wp_element_namespaceObject.createElement)(navigable_toolbar, _extends({ + focusOnMount: focusOnMount, + className: classes + /* translators: accessibility text for the block toolbar */ + , + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block tools') + }, props), (0,external_wp_element_namespaceObject.createElement)(BlockToolbar, { + hideDragHandle: isFixed + })); +} + +/* harmony default export */ var block_contextual_toolbar = (BlockContextualToolbar); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-popover.js /** @@ -48591,7 +27684,7 @@ var use_popover_scroll = __webpack_require__("2z9l"); -function selector(select) { +function block_popover_selector(select) { const { isNavigationMode, isMultiSelecting, @@ -48600,7 +27693,7 @@ function selector(select) { isCaretWithinFormattedText, getSettings, getLastMultiSelectedBlockClientId - } = select(store["a" /* store */]); + } = select(store); return { isNavigationMode: isNavigationMode(), isMultiSelecting: isMultiSelecting(), @@ -48630,13 +27723,13 @@ function BlockPopover(_ref) { hasMultiSelection, hasFixedToolbar, lastClientId - } = Object(external_wp_data_["useSelect"])(selector, []); - const isInsertionPointVisible = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(block_popover_selector, []); + const isInsertionPointVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isBlockInsertionPointVisible, getBlockInsertionPoint, getBlockOrder - } = select(store["a" /* store */]); + } = select(store); if (!isBlockInsertionPointVisible()) { return false; @@ -48646,36 +27739,36 @@ function BlockPopover(_ref) { const order = getBlockOrder(insertionPoint.rootClientId); return order[insertionPoint.index] === clientId; }, [clientId]); - const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium'); - const [isToolbarForced, setIsToolbarForced] = Object(external_wp_element_["useState"])(false); - const [isInserterShown, setIsInserterShown] = Object(external_wp_element_["useState"])(false); + const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); + const [isToolbarForced, setIsToolbarForced] = (0,external_wp_element_namespaceObject.useState)(false); + const [isInserterShown, setIsInserterShown] = (0,external_wp_element_namespaceObject.useState)(false); const { stopTyping - } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); // Controls when the side inserter on empty lines should + } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Controls when the side inserter on empty lines should // be shown, including writing and selection modes. const showEmptyBlockSideInserter = !isTyping && !isNavigationMode && isEmptyDefaultBlock && isValid; const shouldShowBreadcrumb = isNavigationMode; const shouldShowContextualToolbar = !isNavigationMode && !hasFixedToolbar && isLargeViewport && !showEmptyBlockSideInserter && !isMultiSelecting && (!isTyping || isCaretWithinFormattedText); const canFocusHiddenToolbar = !isNavigationMode && !shouldShowContextualToolbar && !hasFixedToolbar && !isEmptyDefaultBlock; - Object(external_wp_keyboardShortcuts_["useShortcut"])('core/block-editor/focus-toolbar', () => { + (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => { setIsToolbarForced(true); stopTyping(true); }, { isDisabled: !canFocusHiddenToolbar }); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!shouldShowContextualToolbar) { setIsToolbarForced(false); } }, [shouldShowContextualToolbar]); // Stores the active toolbar item index so the block toolbar can return focus // to it when re-mounting. - const initialToolbarItemIndexRef = Object(external_wp_element_["useRef"])(); - const selectedElement = Object(use_block_refs["a" /* __unstableUseBlockElement */])(clientId); - const lastSelectedElement = Object(use_block_refs["a" /* __unstableUseBlockElement */])(lastClientId); - const capturingElement = Object(use_block_refs["a" /* __unstableUseBlockElement */])(capturingClientId); - const popoverScrollRef = Object(use_popover_scroll["a" /* usePopoverScroll */])(__unstableContentRef); + const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)(); + const selectedElement = useBlockElement(clientId); + const lastSelectedElement = useBlockElement(lastClientId); + const capturingElement = useBlockElement(capturingClientId); + const popoverScrollRef = usePopoverScroll(__unstableContentRef); if (!shouldShowBreadcrumb && !shouldShowContextualToolbar && !isToolbarForced && !showEmptyBlockSideInserter) { return null; @@ -48726,8 +27819,8 @@ function BlockPopover(_ref) { // the block toolbar becomes sticky when the block scolls out of view. // In case of an iframe, this should be the iframe boundary, otherwise // the scroll container. - ownerDocument.defaultView.frameElement || Object(external_wp_dom_["getScrollContainer"])(node) || ownerDocument.body; - return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { + ownerDocument.defaultView.frameElement || (0,external_wp_dom_namespaceObject.getScrollContainer)(node) || ownerDocument.body; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { ref: popoverScrollRef, noArrow: true, animate: false, @@ -48748,7 +27841,7 @@ function BlockPopover(_ref) { // obscure specific sections of a block. , __unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current - }, (shouldShowContextualToolbar || isToolbarForced) && Object(external_wp_element_["createElement"])("div", { + }, (shouldShowContextualToolbar || isToolbarForced) && (0,external_wp_element_namespaceObject.createElement)("div", { onFocus: onFocus, onBlur: onBlur // While ideally it would be enough to capture the // bubbling focus event from the Inserter, due to the @@ -48761,11 +27854,11 @@ function BlockPopover(_ref) { className: classnames_default()('block-editor-block-list__block-popover-inserter', { 'is-visible': isInserterShown }) - }, Object(external_wp_element_["createElement"])(inserter["a" /* default */], { + }, (0,external_wp_element_namespaceObject.createElement)(inserter, { clientId: clientId, rootClientId: rootClientId, __experimentalIsQuick: true - })), (shouldShowContextualToolbar || isToolbarForced) && Object(external_wp_element_["createElement"])(block_contextual_toolbar["a" /* default */] // If the toolbar is being shown because of being forced + })), (shouldShowContextualToolbar || isToolbarForced) && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar // If the toolbar is being shown because of being forced // it should focus the toolbar right after the mount. , { focusOnMount: isToolbarForced, @@ -48776,13 +27869,13 @@ function BlockPopover(_ref) { // this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169 , key: clientId - }), shouldShowBreadcrumb && Object(external_wp_element_["createElement"])(block_selection_button, { + }), shouldShowBreadcrumb && (0,external_wp_element_namespaceObject.createElement)(block_selection_button, { clientId: clientId, rootClientId: rootClientId, blockElement: node - }), showEmptyBlockSideInserter && Object(external_wp_element_["createElement"])("div", { + }), showEmptyBlockSideInserter && (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-editor-block-list__empty-block-inserter" - }, Object(external_wp_element_["createElement"])(inserter["a" /* default */], { + }, (0,external_wp_element_namespaceObject.createElement)(inserter, { position: "bottom right", rootClientId: rootClientId, clientId: clientId, @@ -48798,7 +27891,7 @@ function wrapperSelector(select) { getBlock, getBlockParents, __experimentalGetBlockListSettingsForBlocks - } = select(store["a" /* store */]); + } = select(store); const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId(); if (!clientId) { @@ -48815,7 +27908,7 @@ function wrapperSelector(select) { const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting. - const capturingClientId = Object(external_lodash_["find"])(blockParentsClientIds, parentClientId => { + const capturingClientId = (0,external_lodash_namespaceObject.find)(blockParentsClientIds, parentClientId => { var _parentBlockListSetti; return (_parentBlockListSetti = parentBlockListSettings[parentClientId]) === null || _parentBlockListSetti === void 0 ? void 0 : _parentBlockListSetti.__experimentalCaptureToolbars; @@ -48825,7 +27918,7 @@ function wrapperSelector(select) { rootClientId: getBlockRootClientId(clientId), name, isValid, - isEmptyDefaultBlock: name && Object(external_wp_blocks_["isUnmodifiedDefaultBlock"])({ + isEmptyDefaultBlock: name && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)({ name, attributes }), @@ -48838,7 +27931,7 @@ function WrappedBlockPopover(_ref2) { __unstablePopoverSlot, __unstableContentRef } = _ref2; - const selected = Object(external_wp_data_["useSelect"])(wrapperSelector, []); + const selected = (0,external_wp_data_namespaceObject.useSelect)(wrapperSelector, []); if (!selected) { return null; @@ -48857,7 +27950,7 @@ function WrappedBlockPopover(_ref2) { return null; } - return Object(external_wp_element_["createElement"])(BlockPopover, { + return (0,external_wp_element_namespaceObject.createElement)(BlockPopover, { clientId: clientId, rootClientId: rootClientId, isValid: isValid, @@ -48868,181 +27961,13 @@ function WrappedBlockPopover(_ref2) { }); } - -/***/ }), - -/***/ "xN+R": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/back-compat.js /** * WordPress dependencies */ -const dragHandle = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - width: "18", - height: "18", - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 18 18" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z" -})); -/* harmony default export */ __webpack_exports__["a"] = (dragHandle); - - -/***/ }), - -/***/ "xTGt": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["blob"]; }()); - -/***/ }), - -/***/ "xZzQ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/tips.js - - -/** - * WordPress dependencies - */ - - - -const globalTips = [Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('While writing, you can press / to quickly insert new blocks.'), { - kbd: Object(external_wp_element_["createElement"])("kbd", null) -}), Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('Indent a list by pressing space at the beginning of a line.'), { - kbd: Object(external_wp_element_["createElement"])("kbd", null) -}), Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('Outdent a list by pressing backspace at the beginning of a line.'), { - kbd: Object(external_wp_element_["createElement"])("kbd", null) -}), Object(external_wp_i18n_["__"])('Drag files into the editor to automatically insert media blocks.'), Object(external_wp_i18n_["__"])("Change a block's type by pressing the block icon on the toolbar.")]; - -function Tips() { - const [randomIndex] = Object(external_wp_element_["useState"])( // Disable Reason: I'm not generating an HTML id. - // eslint-disable-next-line no-restricted-syntax - Math.floor(Math.random() * globalTips.length)); - return Object(external_wp_element_["createElement"])(external_wp_components_["Tip"], null, globalTips[randomIndex]); -} - -/* harmony default export */ var tips = (Tips); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-card/index.js -var block_card = __webpack_require__("GvwK"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js + 2 modules -var block_preview = __webpack_require__("REKd"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/preview-panel.js - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - -function InserterPreviewPanel(_ref) { - var _hoveredItemBlockType, _hoveredItemBlockType2; - - let { - item - } = _ref; - const { - name, - title, - icon, - description, - initialAttributes - } = item; - const hoveredItemBlockType = Object(external_wp_blocks_["getBlockType"])(name); - const isReusable = Object(external_wp_blocks_["isReusableBlock"])(item); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__preview-container" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__preview" - }, isReusable || hoveredItemBlockType !== null && hoveredItemBlockType !== void 0 && hoveredItemBlockType.example ? Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__preview-content" - }, Object(external_wp_element_["createElement"])(block_preview["a" /* default */], { - __experimentalPadding: 16, - viewportWidth: (_hoveredItemBlockType = (_hoveredItemBlockType2 = hoveredItemBlockType.example) === null || _hoveredItemBlockType2 === void 0 ? void 0 : _hoveredItemBlockType2.viewportWidth) !== null && _hoveredItemBlockType !== void 0 ? _hoveredItemBlockType : 500, - blocks: hoveredItemBlockType.example ? Object(external_wp_blocks_["getBlockFromExample"])(item.name, { - attributes: { ...hoveredItemBlockType.example.attributes, - ...initialAttributes - }, - innerBlocks: hoveredItemBlockType.example.innerBlocks - }) : Object(external_wp_blocks_["createBlock"])(name, initialAttributes) - })) : Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__preview-content-missing" - }, Object(external_wp_i18n_["__"])('No Preview Available.'))), !isReusable && Object(external_wp_element_["createElement"])(block_card["a" /* default */], { - title: title, - icon: icon, - description: description - })); -} - -/* harmony default export */ var preview_panel = (InserterPreviewPanel); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-types-list/index.js + 1 modules -var block_types_list = __webpack_require__("6ZVF"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/panel.js -var panel = __webpack_require__("mdLt"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-block-types-state.js -var use_block_types_state = __webpack_require__("+G0a"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/index.js -var inserter_listbox = __webpack_require__("wiT/"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-types-tab.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - /** @@ -49051,396 +27976,605 @@ var inserter_listbox = __webpack_require__("wiT/"); - - - -const getBlockNamespace = item => item.name.split('/')[0]; - -const MAX_SUGGESTED_ITEMS = 6; -/** - * Shared reference to an empty array for cases where it is important to avoid - * returning a new array reference on every invocation and rerendering the component. - * - * @type {Array} - */ - -const EMPTY_ARRAY = []; -function BlockTypesTab(_ref) { +function BlockToolsBackCompat(_ref) { let { - rootClientId, - onInsert, - onHover, - showMostUsedBlocks + children } = _ref; - const [items, categories, collections, onSelectItem] = Object(use_block_types_state["a" /* default */])(rootClientId, onInsert); - const suggestedItems = Object(external_wp_element_["useMemo"])(() => { - return Object(external_lodash_["orderBy"])(items, ['frecency'], ['desc']).slice(0, MAX_SUGGESTED_ITEMS); - }, [items]); - const uncategorizedItems = Object(external_wp_element_["useMemo"])(() => { - return items.filter(item => !item.category); - }, [items]); - const itemsPerCategory = Object(external_wp_element_["useMemo"])(() => { - return Object(external_lodash_["flow"])(itemList => itemList.filter(item => item.category && item.category !== 'reusable'), itemList => Object(external_lodash_["groupBy"])(itemList, 'category'))(items); - }, [items]); - const itemsPerCollection = Object(external_wp_element_["useMemo"])(() => { - // Create a new Object to avoid mutating collection. - const result = { ...collections - }; - Object.keys(collections).forEach(namespace => { - result[namespace] = items.filter(item => getBlockNamespace(item) === namespace); + const openRef = (0,external_wp_element_namespaceObject.useContext)(InsertionPointOpenRef); + const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // If context is set, `BlockTools` is a parent component. - if (result[namespace].length === 0) { - delete result[namespace]; - } - }); - return result; - }, [items, collections]); // Hide block preview on unmount. - - Object(external_wp_element_["useEffect"])(() => () => onHover(null), []); - /** - * The inserter contains a big number of blocks and opening it is a costful operation. - * The rendering is the most costful part of it, in order to improve the responsiveness - * of the "opening" action, these lazy lists allow us to render the inserter category per category, - * once all the categories are rendered, we start rendering the collections and the uncategorized block types. - */ - - const currentlyRenderedCategories = Object(external_wp_compose_["useAsyncList"])(categories); - const didRenderAllCategories = categories.length === currentlyRenderedCategories.length; // Async List requires an array - - const collectionEntries = Object(external_wp_element_["useMemo"])(() => { - return Object.entries(collections); - }, [collections]); - const currentlyRenderedCollections = Object(external_wp_compose_["useAsyncList"])(didRenderAllCategories ? collectionEntries : EMPTY_ARRAY); - return Object(external_wp_element_["createElement"])(inserter_listbox["a" /* default */], null, Object(external_wp_element_["createElement"])("div", null, showMostUsedBlocks && !!suggestedItems.length && Object(external_wp_element_["createElement"])(panel["a" /* default */], { - title: Object(external_wp_i18n_["_x"])('Most used', 'blocks') - }, Object(external_wp_element_["createElement"])(block_types_list["a" /* default */], { - items: suggestedItems, - onSelect: onSelectItem, - onHover: onHover, - label: Object(external_wp_i18n_["_x"])('Most used', 'blocks') - })), Object(external_lodash_["map"])(currentlyRenderedCategories, category => { - const categoryItems = itemsPerCategory[category.slug]; - - if (!categoryItems || !categoryItems.length) { - return null; - } - - return Object(external_wp_element_["createElement"])(panel["a" /* default */], { - key: category.slug, - title: category.title, - icon: category.icon - }, Object(external_wp_element_["createElement"])(block_types_list["a" /* default */], { - items: categoryItems, - onSelect: onSelectItem, - onHover: onHover, - label: category.title - })); - }), didRenderAllCategories && uncategorizedItems.length > 0 && Object(external_wp_element_["createElement"])(panel["a" /* default */], { - className: "block-editor-inserter__uncategorized-blocks-panel", - title: Object(external_wp_i18n_["__"])('Uncategorized') - }, Object(external_wp_element_["createElement"])(block_types_list["a" /* default */], { - items: uncategorizedItems, - onSelect: onSelectItem, - onHover: onHover, - label: Object(external_wp_i18n_["__"])('Uncategorized') - })), Object(external_lodash_["map"])(currentlyRenderedCollections, _ref2 => { - let [namespace, collection] = _ref2; - const collectionItems = itemsPerCollection[namespace]; - - if (!collectionItems || !collectionItems.length) { - return null; - } - - return Object(external_wp_element_["createElement"])(panel["a" /* default */], { - key: namespace, - title: collection.title, - icon: collection.icon - }, Object(external_wp_element_["createElement"])(block_types_list["a" /* default */], { - items: collectionItems, - onSelect: onSelectItem, - onHover: onHover, - label: collection.title - })); - }))); -} -/* harmony default export */ var block_types_tab = (BlockTypesTab); - -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/pattern-panel.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -function PatternInserterPanel(_ref) { - let { - selectedCategory, - patternCategories, - onClickCategory, - openPatternExplorer - } = _ref; - const isMobile = Object(external_wp_compose_["useViewportMatch"])('medium', '<'); - - const categoryOptions = () => { - const options = []; - patternCategories.map(patternCategory => { - return options.push({ - value: patternCategory.name, - label: patternCategory.label - }); - }); - return options; - }; - - const onChangeSelect = selected => { - onClickCategory(patternCategories.find(patternCategory => selected === patternCategory.name)); - }; - - const className = classnames_default()('block-editor-inserter__panel-header', 'block-editor-inserter__panel-header-patterns'); // In iOS-based mobile devices, the onBlur will fire when selecting an option - // from a Select element. To prevent closing the useDialog on iOS devices, we - // stop propagating the onBlur event if there is no relatedTarget, which means - // that the user most likely did not click on an element within the editor canvas. - - const onBlur = event => { - if (!(event !== null && event !== void 0 && event.relatedTarget)) { - event.stopPropagation(); - } - }; - - return Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], { - justify: "space-between", - align: "start", - gap: "4", - className: className - }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], { - isBlock: true - }, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - className: "block-editor-inserter__panel-dropdown", - label: Object(external_wp_i18n_["__"])('Filter patterns'), - hideLabelFromVision: true, - value: selectedCategory.name, - onChange: onChangeSelect, - onBlur: onBlur, - options: categoryOptions() - })), !isMobile && Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - variant: "secondary", - className: "block-editor-inserter__patterns-explorer-expand", - label: Object(external_wp_i18n_["__"])('Explore all patterns'), - onClick: () => openPatternExplorer() - }, Object(external_wp_i18n_["_x"])('Explore', 'Label for showing all block patterns')))); -} - -/* harmony default export */ var pattern_panel = (PatternInserterPanel); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-state.js -var use_patterns_state = __webpack_require__("nQUx"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-patterns-list/index.js -var block_patterns_list = __webpack_require__("Fmc1"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/sidebar.js - - -/** - * WordPress dependencies - */ - - - -function PatternCategoriesList(_ref) { - let { - selectedCategory, - patternCategories, - onClickCategory - } = _ref; - const baseClassName = 'block-editor-block-patterns-explorer__sidebar'; - return Object(external_wp_element_["createElement"])("div", { - className: `${baseClassName}__categories-list` - }, patternCategories.map(_ref2 => { - let { - name, - label - } = _ref2; - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - key: name, - label: label, - className: `${baseClassName}__categories-list__item`, - isPressed: selectedCategory === name, - onClick: () => { - onClickCategory(name); - } - }, label); - })); -} - -function PatternsExplorerSearch(_ref3) { - let { - filterValue, - setFilterValue - } = _ref3; - const baseClassName = 'block-editor-block-patterns-explorer__search'; - return Object(external_wp_element_["createElement"])("div", { - className: baseClassName - }, Object(external_wp_element_["createElement"])(external_wp_components_["SearchControl"], { - onChange: setFilterValue, - value: filterValue, - label: Object(external_wp_i18n_["__"])('Search for patterns'), - placeholder: Object(external_wp_i18n_["__"])('Search') - })); -} - -function PatternExplorerSidebar(_ref4) { - let { - selectedCategory, - patternCategories, - onClickCategory, - filterValue, - setFilterValue - } = _ref4; - const baseClassName = 'block-editor-block-patterns-explorer__sidebar'; - return Object(external_wp_element_["createElement"])("div", { - className: baseClassName - }, Object(external_wp_element_["createElement"])(PatternsExplorerSearch, { - filterValue: filterValue, - setFilterValue: setFilterValue - }), !filterValue && Object(external_wp_element_["createElement"])(PatternCategoriesList, { - selectedCategory: selectedCategory, - patternCategories: patternCategories, - onClickCategory: onClickCategory - })); -} - -/* harmony default export */ var sidebar = (PatternExplorerSidebar); - -// EXTERNAL MODULE: external ["wp","a11y"] -var external_wp_a11y_ = __webpack_require__("gdqT"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/no-results.js -var no_results = __webpack_require__("LolH"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js -var use_insertion_point = __webpack_require__("AORF"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js -var search_items = __webpack_require__("pOGT"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/patterns-list.js - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - - -const INITIAL_INSERTER_RESULTS = 2; - -function PatternsListHeader(_ref) { - let { - filterValue, - filteredBlockPatternsLength - } = _ref; - - if (!filterValue) { - return null; + if (openRef || isDisabled) { + return children; } - return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalHeading"], { - level: 2, - lineHeight: '48px', - className: "block-editor-block-patterns-explorer__search-results-count" - }, Object(external_wp_i18n_["sprintf"])( - /* translators: %d: number of patterns. %s: block pattern search query */ - Object(external_wp_i18n_["_n"])('%1$d pattern found for "%2$s"', '%1$d patterns found for "%2$s"', filteredBlockPatternsLength), filteredBlockPatternsLength, filterValue)); + external_wp_deprecated_default()('wp.components.Popover.Slot name="block-toolbar"', { + alternative: 'wp.blockEditor.BlockTools' + }); + return (0,external_wp_element_namespaceObject.createElement)(InsertionPoint, { + __unstablePopoverSlot: "block-toolbar" + }, (0,external_wp_element_namespaceObject.createElement)(WrappedBlockPopover, { + __unstablePopoverSlot: "block-toolbar" + }), children); } -function PatternList(_ref2) { - let { - filterValue, - selectedCategory, - patternCategories - } = _ref2; - const debouncedSpeak = Object(external_wp_compose_["useDebounce"])(external_wp_a11y_["speak"], 500); - const [destinationRootClientId, onInsertBlocks] = Object(use_insertion_point["a" /* default */])({ - shouldFocusBlock: true - }); - const [allPatterns,, onSelectBlockPattern] = Object(use_patterns_state["a" /* default */])(onInsertBlocks, destinationRootClientId); - const registeredPatternCategories = Object(external_wp_element_["useMemo"])(() => patternCategories.map(patternCategory => patternCategory.name), [patternCategories]); - const filteredBlockPatterns = Object(external_wp_element_["useMemo"])(() => { - if (!filterValue) { - return allPatterns.filter(pattern => { - var _pattern$categories, _pattern$categories2; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/with-client-id.js - return selectedCategory === 'uncategorized' ? !((_pattern$categories = pattern.categories) !== null && _pattern$categories !== void 0 && _pattern$categories.length) || pattern.categories.every(category => !registeredPatternCategories.includes(category)) : (_pattern$categories2 = pattern.categories) === null || _pattern$categories2 === void 0 ? void 0 : _pattern$categories2.includes(selectedCategory); - }); + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const withClientId = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => { + const { + clientId + } = useBlockEditContext(); + return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, { + clientId: clientId + })); +}, 'withClientId'); +/* harmony default export */ var with_client_id = (withClientId); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/button-block-appender.js + + +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + +const button_block_appender_ButtonBlockAppender = _ref => { + let { + clientId, + showSeparator, + isFloating, + onAddBlock, + isToggle + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(button_block_appender, { + className: classnames_default()({ + 'block-list-appender__toggle': isToggle + }), + rootClientId: clientId, + showSeparator: showSeparator, + isFloating: isFloating, + onAddBlock: onAddBlock + }); +}; +/* harmony default export */ var inner_blocks_button_block_appender = (with_client_id(button_block_appender_ButtonBlockAppender)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/default-block-appender.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const default_block_appender_DefaultBlockAppender = _ref => { + let { + clientId, + lastBlockClientId + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(default_block_appender, { + rootClientId: clientId, + lastBlockClientId: lastBlockClientId + }); +}; +/* harmony default export */ var inner_blocks_default_block_appender = ((0,external_wp_compose_namespaceObject.compose)([with_client_id, (0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => { + let { + clientId + } = _ref2; + const { + getBlockOrder + } = select(store); + const blockClientIds = getBlockOrder(clientId); + return { + lastBlockClientId: (0,external_lodash_namespaceObject.last)(blockClientIds) + }; +})])(default_block_appender_DefaultBlockAppender)); + +;// CONCATENATED MODULE: external ["wp","isShallowEqual"] +var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; +var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-nested-settings-update.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +/** + * This hook is a side effect which updates the block-editor store when changes + * happen to inner block settings. The given props are transformed into a + * settings object, and if that is different from the current settings object in + * the block-editor store, then the store is updated with the new settings which + * came from props. + * + * @param {string} clientId The client ID of the block to update. + * @param {string[]} allowedBlocks An array of block names which are permitted + * in inner blocks. + * @param {?Array} __experimentalDefaultBlock The default block to insert: [ blockName, { blockAttributes } ]. + * @param {?Function|boolean} __experimentalDirectInsert If a default block should be inserted directly by the + * appender. + * @param {string} [templateLock] The template lock specified for the inner + * blocks component. (e.g. "all") + * @param {boolean} captureToolbars Whether or children toolbars should be shown + * in the inner blocks component rather than on + * the child block. + * @param {string} orientation The direction in which the block + * should face. + * @param {Object} layout The layout object for the block container. + */ + +function useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout) { + const { + updateBlockListSettings + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + blockListSettings, + parentLock + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const rootClientId = select(store).getBlockRootClientId(clientId); + return { + blockListSettings: select(store).getBlockListSettings(clientId), + parentLock: select(store).getTemplateLock(rootClientId) + }; + }, [clientId]); // Memoize as inner blocks implementors often pass a new array on every + // render. + + const _allowedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => allowedBlocks, allowedBlocks); + + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + const newSettings = { + allowedBlocks: _allowedBlocks, + templateLock: templateLock === undefined ? parentLock : templateLock + }; // These values are not defined for RN, so only include them if they + // are defined. + + if (captureToolbars !== undefined) { + newSettings.__experimentalCaptureToolbars = captureToolbars; + } // Orientation depends on layout, + // ideally the separate orientation prop should be deprecated. + + + if (orientation !== undefined) { + newSettings.orientation = orientation; + } else { + const layoutType = getLayoutType(layout === null || layout === void 0 ? void 0 : layout.type); + newSettings.orientation = layoutType.getOrientation(layout); } - return Object(search_items["b" /* searchItems */])(allPatterns, filterValue); - }, [filterValue, selectedCategory, allPatterns]); // Announce search results on change. + if (__experimentalDefaultBlock !== undefined) { + newSettings.__experimentalDefaultBlock = __experimentalDefaultBlock; + } - Object(external_wp_element_["useEffect"])(() => { - if (!filterValue) { + if (__experimentalDirectInsert !== undefined) { + newSettings.__experimentalDirectInsert = __experimentalDirectInsert; + } + + if (!external_wp_isShallowEqual_default()(blockListSettings, newSettings)) { + updateBlockListSettings(clientId, newSettings); + } + }, [clientId, blockListSettings, _allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, parentLock, captureToolbars, orientation, updateBlockListSettings, layout]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-inner-block-template-sync.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * This hook makes sure that a block's inner blocks stay in sync with the given + * block "template". The template is a block hierarchy to which inner blocks must + * conform. If the blocks get "out of sync" with the template and the template + * is meant to be locked (e.g. templateLock = "all"), then we replace the inner + * blocks with the correct value after synchronizing it with the template. + * + * @param {string} clientId The block client ID. + * @param {Object} template The template to match. + * @param {string} templateLock The template lock state for the inner blocks. For + * example, if the template lock is set to "all", + * then the inner blocks will stay in sync with the + * template. If not defined or set to false, then + * the inner blocks will not be synchronized with + * the given template. + * @param {boolean} templateInsertUpdatesSelection Whether or not to update the + * block-editor selection state when inner blocks + * are replaced after template synchronization. + */ + +function useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection) { + const { + getSelectedBlocksInitialCaretPosition + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + replaceInnerBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const innerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlocks(clientId), [clientId]); // Maintain a reference to the previous value so we can do a deep equality check. + + const existingTemplate = (0,external_wp_element_namespaceObject.useRef)(null); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + // Only synchronize innerBlocks with template if innerBlocks are empty or + // a locking all exists directly on the block. + if (innerBlocks.length === 0 || templateLock === 'all') { + const hasTemplateChanged = !(0,external_lodash_namespaceObject.isEqual)(template, existingTemplate.current); + + if (hasTemplateChanged) { + existingTemplate.current = template; + const nextBlocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(innerBlocks, template); + + if (!(0,external_lodash_namespaceObject.isEqual)(nextBlocks, innerBlocks)) { + replaceInnerBlocks(clientId, nextBlocks, innerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0, // This ensures the "initialPosition" doesn't change when applying the template + // If we're supposed to focus the block, we'll focus the first inner block + // otherwise, we won't apply any auto-focus. + // This ensures for instance that the focus stays in the inserter when inserting the "buttons" block. + getSelectedBlocksInitialCaretPosition()); + } + } + } + }, [innerBlocks, template, templateLock, clientId]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/get-block-context.js +/** + * External dependencies + */ + +/** + * Block context cache, implemented as a WeakMap mapping block types to a + * WeakMap mapping attributes object to context value. + * + * @type {WeakMap>} + */ + +const BLOCK_CONTEXT_CACHE = new WeakMap(); +/** + * Returns a cached context object value for a given set of attributes for the + * block type. + * + * @param {Record} attributes Block attributes object. + * @param {WPBlockType} blockType Block type settings. + * + * @return {Record} Context value. + */ + +function getBlockContext(attributes, blockType) { + if (!BLOCK_CONTEXT_CACHE.has(blockType)) { + BLOCK_CONTEXT_CACHE.set(blockType, new WeakMap()); + } + + const blockTypeCache = BLOCK_CONTEXT_CACHE.get(blockType); + + if (!blockTypeCache.has(attributes)) { + const context = (0,external_lodash_namespaceObject.mapValues)(blockType.providesContext, attributeName => attributes[attributeName]); + blockTypeCache.set(attributes, context); + } + + return blockTypeCache.get(attributes); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-on-block-drop/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */ + +/** + * Retrieve the data for a block drop event. + * + * @param {WPSyntheticEvent} event The drop event. + * + * @return {Object} An object with block drag and drop data. + */ + +function parseDropEvent(event) { + let result = { + srcRootClientId: null, + srcClientIds: null, + srcIndex: null, + type: null, + blocks: null + }; + + if (!event.dataTransfer) { + return result; + } + + try { + result = Object.assign(result, JSON.parse(event.dataTransfer.getData('wp-blocks'))); + } catch (err) { + return result; + } + + return result; +} +/** + * A function that returns an event handler function for block drop events. + * + * @param {string} targetRootClientId The root client id where the block(s) will be inserted. + * @param {number} targetBlockIndex The index where the block(s) will be inserted. + * @param {Function} getBlockIndex A function that gets the index of a block. + * @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks. + * @param {Function} moveBlocksToPosition A function that moves blocks. + * @param {Function} insertBlocks A function that inserts blocks. + * @param {Function} clearSelectedBlock A function that clears block selection. + * @return {Function} The event handler for a block drop event. + */ + +function onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocksToPosition, insertBlocks, clearSelectedBlock) { + return event => { + const { + srcRootClientId: sourceRootClientId, + srcClientIds: sourceClientIds, + type: dropType, + blocks + } = parseDropEvent(event); // If the user is inserting a block + + if (dropType === 'inserter') { + clearSelectedBlock(); + const blocksToInsert = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); + insertBlocks(blocksToInsert, targetBlockIndex, targetRootClientId, true, null); + } // If the user is moving a block + + + if (dropType === 'block') { + const sourceBlockIndex = getBlockIndex(sourceClientIds[0]); // If the user is dropping to the same position, return early. + + if (sourceRootClientId === targetRootClientId && sourceBlockIndex === targetBlockIndex) { + return; + } // If the user is attempting to drop a block within its own + // nested blocks, return early as this would create infinite + // recursion. + + + if (sourceClientIds.includes(targetRootClientId) || getClientIdsOfDescendants(sourceClientIds).some(id => id === targetRootClientId)) { + return; + } + + const isAtSameLevel = sourceRootClientId === targetRootClientId; + const draggedBlockCount = sourceClientIds.length; // If the block is kept at the same level and moved downwards, + // subtract to take into account that the blocks being dragged + // were removed from the block list above the insertion point. + + const insertIndex = isAtSameLevel && sourceBlockIndex < targetBlockIndex ? targetBlockIndex - draggedBlockCount : targetBlockIndex; + moveBlocksToPosition(sourceClientIds, sourceRootClientId, targetRootClientId, insertIndex); + } + }; +} +/** + * A function that returns an event handler function for block-related file drop events. + * + * @param {string} targetRootClientId The root client id where the block(s) will be inserted. + * @param {number} targetBlockIndex The index where the block(s) will be inserted. + * @param {boolean} hasUploadPermissions Whether the user has upload permissions. + * @param {Function} updateBlockAttributes A function that updates a block's attributes. + * @param {Function} canInsertBlockType A function that returns checks whether a block type can be inserted. + * @param {Function} insertBlocks A function that inserts blocks. + * + * @return {Function} The event handler for a block-related file drop event. + */ + +function onFilesDrop(targetRootClientId, targetBlockIndex, hasUploadPermissions, updateBlockAttributes, canInsertBlockType, insertBlocks) { + return files => { + if (!hasUploadPermissions) { return; } - const count = filteredBlockPatterns.length; - const resultsFoundMessage = Object(external_wp_i18n_["sprintf"])( - /* translators: %d: number of results. */ - Object(external_wp_i18n_["_n"])('%d result found.', '%d results found.', count), count); - debouncedSpeak(resultsFoundMessage); - }, [filterValue, debouncedSpeak]); - const currentShownPatterns = Object(external_wp_compose_["useAsyncList"])(filteredBlockPatterns, { - step: INITIAL_INSERTER_RESULTS - }); - const hasItems = !!(filteredBlockPatterns !== null && filteredBlockPatterns !== void 0 && filteredBlockPatterns.length); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-patterns-explorer__list" - }, hasItems && Object(external_wp_element_["createElement"])(PatternsListHeader, { - filterValue: filterValue, - filteredBlockPatternsLength: filteredBlockPatterns.length - }), Object(external_wp_element_["createElement"])(inserter_listbox["a" /* default */], null, !hasItems && Object(external_wp_element_["createElement"])(no_results["a" /* default */], null), hasItems && Object(external_wp_element_["createElement"])(block_patterns_list["a" /* default */], { - shownPatterns: currentShownPatterns, - blockPatterns: filteredBlockPatterns, - onClickPattern: onSelectBlockPattern, - isDraggable: false - }))); + const transformation = (0,external_wp_blocks_namespaceObject.findTransform)((0,external_wp_blocks_namespaceObject.getBlockTransforms)('from'), transform => transform.type === 'files' && canInsertBlockType(transform.blockName, targetRootClientId) && transform.isMatch(files)); + + if (transformation) { + const blocks = transformation.transform(files, updateBlockAttributes); + insertBlocks(blocks, targetBlockIndex, targetRootClientId); + } + }; +} +/** + * A function that returns an event handler function for block-related HTML drop events. + * + * @param {string} targetRootClientId The root client id where the block(s) will be inserted. + * @param {number} targetBlockIndex The index where the block(s) will be inserted. + * @param {Function} insertBlocks A function that inserts blocks. + * + * @return {Function} The event handler for a block-related HTML drop event. + */ + +function onHTMLDrop(targetRootClientId, targetBlockIndex, insertBlocks) { + return HTML => { + const blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({ + HTML, + mode: 'BLOCKS' + }); + + if (blocks.length) { + insertBlocks(blocks, targetBlockIndex, targetRootClientId); + } + }; +} +/** + * A React hook for handling block drop events. + * + * @param {string} targetRootClientId The root client id where the block(s) will be inserted. + * @param {number} targetBlockIndex The index where the block(s) will be inserted. + * + * @return {Object} An object that contains the event handlers `onDrop`, `onFilesDrop` and `onHTMLDrop`. + */ + +function useOnBlockDrop(targetRootClientId, targetBlockIndex) { + const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().mediaUpload, []); + const { + canInsertBlockType, + getBlockIndex, + getClientIdsOfDescendants + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + insertBlocks, + moveBlocksToPosition, + updateBlockAttributes, + clearSelectedBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + + const _onDrop = onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocksToPosition, insertBlocks, clearSelectedBlock); + + const _onFilesDrop = onFilesDrop(targetRootClientId, targetBlockIndex, hasUploadPermissions, updateBlockAttributes, canInsertBlockType, insertBlocks); + + const _onHTMLDrop = onHTMLDrop(targetRootClientId, targetBlockIndex, insertBlocks); + + return event => { + const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(event.dataTransfer); + const html = event.dataTransfer.getData('text/html'); + + if (files.length) { + _onFilesDrop(files); + } else if (html) { + _onHTMLDrop(html); + } else { + _onDrop(event); + } + }; } -/* harmony default export */ var patterns_list = (PatternList); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/math.js +/** + * A string representing the name of an edge. + * + * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName + */ -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/explorer.js +/** + * @typedef {Object} WPPoint + * @property {number} x The horizontal position. + * @property {number} y The vertical position. + */ +/** + * Given a point, a DOMRect and the name of an edge, returns the distance to + * that edge of the rect. + * + * This function works for edges that are horizontal or vertical (e.g. not + * rotated), the following terms are used so that the function works in both + * orientations: + * + * - Forward, meaning the axis running horizontally when an edge is vertical + * and vertically when an edge is horizontal. + * - Lateral, meaning the axis running vertically when an edge is vertical + * and horizontally when an edge is horizontal. + * + * @param {WPPoint} point The point to measure distance from. + * @param {DOMRect} rect A DOM Rect containing edge positions. + * @param {WPEdgeName} edge The edge to measure to. + */ +function getDistanceFromPointToEdge(point, rect, edge) { + const isHorizontal = edge === 'top' || edge === 'bottom'; + const { + x, + y + } = point; + const pointLateralPosition = isHorizontal ? x : y; + const pointForwardPosition = isHorizontal ? y : x; + const edgeStart = isHorizontal ? rect.left : rect.top; + const edgeEnd = isHorizontal ? rect.right : rect.bottom; + const edgeForwardPosition = rect[edge]; // Measure the straight line distance to the edge of the rect, when the + // point is adjacent to the edge. + // Else, if the point is positioned diagonally to the edge of the rect, + // measure diagonally to the nearest corner that the edge meets. + let edgeLateralPosition; + + if (pointLateralPosition >= edgeStart && pointLateralPosition <= edgeEnd) { + edgeLateralPosition = pointLateralPosition; + } else if (pointLateralPosition < edgeEnd) { + edgeLateralPosition = edgeStart; + } else { + edgeLateralPosition = edgeEnd; + } + + return Math.sqrt((pointLateralPosition - edgeLateralPosition) ** 2 + (pointForwardPosition - edgeForwardPosition) ** 2); +} +/** + * Given a point, a DOMRect and a list of allowed edges returns the name of and + * distance to the nearest edge. + * + * @param {WPPoint} point The point to measure distance from. + * @param {DOMRect} rect A DOM Rect containing edge positions. + * @param {WPEdgeName[]} allowedEdges A list of the edges included in the + * calculation. Defaults to all edges. + * + * @return {[number, string]} An array where the first value is the distance + * and a second is the edge name. + */ + +function getDistanceToNearestEdge(point, rect) { + let allowedEdges = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['top', 'bottom', 'left', 'right']; + let candidateDistance; + let candidateEdge; + allowedEdges.forEach(edge => { + const distance = getDistanceFromPointToEdge(point, rect, edge); + + if (candidateDistance === undefined || distance < candidateDistance) { + candidateDistance = distance; + candidateEdge = edge; + } + }); + return [candidateDistance, candidateEdge]; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-drop-zone/index.js /** * WordPress dependencies */ + /** * Internal dependencies */ @@ -49448,44 +28582,461 @@ function PatternList(_ref2) { -function PatternsExplorer(_ref) { +/** @typedef {import('../../utils/math').WPPoint} WPPoint */ + +/** + * The orientation of a block list. + * + * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation + */ + +/** + * Given a list of block DOM elements finds the index that a block should be dropped + * at. + * + * @param {Element[]} elements Array of DOM elements that represent each block in a block list. + * @param {WPPoint} position The position of the item being dragged. + * @param {WPBlockListOrientation} orientation The orientation of a block list. + * + * @return {number|undefined} The block index that's closest to the drag position. + */ + +function getNearestBlockIndex(elements, position, orientation) { + const allowedEdges = orientation === 'horizontal' ? ['left', 'right'] : ['top', 'bottom']; + const isRightToLeft = (0,external_wp_i18n_namespaceObject.isRTL)(); + let candidateIndex; + let candidateDistance; + elements.forEach((element, index) => { + const rect = element.getBoundingClientRect(); + const [distance, edge] = getDistanceToNearestEdge(position, rect, allowedEdges); + + if (candidateDistance === undefined || distance < candidateDistance) { + // If the user is dropping to the trailing edge of the block + // add 1 to the index to represent dragging after. + // Take RTL languages into account where the left edge is + // the trailing edge. + const isTrailingEdge = edge === 'bottom' || !isRightToLeft && edge === 'right' || isRightToLeft && edge === 'left'; + const offset = isTrailingEdge ? 1 : 0; // Update the currently known best candidate. + + candidateDistance = distance; + candidateIndex = index + offset; + } + }); + return candidateIndex; +} +/** + * @typedef {Object} WPBlockDropZoneConfig + * @property {string} rootClientId The root client id for the block list. + */ + +/** + * A React hook that can be used to make a block list handle drag and drop. + * + * @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone. + */ + +function useBlockDropZone() { let { - initialCategory, - patternCategories + // An undefined value represents a top-level block. Default to an empty + // string for this so that `targetRootClientId` can be easily compared to + // values returned by the `getRootBlockClientId` selector, which also uses + // an empty string to represent top-level blocks. + rootClientId: targetRootClientId = '' + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const [targetBlockIndex, setTargetBlockIndex] = (0,external_wp_element_namespaceObject.useState)(null); + const isLockedAll = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getTemplateLock + } = select(store); + return getTemplateLock(targetRootClientId) === 'all'; + }, [targetRootClientId]); + const { + getBlockListSettings + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + showInsertionPoint, + hideInsertionPoint + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const onBlockDrop = useOnBlockDrop(targetRootClientId, targetBlockIndex); + const throttled = (0,external_wp_compose_namespaceObject.useThrottle)((0,external_wp_element_namespaceObject.useCallback)((event, currentTarget) => { + var _getBlockListSettings; + + const blockElements = Array.from(currentTarget.children).filter( // Ensure the element is a block. It should have the `wp-block` class. + element => element.classList.contains('wp-block')); + const targetIndex = getNearestBlockIndex(blockElements, { + x: event.clientX, + y: event.clientY + }, (_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation); + setTargetBlockIndex(targetIndex === undefined ? 0 : targetIndex); + + if (targetIndex !== null) { + showInsertionPoint(targetRootClientId, targetIndex); + } + }, []), 200); + return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({ + isDisabled: isLockedAll, + onDrop: onBlockDrop, + + onDragOver(event) { + // `currentTarget` is only available while the event is being + // handled, so get it now and pass it to the thottled function. + // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget + throttled(event, event.currentTarget); + }, + + onDragLeave() { + throttled.cancel(); + hideInsertionPoint(); + setTargetBlockIndex(null); + }, + + onDragEnd() { + throttled.cancel(); + hideInsertionPoint(); + setTargetBlockIndex(null); + } + + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + + + + + + + +/** + * InnerBlocks is a component which allows a single block to have multiple blocks + * as children. The UncontrolledInnerBlocks component is used whenever the inner + * blocks are not controlled by another entity. In other words, it is normally + * used for inner blocks in the post editor + * + * @param {Object} props The component props. + */ + +function UncontrolledInnerBlocks(props) { + const { + clientId, + allowedBlocks, + __experimentalDefaultBlock, + __experimentalDirectInsert, + template, + templateLock, + wrapperRef, + templateInsertUpdatesSelection, + __experimentalCaptureToolbars: captureToolbars, + __experimentalAppenderTagName, + renderAppender, + orientation, + placeholder, + __experimentalLayout + } = props; + useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, __experimentalLayout); + useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection); + const context = (0,external_wp_data_namespaceObject.useSelect)(select => { + const block = select(store).getBlock(clientId); + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); + + if (!blockType || !blockType.providesContext) { + return; + } + + return getBlockContext(block.attributes, blockType); + }, [clientId]); // This component needs to always be synchronous as it's the one changing + // the async mode depending on the block selection. + + return (0,external_wp_element_namespaceObject.createElement)(BlockContextProvider, { + value: context + }, (0,external_wp_element_namespaceObject.createElement)(BlockListItems, { + rootClientId: clientId, + renderAppender: renderAppender, + __experimentalAppenderTagName: __experimentalAppenderTagName, + __experimentalLayout: __experimentalLayout, + wrapperRef: wrapperRef, + placeholder: placeholder + })); +} +/** + * The controlled inner blocks component wraps the uncontrolled inner blocks + * component with the blockSync hook. This keeps the innerBlocks of the block in + * the block-editor store in sync with the blocks of the controlling entity. An + * example of an inner block controller is a template part block, which provides + * its own blocks from the template part entity data source. + * + * @param {Object} props The component props. + */ + + +function ControlledInnerBlocks(props) { + useBlockSync(props); + return (0,external_wp_element_namespaceObject.createElement)(UncontrolledInnerBlocks, props); +} + +const ForwardedInnerBlocks = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { + const innerBlocksProps = useInnerBlocksProps({ + ref + }, props); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-inner-blocks" + }, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); +}); +/** + * This hook is used to lightly mark an element as an inner blocks wrapper + * element. Call this hook and pass the returned props to the element to mark as + * an inner blocks wrapper, automatically rendering inner blocks as children. If + * you define a ref for the element, it is important to pass the ref to this + * hook, which the hook in turn will pass to the component through the props it + * returns. Optionally, you can also pass any other props through this hook, and + * they will be merged and returned. + * + * @param {Object} props Optional. Props to pass to the element. Must contain + * the ref if one is defined. + * @param {Object} options Optional. Inner blocks options. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md + */ + +function useInnerBlocksProps() { + let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const { + clientId + } = useBlockEditContext(); + const isSmallScreen = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + const { + __experimentalCaptureToolbars, + hasOverlay + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + if (!clientId) { + return {}; + } + + const { + getBlockName, + isBlockSelected, + hasSelectedInnerBlock, + isNavigationMode + } = select(store); + const blockName = getBlockName(clientId); + const enableClickThrough = isNavigationMode() || isSmallScreen; + return { + __experimentalCaptureToolbars: select(external_wp_blocks_namespaceObject.store).hasBlockSupport(blockName, '__experimentalExposeControlsToChildren', false), + hasOverlay: blockName !== 'core/template' && !isBlockSelected(clientId) && !hasSelectedInnerBlock(clientId, true) && enableClickThrough + }; + }, [clientId, isSmallScreen]); + const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, useBlockDropZone({ + rootClientId: clientId + })]); + const innerBlocksProps = { + __experimentalCaptureToolbars, + ...options + }; + const InnerBlocks = innerBlocksProps.value && innerBlocksProps.onChange ? ControlledInnerBlocks : UncontrolledInnerBlocks; + return { ...props, + ref, + className: classnames_default()(props.className, 'block-editor-block-list__layout', { + 'has-overlay': hasOverlay + }), + children: clientId ? (0,external_wp_element_namespaceObject.createElement)(InnerBlocks, _extends({}, innerBlocksProps, { + clientId: clientId + })) : (0,external_wp_element_namespaceObject.createElement)(BlockListItems, options) + }; +} +useInnerBlocksProps.save = external_wp_blocks_namespaceObject.__unstableGetInnerBlocksProps; // Expose default appender placeholders as components. + +ForwardedInnerBlocks.DefaultBlockAppender = inner_blocks_default_block_appender; +ForwardedInnerBlocks.ButtonBlockAppender = inner_blocks_button_block_appender; + +ForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children; +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md + */ + + +/* harmony default export */ var inner_blocks = (ForwardedInnerBlocks); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + + + + + + + +const elementContext = (0,external_wp_element_namespaceObject.createContext)(); +const IntersectionObserver = (0,external_wp_element_namespaceObject.createContext)(); + +function Root(_ref) { + let { + className, + ...settings } = _ref; - const [filterValue, setFilterValue] = Object(external_wp_element_["useState"])(''); - const [selectedCategory, setSelectedCategory] = Object(external_wp_element_["useState"])(initialCategory === null || initialCategory === void 0 ? void 0 : initialCategory.name); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-block-patterns-explorer" - }, Object(external_wp_element_["createElement"])(sidebar, { - selectedCategory: selectedCategory, - patternCategories: patternCategories, - onClickCategory: setSelectedCategory, - filterValue: filterValue, - setFilterValue: setFilterValue - }), Object(external_wp_element_["createElement"])(patterns_list, { - filterValue: filterValue, - selectedCategory: selectedCategory, - patternCategories: patternCategories + const [element, setElement] = (0,external_wp_element_namespaceObject.useState)(); + const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); + const { + isOutlineMode, + isFocusMode, + isNavigationMode + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings, + isNavigationMode: _isNavigationMode + } = select(store); + const { + outlineMode, + focusMode + } = getSettings(); + return { + isOutlineMode: outlineMode, + isFocusMode: focusMode, + isNavigationMode: _isNavigationMode() + }; + }, []); + const innerBlocksProps = useInnerBlocksProps({ + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useBlockSelectionClearer(), useInBetweenInserter(), setElement]), + className: classnames_default()('is-root-container', className, { + 'is-outline-mode': isOutlineMode, + 'is-focus-mode': isFocusMode && isLargeViewport, + 'is-navigate-mode': isNavigationMode + }) + }, settings); + return (0,external_wp_element_namespaceObject.createElement)(elementContext.Provider, { + value: element + }, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); +} + +function BlockList(settings) { + usePreParsePatterns(); + return (0,external_wp_element_namespaceObject.createElement)(BlockToolsBackCompat, null, (0,external_wp_element_namespaceObject.createElement)(Provider, { + value: DEFAULT_BLOCK_EDIT_CONTEXT + }, (0,external_wp_element_namespaceObject.createElement)(Root, settings))); +} +BlockList.__unstableElementContext = elementContext; + +function Items(_ref2) { + let { + placeholder, + rootClientId, + renderAppender, + __experimentalAppenderTagName, + __experimentalLayout: layout = defaultLayout + } = _ref2; + const [intersectingBlocks, setIntersectingBlocks] = (0,external_wp_element_namespaceObject.useState)(new Set()); + const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => { + const { + IntersectionObserver: Observer + } = window; + + if (!Observer) { + return; + } + + return new Observer(entries => { + setIntersectingBlocks(oldIntersectingBlocks => { + const newIntersectingBlocks = new Set(oldIntersectingBlocks); + + for (const entry of entries) { + const clientId = entry.target.getAttribute('data-block'); + const action = entry.isIntersecting ? 'add' : 'delete'; + newIntersectingBlocks[action](clientId); + } + + return newIntersectingBlocks; + }); + }); + }, [setIntersectingBlocks]); + const { + order, + selectedBlocks + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockOrder, + getSelectedBlockClientIds + } = select(store); + return { + order: getBlockOrder(rootClientId), + selectedBlocks: getSelectedBlockClientIds() + }; + }, [rootClientId]); + return (0,external_wp_element_namespaceObject.createElement)(LayoutProvider, { + value: layout + }, (0,external_wp_element_namespaceObject.createElement)(IntersectionObserver.Provider, { + value: intersectionObserver + }, order.map(clientId => (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, { + key: clientId, + value: // Only provide data asynchronously if the block is + // not visible and not selected. + !intersectingBlocks.has(clientId) && !selectedBlocks.includes(clientId) + }, (0,external_wp_element_namespaceObject.createElement)(block, { + rootClientId: rootClientId, + clientId: clientId + })))), order.length < 1 && placeholder, (0,external_wp_element_namespaceObject.createElement)(block_list_appender, { + tagName: __experimentalAppenderTagName, + rootClientId: rootClientId, + renderAppender: renderAppender })); } -function PatternsExplorerModal(_ref2) { - let { - onModalClose, - ...restProps - } = _ref2; - return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], { - title: Object(external_wp_i18n_["__"])('Patterns'), - closeLabel: Object(external_wp_i18n_["__"])('Close'), - onRequestClose: onModalClose, - isFullScreen: true - }, Object(external_wp_element_["createElement"])(PatternsExplorer, restProps)); +function BlockListItems(props) { + // This component needs to always be synchronous as it's the one changing + // the async mode depending on the block selection. + return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, { + value: false + }, (0,external_wp_element_namespaceObject.createElement)(Items, props)); } -/* harmony default export */ var explorer = (PatternsExplorerModal); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/control.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab.js + + +/** + * External dependencies + */ /** @@ -49494,222 +29045,817 @@ function PatternsExplorerModal(_ref2) { + /** * Internal dependencies */ +const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients']; - - - -function BlockPatternsCategory(_ref) { +function ColorGradientControlInner(_ref) { let { - rootClientId, - onInsert, - selectedCategory, - populatedCategories + colors, + gradients, + disableCustomColors, + disableCustomGradients, + __experimentalHasMultipleOrigins, + __experimentalIsRenderedInSidebar, + className, + label, + onColorChange, + onGradientChange, + colorValue, + gradientValue, + clearable, + showTitle = true, + enableAlpha } = _ref; - const [allPatterns,, onClick] = Object(use_patterns_state["a" /* default */])(onInsert, rootClientId); - const getPatternIndex = Object(external_wp_element_["useCallback"])(pattern => { - var _pattern$categories; + const canChooseAColor = onColorChange && (!(0,external_lodash_namespaceObject.isEmpty)(colors) || !disableCustomColors); + const canChooseAGradient = onGradientChange && (!(0,external_lodash_namespaceObject.isEmpty)(gradients) || !disableCustomGradients); + const [currentTab, setCurrentTab] = (0,external_wp_element_namespaceObject.useState)(gradientValue ? 'gradient' : !!canChooseAColor && 'color'); - if (!((_pattern$categories = pattern.categories) !== null && _pattern$categories !== void 0 && _pattern$categories.length)) { - return Infinity; - } - - const indexedCategories = populatedCategories.reduce((accumulator, _ref2, index) => { - let { - name - } = _ref2; - accumulator[name] = index; - return accumulator; - }, {}); - return Math.min(...pattern.categories.map(cat => indexedCategories[cat] !== undefined ? indexedCategories[cat] : Infinity)); - }, [populatedCategories]); - const currentCategoryPatterns = Object(external_wp_element_["useMemo"])(() => allPatterns.filter(pattern => { - var _pattern$categories2; - - return selectedCategory.name === 'uncategorized' ? getPatternIndex(pattern) === Infinity : (_pattern$categories2 = pattern.categories) === null || _pattern$categories2 === void 0 ? void 0 : _pattern$categories2.includes(selectedCategory.name); - }), [allPatterns, selectedCategory]); // Ordering the patterns is important for the async rendering. - - const orderedPatterns = Object(external_wp_element_["useMemo"])(() => { - return currentCategoryPatterns.sort((a, b) => { - return getPatternIndex(a) - getPatternIndex(b); - }); - }, [currentCategoryPatterns, getPatternIndex]); - const currentShownPatterns = Object(external_wp_compose_["useAsyncList"])(orderedPatterns); - - if (!currentCategoryPatterns.length) { + if (!canChooseAColor && !canChooseAGradient) { return null; } - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__panel-content" - }, Object(external_wp_element_["createElement"])(block_patterns_list["a" /* default */], { - shownPatterns: currentShownPatterns, - blockPatterns: currentCategoryPatterns, - onClickPattern: onClick, - label: selectedCategory.label, - orientation: "vertical", - isDraggable: true - })); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { + className: classnames_default()('block-editor-color-gradient-control', className) + }, (0,external_wp_element_namespaceObject.createElement)("fieldset", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 1 + }, showTitle && (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-color-gradient-control__color-indicator" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, label))), canChooseAColor && canChooseAGradient && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { + value: currentTab, + onChange: setCurrentTab, + label: (0,external_wp_i18n_namespaceObject.__)('Select color type'), + hideLabelFromVision: true, + isBlock: true + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "color", + label: (0,external_wp_i18n_namespaceObject.__)('Solid') + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "gradient", + label: (0,external_wp_i18n_namespaceObject.__)('Gradient') + })), (currentTab === 'color' || !canChooseAGradient) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorPalette, { + value: colorValue, + onChange: canChooseAGradient ? newColor => { + onColorChange(newColor); + onGradientChange(); + } : onColorChange, + colors, + disableCustomColors, + __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins, + __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, + clearable: clearable, + enableAlpha: enableAlpha + }), (currentTab === 'gradient' || !canChooseAColor) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.GradientPicker, { + value: gradientValue, + onChange: canChooseAColor ? newGradient => { + onGradientChange(newGradient); + onColorChange(); + } : onGradientChange, + gradients, + disableCustomGradients, + __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins, + __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, + clearable: clearable + })))); } -function BlockPatternsTabs(_ref3) { +function ColorGradientControlSelect(props) { + const colorGradientSettings = {}; + colorGradientSettings.colors = useSetting('color.palette'); + colorGradientSettings.gradients = useSetting('color.gradients'); + colorGradientSettings.disableCustomColors = !useSetting('color.custom'); + colorGradientSettings.disableCustomGradients = !useSetting('color.customGradient'); + return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, _extends({}, colorGradientSettings, props)); +} + +function ColorGradientControl(props) { + if ((0,external_lodash_namespaceObject.every)(colorsAndGradientKeys, key => props.hasOwnProperty(key))) { + return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, props); + } + + return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlSelect, props); +} + +/* harmony default export */ var control = (ColorGradientControl); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/dropdown.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function ColorGradientSettingsDropdown(_ref) { let { - rootClientId, - onInsert, - onClickCategory, - selectedCategory - } = _ref3; - const [showPatternsExplorer, setShowPatternsExplorer] = Object(external_wp_element_["useState"])(false); - const [allPatterns, allCategories] = Object(use_patterns_state["a" /* default */])(); - const hasRegisteredCategory = Object(external_wp_element_["useCallback"])(pattern => { - if (!pattern.categories || !pattern.categories.length) { - return false; - } + colors, + gradients, + disableCustomColors, + disableCustomGradients, + __experimentalHasMultipleOrigins, + __experimentalIsRenderedInSidebar, + enableAlpha, + settings + } = _ref; + let dropdownPosition; - return pattern.categories.some(cat => allCategories.some(category => category.name === cat)); - }, [allCategories]); // Remove any empty categories + if (__experimentalIsRenderedInSidebar) { + dropdownPosition = 'bottom left'; + } - const populatedCategories = Object(external_wp_element_["useMemo"])(() => { - const categories = allCategories.filter(category => allPatterns.some(pattern => { - var _pattern$categories3; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { + isBordered: true, + isSeparated: true, + className: "block-editor-panel-color-gradient-settings__item-group" + }, settings.map((setting, index) => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + key: index, + position: dropdownPosition, + className: "block-editor-panel-color-gradient-settings__dropdown", + contentClassName: "block-editor-panel-color-gradient-settings__dropdown-content", + renderToggle: _ref2 => { + var _setting$gradientValu; - return (_pattern$categories3 = pattern.categories) === null || _pattern$categories3 === void 0 ? void 0 : _pattern$categories3.includes(category.name); - })).sort((_ref4, _ref5) => { let { - name: currentName - } = _ref4; - let { - name: nextName - } = _ref5; + isOpen, + onToggle + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, { + onClick: onToggle, + className: classnames_default()('block-editor-panel-color-gradient-settings__item', { + 'is-open': isOpen + }) + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "flex-start" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, { + className: "block-editor-panel-color-gradient-settings__color-indicator", + colorValue: (_setting$gradientValu = setting.gradientValue) !== null && _setting$gradientValu !== void 0 ? _setting$gradientValu : setting.colorValue + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, setting.label))); + }, + renderContent: () => (0,external_wp_element_namespaceObject.createElement)(control, _extends({ + showTitle: false, + colors, + gradients, + disableCustomColors, + disableCustomGradients, + __experimentalHasMultipleOrigins, + __experimentalIsRenderedInSidebar, + enableAlpha + }, setting)) + }))); +} - if (![currentName, nextName].includes('featured')) { - return 0; - } +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/use-common-single-multiple-selects.js +/** + * Internal dependencies + */ - return currentName === 'featured' ? -1 : 1; - }); +function useCommonSingleMultipleSelects() { + return { + disableCustomColors: !useSetting('color.custom'), + disableCustomGradients: !useSetting('color.customGradient') + }; +} - if (allPatterns.some(pattern => !hasRegisteredCategory(pattern)) && !categories.find(category => category.name === 'uncategorized')) { - categories.push({ - name: 'uncategorized', - label: Object(external_wp_i18n_["_x"])('Uncategorized') +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +/** + * Retrieves color and gradient related settings. + * + * The arrays for colors and gradients are made up of color palettes from each + * origin i.e. "Core", "Theme", and "User". + * + * @return {Object} Color and gradient related settings. + */ + +function useMultipleOriginColorsAndGradients() { + const colorGradientSettings = useCommonSingleMultipleSelects(); + const customColors = useSetting('color.palette.custom'); + const themeColors = useSetting('color.palette.theme'); + const defaultColors = useSetting('color.palette.default'); + const shouldDisplayDefaultColors = useSetting('color.defaultPalette'); + colorGradientSettings.colors = (0,external_wp_element_namespaceObject.useMemo)(() => { + const result = []; + + if (themeColors && themeColors.length) { + result.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'), + colors: themeColors }); } - return categories; - }, [allPatterns, allCategories]); - const patternCategory = selectedCategory ? selectedCategory : populatedCategories[0]; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !showPatternsExplorer && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(pattern_panel, { - selectedCategory: patternCategory, - patternCategories: populatedCategories, - onClickCategory: onClickCategory, - openPatternExplorer: () => setShowPatternsExplorer(true) - }), Object(external_wp_element_["createElement"])(BlockPatternsCategory, { - rootClientId: rootClientId, - onInsert: onInsert, - selectedCategory: patternCategory, - populatedCategories: populatedCategories - })), showPatternsExplorer && Object(external_wp_element_["createElement"])(explorer, { - initialCategory: patternCategory, - patternCategories: populatedCategories, - onModalClose: () => setShowPatternsExplorer(false) - })); + if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) { + result.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'), + colors: defaultColors + }); + } + + if (customColors && customColors.length) { + result.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette comes from the theme.'), + colors: customColors + }); + } + + return result; + }, [defaultColors, themeColors, customColors]); + const customGradients = useSetting('color.gradients.custom'); + const themeGradients = useSetting('color.gradients.theme'); + const defaultGradients = useSetting('color.gradients.default'); + const shouldDisplayDefaultGradients = useSetting('color.defaultGradients'); + colorGradientSettings.gradients = (0,external_wp_element_namespaceObject.useMemo)(() => { + const result = []; + + if (themeGradients && themeGradients.length) { + result.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'), + gradients: themeGradients + }); + } + + if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) { + result.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'), + gradients: defaultGradients + }); + } + + if (customGradients && customGradients.length) { + result.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'), + gradients: customGradients + }); + } + + return result; + }, [customGradients, themeGradients, defaultGradients]); + return colorGradientSettings; } -/* harmony default export */ var block_patterns_tab = (BlockPatternsTabs); - -// EXTERNAL MODULE: external ["wp","url"] -var external_wp_url_ = __webpack_require__("Mmq9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/reusable-blocks-tab.js - - +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/utils.js /** - * WordPress dependencies - */ - - - -/** - * Internal dependencies + * External dependencies */ +k([names, a11y]); +/** + * Provided an array of color objects as set by the theme or by the editor defaults, + * and the values of the defined color or custom color returns a color object describing the color. + * + * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. + * @param {?string} definedColor A string containing the color slug. + * @param {?string} customColor A string containing the customColor value. + * + * @return {?Object} If definedColor is passed and the name is found in colors, + * the color object exactly as set by the theme or editor defaults is returned. + * Otherwise, an object that just sets the color is defined. + */ - -function ReusableBlocksList(_ref) { - let { - onHover, - onInsert, - rootClientId - } = _ref; - const [items,,, onSelectItem] = Object(use_block_types_state["a" /* default */])(rootClientId, onInsert); - const filteredItems = Object(external_wp_element_["useMemo"])(() => { - return items.filter(_ref2 => { - let { - category - } = _ref2; - return category === 'reusable'; +const getColorObjectByAttributeValues = (colors, definedColor, customColor) => { + if (definedColor) { + const colorObj = (0,external_lodash_namespaceObject.find)(colors, { + slug: definedColor }); - }, [items]); - if (filteredItems.length === 0) { - return Object(external_wp_element_["createElement"])(no_results["a" /* default */], null); + if (colorObj) { + return colorObj; + } } - return Object(external_wp_element_["createElement"])(panel["a" /* default */], { - title: Object(external_wp_i18n_["__"])('Reusable blocks') - }, Object(external_wp_element_["createElement"])(block_types_list["a" /* default */], { - items: filteredItems, - onSelect: onSelectItem, - onHover: onHover, - label: Object(external_wp_i18n_["__"])('Reusable blocks') - })); -} // The unwrapped component is only exported for use by unit tests. + return { + color: customColor + }; +}; +/** + * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined. + * + * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. + * @param {?string} colorValue A string containing the color value. + * + * @return {?Object} Color object included in the colors array whose color property equals colorValue. + * Returns undefined if no color object matches this requirement. + */ + +const getColorObjectByColorValue = (colors, colorValue) => { + return (0,external_lodash_namespaceObject.find)(colors, { + color: colorValue + }); +}; +/** + * Returns a class based on the context a color is being used and its slug. + * + * @param {string} colorContextName Context/place where color is being used e.g: background, text etc... + * @param {string} colorSlug Slug of the color. + * + * @return {?string} String with the class corresponding to the color in the provided context. + * Returns undefined if either colorContextName or colorSlug are not provided. + */ + +function getColorClassName(colorContextName, colorSlug) { + if (!colorContextName || !colorSlug) { + return undefined; + } + + return `has-${(0,external_lodash_namespaceObject.kebabCase)(colorSlug)}-${colorContextName}`; +} +/** + * Given an array of color objects and a color value returns the color value of the most readable color in the array. + * + * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. + * @param {?string} colorValue A string containing the color value. + * + * @return {string} String with the color value of the most readable color. + */ + +function getMostReadableColor(colors, colorValue) { + const colordColor = w(colorValue); + return (0,external_lodash_namespaceObject.maxBy)(colors, _ref => { + let { + color + } = _ref; + return colordColor.contrast(color); + }).color; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-color.js + + /** - * List of reusable blocks shown in the "Reusable" tab of the inserter. - * - * @param {Object} props Component props. - * @param {?string} props.rootClientId Client id of block to insert into. - * @param {Function} props.onInsert Callback to run when item is inserted. - * @param {Function} props.onHover Callback to run when item is hovered. - * - * @return {WPComponent} The component. + * External dependencies + */ + +/** + * WordPress dependencies */ -function ReusableBlocksTab(_ref3) { - let { - rootClientId, - onInsert, - onHover - } = _ref3; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(ReusableBlocksList, { - onHover: onHover, - onInsert: onInsert, - rootClientId: rootClientId - }), Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__manage-reusable-blocks-container" - }, Object(external_wp_element_["createElement"])("a", { - className: "block-editor-inserter__manage-reusable-blocks", - href: Object(external_wp_url_["addQueryArgs"])('edit.php', { - post_type: 'wp_block' - }) - }, Object(external_wp_i18n_["__"])('Manage Reusable blocks')))); + + + +/** + * Internal dependencies + */ + + + + + + + // Defining empty array here instead of inline avoids unnecessary re-renders of +// color control. + +const border_color_EMPTY_ARRAY = []; +/** + * Inspector control panel containing the border color related configuration. + * + * There is deliberate overlap between the colors and borders block supports + * relating to border color. It can be argued the border color controls could + * be included within either, or both, the colors and borders panels in the + * inspector controls. If they share the same block attributes it should not + * matter. + * + * @param {Object} props Block properties. + * + * @return {WPElement} Border color edit element. + */ + +function BorderColorEdit(props) { + const { + attributes: { + borderColor, + style + }, + setAttributes + } = props; + const colorGradientSettings = useMultipleOriginColorsAndGradients(); + const availableColors = colorGradientSettings.colors.reduce((colors, origin) => colors.concat(origin.colors), []); + const [colorValue, setColorValue] = (0,external_wp_element_namespaceObject.useState)(() => { + var _getColorObjectByAttr, _style$border; + + return (_getColorObjectByAttr = getColorObjectByAttributeValues(availableColors, borderColor, style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.color)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color; + }); + + const onChangeColor = value => { + setColorValue(value); + const colorObject = getColorObjectByColorValue(availableColors, value); + const newStyle = { ...style, + border: { ...(style === null || style === void 0 ? void 0 : style.border), + color: colorObject !== null && colorObject !== void 0 && colorObject.slug ? undefined : value + } + }; // If empty slug, ensure undefined to remove attribute. + + const newNamedColor = colorObject !== null && colorObject !== void 0 && colorObject.slug ? colorObject.slug : undefined; + setAttributes({ + style: cleanEmptyObject(newStyle), + borderColor: newNamedColor + }); + }; + + const settings = [{ + label: (0,external_wp_i18n_namespaceObject.__)('Color'), + onColorChange: onChangeColor, + colorValue, + clearable: false + }]; + return (0,external_wp_element_namespaceObject.createElement)(ColorGradientSettingsDropdown, _extends({ + settings: settings, + disableCustomColors: true, + disableCustomGradients: true, + __experimentalHasMultipleOrigins: true, + __experimentalIsRenderedInSidebar: true, + enableAlpha: true + }, colorGradientSettings)); } -/* harmony default export */ var reusable_blocks_tab = (ReusableBlocksTab); +/** + * Filters registered block settings, extending attributes to include + * `borderColor` if needed. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Updated block settings. + */ -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-results.js -var search_results = __webpack_require__("Wg7J"); +function addAttributes(settings) { + if (!hasBorderSupport(settings, 'color')) { + return settings; + } // Allow blocks to specify default value if needed. + + + if (settings.attributes.borderColor) { + return settings; + } // Add new borderColor attribute to block settings. + + + return { ...settings, + attributes: { ...settings.attributes, + borderColor: { + type: 'string' + } + } + }; +} +/** + * Override props assigned to save component to inject border color. + * + * @param {Object} props Additional props applied to save element. + * @param {Object} blockType Block type definition. + * @param {Object} attributes Block's attributes. + * + * @return {Object} Filtered props to apply to save element. + */ + + +function border_color_addSaveProps(props, blockType, attributes) { + var _style$border2; + + if (!hasBorderSupport(blockType, 'color') || shouldSkipSerialization(blockType)) { + return props; + } + + const { + borderColor, + style + } = attributes; + const borderColorClass = getColorClassName('border-color', borderColor); + const newClassName = classnames_default()(props.className, { + 'has-border-color': borderColor || (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.color), + [borderColorClass]: !!borderColorClass + }); // If we are clearing the last of the previous classes in `className` + // set it to `undefined` to avoid rendering empty DOM attributes. + + props.className = newClassName ? newClassName : undefined; + return props; +} +/** + * Filters the registered block settings to apply border color styles and + * classnames to the block edit wrapper. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + + +function addEditProps(settings) { + if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings)) { + return settings; + } + + const existingGetEditWrapperProps = settings.getEditWrapperProps; + + settings.getEditWrapperProps = attributes => { + let props = {}; + + if (existingGetEditWrapperProps) { + props = existingGetEditWrapperProps(attributes); + } + + return border_color_addSaveProps(props, settings, attributes); + }; + + return settings; +} +/** + * This adds inline styles for color palette colors. + * Ideally, this is not needed and themes should load their palettes on the editor. + * + * @param {Function} BlockListBlock Original component. + * + * @return {Function} Wrapped component. + */ + + +const withBorderColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { + var _getColorObjectByAttr2, _props$wrapperProps; + + const { + name, + attributes + } = props; + const { + borderColor + } = attributes; + const colors = useSetting('color.palette') || border_color_EMPTY_ARRAY; + + if (!hasBorderSupport(name, 'color') || shouldSkipSerialization(name)) { + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props); + } + + const extraStyles = { + borderColor: borderColor ? (_getColorObjectByAttr2 = getColorObjectByAttributeValues(colors, borderColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color : undefined + }; + let wrapperProps = props.wrapperProps; + wrapperProps = { ...props.wrapperProps, + style: { ...extraStyles, + ...((_props$wrapperProps = props.wrapperProps) === null || _props$wrapperProps === void 0 ? void 0 : _props$wrapperProps.style) + } + }; + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, { + wrapperProps: wrapperProps + })); +}); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/border/addAttributes', addAttributes); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/border/addSaveProps', border_color_addSaveProps); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/border/addEditProps', addEditProps); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/border/with-border-color-palette-styles', withBorderColorPaletteStyles); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/utils.js +/** + * WordPress dependencies + */ + +/** + * Gets the (non-undefined) item with the highest occurrence within an array + * Based in part on: https://stackoverflow.com/a/20762713 + * + * Undefined values are always sorted to the end by `sort`, so this function + * returns the first element, to always prioritize real values over undefined + * values. + * + * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description + * + * @param {Array} inputArray Array of items to check. + * @return {any} The item with the most occurrences. + */ + +function mode(inputArray) { + const arr = [...inputArray]; + return arr.sort((a, b) => inputArray.filter(v => v === b).length - inputArray.filter(v => v === a).length).shift(); +} +/** + * Returns the most common CSS unit in the radius values. + * Falls back to `px` as a default unit. + * + * @param {Object|string} values Radius values. + * @return {string} Most common CSS unit in values. Default: `px`. + */ + +function getAllUnit() { + let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + if (typeof values === 'string') { + const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseUnit)(values); + return unit || 'px'; + } + + const allUnits = Object.values(values).map(value => { + const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseUnit)(value); + return unit; + }); + return mode(allUnits) || 'px'; +} +/** + * Gets the 'all' input value and unit from values data. + * + * @param {Object|string} values Radius values. + * @return {string} A value + unit for the 'all' input. + */ + +function getAllValue() { + let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + /** + * Border radius support was originally a single pixel value. + * + * To maintain backwards compatibility treat this case as the all value. + */ + if (typeof values === 'string') { + return values; + } + + const parsedValues = Object.values(values).map(value => (0,external_wp_components_namespaceObject.__experimentalParseUnit)(value)); + const allValues = parsedValues.map(value => value[0]); + const allUnits = parsedValues.map(value => value[1]); + const value = allValues.every(v => v === allValues[0]) ? allValues[0] : ''; + const unit = mode(allUnits); + const allValue = value === 0 || value ? `${value}${unit}` : null; + return allValue; +} +/** + * Checks to determine if values are mixed. + * + * @param {Object} values Radius values. + * @return {boolean} Whether values are mixed. + */ + +function hasMixedValues() { + let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const allValue = getAllValue(values); + const isMixed = isNaN(parseFloat(allValue)); + return isMixed; +} +/** + * Checks to determine if values are defined. + * + * @param {Object} values Radius values. + * @return {boolean} Whether values are mixed. + */ + +function hasDefinedValues(values) { + if (!values) { + return false; + } // A string value represents a shorthand value. + + + if (typeof values === 'string') { + return true; + } // An object represents longhand border radius values, if any are set + // flag values as being defined. + + + const filteredValues = Object.values(values).filter(value => { + return !!value || value === 0; + }); + return !!filteredValues.length; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/all-input-control.js + + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function AllInputControl(_ref) { + let { + onChange, + values, + ...props + } = _ref; + const allValue = getAllValue(values); + const hasValues = hasDefinedValues(values); + const isMixed = hasValues && hasMixedValues(values); + const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, { + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Border radius'), + disableUnits: isMixed, + isOnly: true, + value: allValue, + onChange: onChange, + placeholder: allPlaceholder + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/input-controls.js + + + +/** + * WordPress dependencies + */ + + +const CORNERS = { + topLeft: (0,external_wp_i18n_namespaceObject.__)('Top left'), + topRight: (0,external_wp_i18n_namespaceObject.__)('Top right'), + bottomLeft: (0,external_wp_i18n_namespaceObject.__)('Bottom left'), + bottomRight: (0,external_wp_i18n_namespaceObject.__)('Bottom right') +}; +function BoxInputControls(_ref) { + let { + onChange, + values: valuesProp, + ...props + } = _ref; + + const createHandleOnChange = corner => next => { + if (!onChange) { + return; + } + + onChange({ ...values, + [corner]: next ? next : undefined + }); + }; // For shorthand style & backwards compatibility, handle flat string value. + + + const values = typeof valuesProp !== 'string' ? valuesProp : { + topLeft: valuesProp, + topRight: valuesProp, + bottomLeft: valuesProp, + bottomRight: valuesProp + }; // Controls are wrapped in tooltips as visible labels aren't desired here. + + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "components-border-radius-control__input-controls-wrapper" + }, Object.entries(CORNERS).map(_ref2 => { + let [key, label] = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, { + key: key, + "aria-label": label, + value: values[key], + onChange: createHandleOnChange(key) + })); + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js + + +/** + * WordPress dependencies + */ + +const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" +})); +/* harmony default export */ var library_link = (link_link); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js + + +/** + * WordPress dependencies + */ + +const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" +})); +/* harmony default export */ var link_off = (linkOff); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/linked-button.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/tabs.js /** @@ -49718,58 +29864,424 @@ var search_results = __webpack_require__("Wg7J"); -const tabs_blocksTab = { - name: 'blocks', - - /* translators: Blocks tab title in the block inserter. */ - title: Object(external_wp_i18n_["__"])('Blocks') -}; -const tabs_patternsTab = { - name: 'patterns', - - /* translators: Patterns tab title in the block inserter. */ - title: Object(external_wp_i18n_["__"])('Patterns') -}; -const tabs_reusableBlocksTab = { - name: 'reusable', - - /* translators: Reusable blocks tab title in the block inserter. */ - title: Object(external_wp_i18n_["__"])('Reusable') -}; - -function InserterTabs(_ref) { +function LinkedButton(_ref) { let { - children, - showPatterns = false, - showReusableBlocks = false, - onSelect + isLinked, + ...props } = _ref; - const tabs = Object(external_wp_element_["useMemo"])(() => { - const tempTabs = [tabs_blocksTab]; - - if (showPatterns) { - tempTabs.push(tabs_patternsTab); - } - - if (showReusableBlocks) { - tempTabs.push(tabs_reusableBlocksTab); - } - - return tempTabs; - }, [tabs_blocksTab, showPatterns, tabs_patternsTab, showReusableBlocks, tabs_reusableBlocksTab]); - return Object(external_wp_element_["createElement"])(external_wp_components_["TabPanel"], { - className: "block-editor-inserter__tabs", - tabs: tabs, - onSelect: onSelect - }, children); + const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink Radii') : (0,external_wp_i18n_namespaceObject.__)('Link Radii'); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, { + text: label + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, props, { + className: "component-border-radius-control__linked-button", + isPrimary: isLinked, + isSecondary: !isLinked, + isSmall: true, + icon: isLinked ? library_link : link_off, + iconSize: 16, + "aria-label": label + }))); } -/* harmony default export */ var inserter_tabs = (InserterTabs); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js -// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules -var store = __webpack_require__("BhPs"); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/menu.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +const DEFAULT_VALUES = { + topLeft: null, + topRight: null, + bottomLeft: null, + bottomRight: null +}; +const MIN_BORDER_RADIUS_VALUE = 0; +const MAX_BORDER_RADIUS_VALUES = { + px: 100, + em: 20, + rem: 20 +}; +/** + * Control to display border radius options. + * + * @param {Object} props Component props. + * @param {Function} props.onChange Callback to handle onChange. + * @param {Object} props.values Border radius values. + * + * @return {WPElement} Custom border radius control. + */ + +function BorderRadiusControl(_ref) { + let { + onChange, + values + } = _ref; + const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasDefinedValues(values) || !hasMixedValues(values)); + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem'] + }); + const unit = getAllUnit(values); + const unitConfig = units && units.find(item => item.value === unit); + const step = (unitConfig === null || unitConfig === void 0 ? void 0 : unitConfig.step) || 1; + const [allValue] = (0,external_wp_components_namespaceObject.__experimentalParseUnit)(getAllValue(values)); + + const toggleLinked = () => setIsLinked(!isLinked); + + const handleSliderChange = next => { + onChange(next !== undefined ? `${next}${unit}` : undefined); + }; + + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "components-border-radius-control" + }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Radius')), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "components-border-radius-control__wrapper" + }, isLinked ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AllInputControl, { + className: "components-border-radius-control__unit-control", + values: values, + min: MIN_BORDER_RADIUS_VALUE, + onChange: onChange, + unit: unit, + units: units + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { + className: "components-border-radius-control__range-control", + value: allValue, + min: MIN_BORDER_RADIUS_VALUE, + max: MAX_BORDER_RADIUS_VALUES[unit], + initialPosition: 0, + withInputField: false, + onChange: handleSliderChange, + step: step + })) : (0,external_wp_element_namespaceObject.createElement)(BoxInputControls, { + min: MIN_BORDER_RADIUS_VALUE, + onChange: onChange, + values: values || DEFAULT_VALUES, + units: units + }), (0,external_wp_element_namespaceObject.createElement)(LinkedButton, { + onClick: toggleLinked, + isLinked: isLinked + }))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-radius.js + + +/** + * Internal dependencies + */ + + +/** + * Inspector control panel containing the border radius related configuration. + * + * @param {Object} props Block properties. + * + * @return {WPElement} Border radius edit element. + */ + +function BorderRadiusEdit(props) { + var _style$border; + + const { + attributes: { + style + }, + setAttributes + } = props; + + const onChange = newRadius => { + let newStyle = { ...style, + border: { ...(style === null || style === void 0 ? void 0 : style.border), + radius: newRadius + } + }; + + if (newRadius === undefined || newRadius === '') { + newStyle = cleanEmptyObject(newStyle); + } + + setAttributes({ + style: newStyle + }); + }; + + return (0,external_wp_element_namespaceObject.createElement)(BorderRadiusControl, { + values: style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius, + onChange: onChange + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-solid.js + + +/** + * WordPress dependencies + */ + +const lineSolid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + fill: "none" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M5 11.25h14v1.5H5z" +})); +/* harmony default export */ var line_solid = (lineSolid); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dashed.js + + +/** + * WordPress dependencies + */ + +const lineDashed = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + fill: "none" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z", + clipRule: "evenodd" +})); +/* harmony default export */ var line_dashed = (lineDashed); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dotted.js + + +/** + * WordPress dependencies + */ + +const lineDotted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + fill: "none" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var line_dotted = (lineDotted); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-style-control/index.js + + +/** + * WordPress dependencies + */ + + + +const BORDER_STYLES = [{ + label: (0,external_wp_i18n_namespaceObject.__)('Solid'), + icon: line_solid, + value: 'solid' +}, { + label: (0,external_wp_i18n_namespaceObject.__)('Dashed'), + icon: line_dashed, + value: 'dashed' +}, { + label: (0,external_wp_i18n_namespaceObject.__)('Dotted'), + icon: line_dotted, + value: 'dotted' +}]; +/** + * Control to display border style options. + * + * @param {Object} props Component props. + * @param {Function} props.onChange Handler for changing border style selection. + * @param {string} props.value Currently selected border style value. + * + * @return {WPElement} Custom border style segmented control. + */ + +function BorderStyleControl(_ref) { + let { + onChange, + value + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "components-border-style-control" + }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Style')), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "components-border-style-control__buttons" + }, BORDER_STYLES.map(borderStyle => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: borderStyle.value, + icon: borderStyle.icon, + isSmall: true, + isPressed: borderStyle.value === value, + onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value), + "aria-label": borderStyle.label + })))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-style.js + + +/** + * Internal dependencies + */ + + +/** + * Inspector control for configuring border style property. + * + * @param {Object} props Block properties. + * + * @return {WPElement} Border style edit element. + */ + +const BorderStyleEdit = props => { + var _style$border; + + const { + attributes: { + style + }, + setAttributes + } = props; + + const onChange = newBorderStyle => { + const newStyleAttributes = { ...style, + border: { ...(style === null || style === void 0 ? void 0 : style.border), + style: newBorderStyle + } + }; + setAttributes({ + style: cleanEmptyObject(newStyleAttributes) + }); + }; + + return (0,external_wp_element_namespaceObject.createElement)(BorderStyleControl, { + value: style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.style, + onChange: onChange + }); +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-width.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const MIN_BORDER_WIDTH = 0; +/** + * Inspector control for configuring border width property. + * + * @param {Object} props Block properties. + * + * @return {WPElement} Border width edit element. + */ + +const BorderWidthEdit = props => { + const { + attributes: { + borderColor, + style + }, + setAttributes + } = props; + const { + width, + color: customBorderColor, + style: borderStyle + } = (style === null || style === void 0 ? void 0 : style.border) || {}; + const [styleSelection, setStyleSelection] = (0,external_wp_element_namespaceObject.useState)(); + const [colorSelection, setColorSelection] = (0,external_wp_element_namespaceObject.useState)(); // Temporarily track previous border color & style selections to be able to + // restore them when border width changes from zero value. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (borderStyle !== 'none') { + setStyleSelection(borderStyle); + } + }, [borderStyle]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (borderColor || customBorderColor) { + setColorSelection({ + name: !!borderColor ? borderColor : undefined, + color: !!customBorderColor ? customBorderColor : undefined + }); + } + }, [borderColor, customBorderColor]); + + const onChange = newWidth => { + let newStyle = { ...style, + border: { ...(style === null || style === void 0 ? void 0 : style.border), + width: newWidth + } + }; // Used to clear named border color attribute. + + let borderPaletteColor = borderColor; + const hasZeroWidth = parseFloat(newWidth) === 0; // Setting the border width explicitly to zero will also set the + // border style to `none` and clear border color attributes. + + if (hasZeroWidth) { + borderPaletteColor = undefined; + newStyle.border.color = undefined; + newStyle.border.style = 'none'; + } // Restore previous border style selection if width is now not zero and + // border style was 'none'. This is to support changes to the UI which + // change the border style UI to a segmented control without a "none" + // option. + + + if (!hasZeroWidth && borderStyle === 'none') { + newStyle.border.style = styleSelection; + } // Restore previous border color selection if width is no longer zero + // and current border color is undefined. + + + if (!hasZeroWidth && borderColor === undefined) { + borderPaletteColor = colorSelection === null || colorSelection === void 0 ? void 0 : colorSelection.name; + newStyle.border.color = colorSelection === null || colorSelection === void 0 ? void 0 : colorSelection.color; + } // If width was reset, clean out undefined styles. + + + if (newWidth === undefined || newWidth === '') { + newStyle = cleanEmptyObject(newStyle); + } + + setAttributes({ + borderColor: borderPaletteColor, + style: newStyle + }); + }; + + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem'] + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { + value: width, + label: (0,external_wp_i18n_namespaceObject.__)('Width'), + min: MIN_BORDER_WIDTH, + onChange: onChange, + units: units + }); +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border.js /** @@ -49789,147 +30301,82 @@ var store = __webpack_require__("BhPs"); +const BORDER_SUPPORT_KEY = '__experimentalBorder'; +function BorderPanel(props) { + const isDisabled = useIsBorderDisabled(props); + const isSupported = hasBorderSupport(props.name); + const isColorSupported = useSetting('border.color') && hasBorderSupport(props.name, 'color'); + const isRadiusSupported = useSetting('border.radius') && hasBorderSupport(props.name, 'radius'); + const isStyleSupported = useSetting('border.style') && hasBorderSupport(props.name, 'style'); + const isWidthSupported = useSetting('border.width') && hasBorderSupport(props.name, 'width'); + if (isDisabled || !isSupported) { + return null; + } - - -function InserterMenu(_ref) { - let { - rootClientId, - clientId, - isAppender, - __experimentalInsertionIndex, - onSelect, - showInserterHelpPanel, - showMostUsedBlocks, - __experimentalFilterValue = '', - shouldFocusBlock = true - } = _ref; - const [filterValue, setFilterValue] = Object(external_wp_element_["useState"])(__experimentalFilterValue); - const [hoveredItem, setHoveredItem] = Object(external_wp_element_["useState"])(null); - const [selectedPatternCategory, setSelectedPatternCategory] = Object(external_wp_element_["useState"])(null); - const [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint] = Object(use_insertion_point["a" /* default */])({ - rootClientId, - clientId, - isAppender, - insertionIndex: __experimentalInsertionIndex, - shouldFocusBlock - }); - const { - showPatterns, - hasReusableBlocks - } = Object(external_wp_data_["useSelect"])(select => { - var _getSettings$__experi; - - const { - __experimentalGetAllowedPatterns, - getSettings - } = select(store["a" /* store */]); - return { - showPatterns: !!__experimentalGetAllowedPatterns(destinationRootClientId).length, - hasReusableBlocks: !!((_getSettings$__experi = getSettings().__experimentalReusableBlocks) !== null && _getSettings$__experi !== void 0 && _getSettings$__experi.length) - }; - }, [destinationRootClientId]); - const onInsert = Object(external_wp_element_["useCallback"])((blocks, meta, shouldForceFocusBlock) => { - onInsertBlocks(blocks, meta, shouldForceFocusBlock); - onSelect(); - }, [onInsertBlocks, onSelect]); - const onInsertPattern = Object(external_wp_element_["useCallback"])((blocks, patternName) => { - onInsertBlocks(blocks, { - patternName - }); - onSelect(); - }, [onInsertBlocks, onSelect]); - const onHover = Object(external_wp_element_["useCallback"])(item => { - onToggleInsertionPoint(!!item); - setHoveredItem(item); - }, [onToggleInsertionPoint, setHoveredItem]); - const onClickPatternCategory = Object(external_wp_element_["useCallback"])(patternCategory => { - setSelectedPatternCategory(patternCategory); - }, [setSelectedPatternCategory]); - const blocksTab = Object(external_wp_element_["useMemo"])(() => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__block-list" - }, Object(external_wp_element_["createElement"])(block_types_tab, { - rootClientId: destinationRootClientId, - onInsert: onInsert, - onHover: onHover, - showMostUsedBlocks: showMostUsedBlocks - })), showInserterHelpPanel && Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__tips" - }, Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { - as: "h2" - }, Object(external_wp_i18n_["__"])('A tip for using the block editor')), Object(external_wp_element_["createElement"])(tips, null))), [destinationRootClientId, onInsert, onHover, filterValue, showMostUsedBlocks, showInserterHelpPanel]); - const patternsTab = Object(external_wp_element_["useMemo"])(() => Object(external_wp_element_["createElement"])(block_patterns_tab, { - rootClientId: destinationRootClientId, - onInsert: onInsertPattern, - onClickCategory: onClickPatternCategory, - selectedCategory: selectedPatternCategory - }), [destinationRootClientId, onInsertPattern, onClickPatternCategory, selectedPatternCategory]); - const reusableBlocksTab = Object(external_wp_element_["useMemo"])(() => Object(external_wp_element_["createElement"])(reusable_blocks_tab, { - rootClientId: destinationRootClientId, - onInsert: onInsert, - onHover: onHover - }), [destinationRootClientId, onInsert, onHover]); - const getCurrentTab = Object(external_wp_element_["useCallback"])(tab => { - if (tab.name === 'blocks') { - return blocksTab; - } else if (tab.name === 'patterns') { - return patternsTab; - } - - return reusableBlocksTab; - }, [blocksTab, patternsTab, reusableBlocksTab]); - return Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__menu" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__main-area" - }, Object(external_wp_element_["createElement"])("div", { - className: "block-editor-inserter__content" - }, Object(external_wp_element_["createElement"])(external_wp_components_["SearchControl"], { - className: "block-editor-inserter__search", - onChange: value => { - if (hoveredItem) setHoveredItem(null); - setFilterValue(value); - }, - value: filterValue, - label: Object(external_wp_i18n_["__"])('Search for blocks and patterns'), - placeholder: Object(external_wp_i18n_["__"])('Search') - }), !!filterValue && Object(external_wp_element_["createElement"])(search_results["a" /* default */], { - filterValue: filterValue, - onSelect: onSelect, - onHover: onHover, - rootClientId: rootClientId, - clientId: clientId, - isAppender: isAppender, - __experimentalInsertionIndex: __experimentalInsertionIndex, - showBlockDirectory: true, - shouldFocusBlock: shouldFocusBlock - }), !filterValue && (showPatterns || hasReusableBlocks) && Object(external_wp_element_["createElement"])(inserter_tabs, { - showPatterns: showPatterns, - showReusableBlocks: hasReusableBlocks - }, getCurrentTab), !filterValue && !showPatterns && !hasReusableBlocks && blocksTab)), showInserterHelpPanel && hoveredItem && Object(external_wp_element_["createElement"])(preview_panel, { - item: hoveredItem - })); + return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + className: "block-editor-hooks__border-controls", + title: (0,external_wp_i18n_namespaceObject.__)('Border'), + initialOpen: false + }, (isWidthSupported || isStyleSupported) && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-hooks__border-controls-row" + }, isWidthSupported && (0,external_wp_element_namespaceObject.createElement)(BorderWidthEdit, props), isStyleSupported && (0,external_wp_element_namespaceObject.createElement)(BorderStyleEdit, props)), isColorSupported && (0,external_wp_element_namespaceObject.createElement)(BorderColorEdit, props), isRadiusSupported && (0,external_wp_element_namespaceObject.createElement)(BorderRadiusEdit, props))); } +/** + * Determine whether there is block support for border properties. + * + * @param {string} blockName Block name. + * @param {string} feature Border feature to check support for. + * + * @return {boolean} Whether there is support. + */ -/* harmony default export */ var menu = __webpack_exports__["a"] = (InserterMenu); +function hasBorderSupport(blockName) { + let feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any'; + if (external_wp_element_namespaceObject.Platform.OS !== 'web') { + return false; + } -/***/ }), + const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, BORDER_SUPPORT_KEY); -/***/ "xkPd": -/***/ (function(module, __webpack_exports__, __webpack_require__) { + if (support === true) { + return true; + } -"use strict"; -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("gdqT"); -/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__); + if (feature === 'any') { + return !!(support !== null && support !== void 0 && support.color || support !== null && support !== void 0 && support.radius || support !== null && support !== void 0 && support.width || support !== null && support !== void 0 && support.style); + } + return !!(support !== null && support !== void 0 && support[feature]); +} +/** + * Check whether serialization of border classes and styles should be skipped. + * + * @param {string|Object} blockType Block name or block type object. + * + * @return {boolean} Whether serialization of border properties should occur. + */ +function shouldSkipSerialization(blockType) { + const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, BORDER_SUPPORT_KEY); + return support === null || support === void 0 ? void 0 : support.__experimentalSkipSerialization; +} +/** + * Determines if all border support features have been disabled. + * + * @return {boolean} If border support is completely disabled. + */ + +const useIsBorderDisabled = () => { + const configs = [!useSetting('border.color'), !useSetting('border.radius'), !useSetting('border.style'), !useSetting('border.width')]; + return configs.every(Boolean); +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/gradients/use-gradient.js +/** + * External dependencies + */ /** * WordPress dependencies @@ -49937,58 +30384,113 @@ function InserterMenu(_ref) { +/** + * Internal dependencies + */ -function InserterListboxGroup(props, ref) { - const [shouldSpeak, setShouldSpeak] = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(false); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - if (shouldSpeak) { - Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__["speak"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Use left and right arrow keys to move through blocks')); - } - }, [shouldSpeak]); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - ref: ref, - role: "listbox", - "aria-orientation": "horizontal", - onFocus: () => { - setShouldSpeak(true); - }, - onBlur: event => { - const focusingOutsideGroup = !event.currentTarget.contains(event.relatedTarget); - if (focusingOutsideGroup) { - setShouldSpeak(false); - } + + +function __experimentalGetGradientClass(gradientSlug) { + if (!gradientSlug) { + return undefined; + } + + return `has-${gradientSlug}-gradient-background`; +} +/** + * Retrieves the gradient value per slug. + * + * @param {Array} gradients Gradient Palette + * @param {string} slug Gradient slug + * + * @return {string} Gradient value. + */ + +function getGradientValueBySlug(gradients, slug) { + const gradient = (0,external_lodash_namespaceObject.find)(gradients, ['slug', slug]); + return gradient && gradient.gradient; +} +function __experimentalGetGradientObjectByGradientValue(gradients, value) { + const gradient = (0,external_lodash_namespaceObject.find)(gradients, ['gradient', value]); + return gradient; +} +/** + * Retrieves the gradient slug per slug. + * + * @param {Array} gradients Gradient Palette + * @param {string} value Gradient value + * @return {string} Gradient slug. + */ + +function getGradientSlugByValue(gradients, value) { + const gradient = __experimentalGetGradientObjectByGradientValue(gradients, value); + + return gradient && gradient.slug; +} +function __experimentalUseGradient() { + let { + gradientAttribute = 'gradient', + customGradientAttribute = 'customGradient' + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + clientId + } = useBlockEditContext(); + const userGradientPalette = useSetting('color.gradients.custom'); + const themeGradientPalette = useSetting('color.gradients.theme'); + const defaultGradientPalette = useSetting('color.gradients.default'); + const allGradients = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userGradientPalette || []), ...(themeGradientPalette || []), ...(defaultGradientPalette || [])], [userGradientPalette, themeGradientPalette, defaultGradientPalette]); + const { + gradient, + customGradient + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockAttributes + } = select(store); + const attributes = getBlockAttributes(clientId) || {}; + return { + customGradient: attributes[customGradientAttribute], + gradient: attributes[gradientAttribute] + }; + }, [clientId, gradientAttribute, customGradientAttribute]); + const { + updateBlockAttributes + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const setGradient = (0,external_wp_element_namespaceObject.useCallback)(newGradientValue => { + const slug = getGradientSlugByValue(allGradients, newGradientValue); + + if (slug) { + updateBlockAttributes(clientId, { + [gradientAttribute]: slug, + [customGradientAttribute]: undefined + }); + return; } - }, props)); + + updateBlockAttributes(clientId, { + [gradientAttribute]: undefined, + [customGradientAttribute]: newGradientValue + }); + }, [allGradients, clientId, updateBlockAttributes]); + + const gradientClass = __experimentalGetGradientClass(gradient); + + let gradientValue; + + if (gradient) { + gradientValue = getGradientValueBySlug(allGradients, gradient); + } else { + gradientValue = customGradient; + } + + return { + gradientClass, + gradientValue, + setGradient + }; } -/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(InserterListboxGroup)); - - -/***/ }), - -/***/ "yU1v": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export PanelColorGradientSettingsInner */ -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("tI+e"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("l3Sj"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("dchM"); -/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("bVpQ"); -/* harmony import */ var _gradients__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("Cn0l"); -/* harmony import */ var _use_setting__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("v5LD"); -/* harmony import */ var _use_common_single_multiple_selects__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("pY5h"); -/* harmony import */ var _use_multiple_origin_colors_and_gradients__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("0LBR"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js @@ -50014,12 +30516,12 @@ function InserterListboxGroup(props, ref) { // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000) -const colorIndicatorAriaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('(%s: color %s)'); // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000) +const colorIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: color %s)'); // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000) -const gradientIndicatorAriaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('(%s: gradient %s)'); +const gradientIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: gradient %s)'); -const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients']; +const panel_color_gradient_settings_colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients']; const Indicators = _ref => { let { @@ -50043,15 +30545,15 @@ const Indicators = _ref => { let ariaLabel; if (colorValue) { - const colorObject = Object(_colors__WEBPACK_IMPORTED_MODULE_7__[/* getColorObjectByColorValue */ "c"])(availableColors || colors, colorValue); - ariaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["sprintf"])(colorIndicatorAriaLabel, label.toLowerCase(), colorObject && colorObject.name || colorValue); + const colorObject = getColorObjectByColorValue(availableColors || colors, colorValue); + ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(colorIndicatorAriaLabel, label.toLowerCase(), colorObject && colorObject.name || colorValue); } else { - const gradientObject = Object(_gradients__WEBPACK_IMPORTED_MODULE_8__[/* __experimentalGetGradientObjectByGradientValue */ "b"])(availableGradients || gradients, colorValue); + const gradientObject = __experimentalGetGradientObjectByGradientValue(availableGradients || gradients, colorValue); - ariaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["sprintf"])(gradientIndicatorAriaLabel, label.toLowerCase(), gradientObject && gradientObject.name || gradientValue); + ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(gradientIndicatorAriaLabel, label.toLowerCase(), gradientObject && gradientObject.name || gradientValue); } - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ColorIndicator"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, { key: index, colorValue: colorValue || gradientValue, "aria-label": ariaLabel @@ -50076,21 +30578,21 @@ const PanelColorGradientSettingsInner = _ref3 => { ...props } = _ref3; - if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"])(colors) && Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"])(gradients) && disableCustomColors && disableCustomGradients && Object(lodash__WEBPACK_IMPORTED_MODULE_3__["every"])(settings, setting => Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"])(setting.colors) && Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"])(setting.gradients) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) { + if ((0,external_lodash_namespaceObject.isEmpty)(colors) && (0,external_lodash_namespaceObject.isEmpty)(gradients) && disableCustomColors && disableCustomGradients && (0,external_lodash_namespaceObject.every)(settings, setting => (0,external_lodash_namespaceObject.isEmpty)(setting.colors) && (0,external_lodash_namespaceObject.isEmpty)(setting.gradients) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) { return null; } - const titleElement = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", { + const titleElement = (0,external_wp_element_namespaceObject.createElement)("span", { className: "block-editor-panel-color-gradient-settings__panel-title" - }, title, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Indicators, { + }, title, (0,external_wp_element_namespaceObject.createElement)(Indicators, { colors: colors, gradients: gradients, settings: settings })); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelBody"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('block-editor-panel-color-gradient-settings', className), + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, _extends({ + className: classnames_default()('block-editor-panel-color-gradient-settings', className), title: showTitle ? titleElement : undefined - }, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_dropdown__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { + }, props), (0,external_wp_element_namespaceObject.createElement)(ColorGradientSettingsDropdown, { settings: settings, colors, gradients, @@ -50099,62 +30601,1227 @@ const PanelColorGradientSettingsInner = _ref3 => { __experimentalHasMultipleOrigins, __experimentalIsRenderedInSidebar, enableAlpha - }), !!children && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["__experimentalSpacer"], { + }), !!children && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, { marginY: 4 }), " ", children)); }; const PanelColorGradientSettingsSingleSelect = props => { - const colorGradientSettings = Object(_use_common_single_multiple_selects__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(); - colorGradientSettings.colors = Object(_use_setting__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])('color.palette'); - colorGradientSettings.gradients = Object(_use_setting__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])('color.gradients'); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(PanelColorGradientSettingsInner, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, colorGradientSettings, props)); + const colorGradientSettings = useCommonSingleMultipleSelects(); + colorGradientSettings.colors = useSetting('color.palette'); + colorGradientSettings.gradients = useSetting('color.gradients'); + return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props)); }; const PanelColorGradientSettingsMultipleSelect = props => { - const colorGradientSettings = Object(_use_multiple_origin_colors_and_gradients__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(PanelColorGradientSettingsInner, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, colorGradientSettings, props)); + const colorGradientSettings = useMultipleOriginColorsAndGradients(); + return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props)); }; const PanelColorGradientSettings = props => { - if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["every"])(colorsAndGradientKeys, key => props.hasOwnProperty(key))) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(PanelColorGradientSettingsInner, props); + if ((0,external_lodash_namespaceObject.every)(panel_color_gradient_settings_colorsAndGradientKeys, key => props.hasOwnProperty(key))) { + return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, props); } if (props.__experimentalHasMultipleOrigins) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(PanelColorGradientSettingsMultipleSelect, props); + return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsMultipleSelect, props); } - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(PanelColorGradientSettingsSingleSelect, props); + return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsSingleSelect, props); }; -/* harmony default export */ __webpack_exports__["a"] = (PanelColorGradientSettings); +/* harmony default export */ var panel_color_gradient_settings = (PanelColorGradientSettings); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/contrast-checker/index.js -/***/ }), +/** + * External dependencies + */ -/***/ "ywyh": -/***/ (function(module, exports) { -(function() { module.exports = window["wp"]["apiFetch"]; }()); -/***/ }), +/** + * WordPress dependencies + */ + + + + + +k([names, a11y]); + +function ContrastCheckerMessage(_ref) { + let { + colordBackgroundColor, + colordTextColor, + backgroundColor, + textColor + } = _ref; + const msg = colordBackgroundColor.brightness() < colordTextColor.brightness() ? (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.') : (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'); // Note: The `Notice` component can speak messages via its `spokenMessage` + // prop, but the contrast checker requires granular control over when the + // announcements are made. Notably, the message will be re-announced if a + // new color combination is selected and the contrast is still insufficient. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read.')); + }, [backgroundColor, textColor]); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-contrast-checker" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { + spokenMessage: null, + status: "warning", + isDismissible: false + }, msg)); +} + +function ContrastChecker(_ref2) { + let { + backgroundColor, + fallbackBackgroundColor, + fallbackTextColor, + fontSize, + // font size value in pixels + isLargeText, + textColor + } = _ref2; + + if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) { + return null; + } + + const colordBackgroundColor = w(backgroundColor || fallbackBackgroundColor); + const colordTextColor = w(textColor || fallbackTextColor); + const hasTransparency = colordBackgroundColor.alpha() !== 1 || colordTextColor.alpha() !== 1; + + if (hasTransparency || colordTextColor.isReadable(colordBackgroundColor, { + level: 'AA', + size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small' + })) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(ContrastCheckerMessage, { + backgroundColor: backgroundColor, + textColor: textColor, + colordBackgroundColor: colordBackgroundColor, + colordTextColor: colordTextColor + }); +} + +/* harmony default export */ var contrast_checker = (ContrastChecker); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color-panel.js + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + + +function getComputedStyle(node) { + return node.ownerDocument.defaultView.getComputedStyle(node); +} + +function ColorPanel(_ref) { + let { + settings, + clientId, + enableContrastChecking = true, + showTitle = true + } = _ref; + const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)(); + const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)(); + const ref = useBlockRef(clientId); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!enableContrastChecking) { + return; + } + + if (!ref.current) { + return; + } + + setDetectedColor(getComputedStyle(ref.current).color); + let backgroundColorNode = ref.current; + let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; + + while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) { + backgroundColorNode = backgroundColorNode.parentNode; + backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; + } + + setDetectedBackgroundColor(backgroundColor); + }); + return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, null, (0,external_wp_element_namespaceObject.createElement)(panel_color_gradient_settings, { + title: (0,external_wp_i18n_namespaceObject.__)('Color'), + initialOpen: false, + settings: settings, + showTitle: showTitle, + __experimentalHasMultipleOrigins: true, + __experimentalIsRenderedInSidebar: true + }, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(contrast_checker, { + backgroundColor: detectedBackgroundColor, + textColor: detectedColor + }))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + +const COLOR_SUPPORT_KEY = 'color'; + +const hasColorSupport = blockType => { + const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); + return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false); +}; + +const color_shouldSkipSerialization = blockType => { + const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); + return colorSupport === null || colorSupport === void 0 ? void 0 : colorSupport.__experimentalSkipSerialization; +}; + +const hasLinkColorSupport = blockType => { + if (external_wp_element_namespaceObject.Platform.OS !== 'web') { + return false; + } + + const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); + return (0,external_lodash_namespaceObject.isObject)(colorSupport) && !!colorSupport.link; +}; + +const hasGradientSupport = blockType => { + const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); + return (0,external_lodash_namespaceObject.isObject)(colorSupport) && !!colorSupport.gradients; +}; + +const hasBackgroundColorSupport = blockType => { + const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); + return colorSupport && colorSupport.background !== false; +}; + +const hasTextColorSupport = blockType => { + const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); + return colorSupport && colorSupport.text !== false; +}; +/** + * Filters registered block settings, extending attributes to include + * `backgroundColor` and `textColor` attribute. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + + +function color_addAttributes(settings) { + if (!hasColorSupport(settings)) { + return settings; + } // allow blocks to specify their own attribute definition with default values if needed. + + + if (!settings.attributes.backgroundColor) { + Object.assign(settings.attributes, { + backgroundColor: { + type: 'string' + } + }); + } + + if (!settings.attributes.textColor) { + Object.assign(settings.attributes, { + textColor: { + type: 'string' + } + }); + } + + if (hasGradientSupport(settings) && !settings.attributes.gradient) { + Object.assign(settings.attributes, { + gradient: { + type: 'string' + } + }); + } + + return settings; +} +/** + * Override props assigned to save component to inject colors classnames. + * + * @param {Object} props Additional props applied to save element. + * @param {Object} blockType Block type. + * @param {Object} attributes Block attributes. + * + * @return {Object} Filtered props applied to save element. + */ + + +function color_addSaveProps(props, blockType, attributes) { + var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link; + + if (!hasColorSupport(blockType) || color_shouldSkipSerialization(blockType)) { + return props; + } + + const hasGradient = hasGradientSupport(blockType); // I'd have prefered to avoid the "style" attribute usage here + + const { + backgroundColor, + textColor, + gradient, + style + } = attributes; + const backgroundClass = getColorClassName('background-color', backgroundColor); + + const gradientClass = __experimentalGetGradientClass(gradient); + + const textClass = getColorClassName('color', textColor); + const newClassName = classnames_default()(props.className, textClass, gradientClass, { + // Don't apply the background class if there's a custom gradient + [backgroundClass]: (!hasGradient || !(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.gradient)) && !!backgroundClass, + 'has-text-color': textColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.text), + 'has-background': backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.background) || hasGradient && (gradient || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.gradient)), + 'has-link-color': style === null || style === void 0 ? void 0 : (_style$elements = style.elements) === null || _style$elements === void 0 ? void 0 : (_style$elements$link = _style$elements.link) === null || _style$elements$link === void 0 ? void 0 : _style$elements$link.color + }); + props.className = newClassName ? newClassName : undefined; + return props; +} +/** + * Filters registered block settings to extand the block edit wrapper + * to apply the desired styles and classnames properly. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + +function color_addEditProps(settings) { + if (!hasColorSupport(settings) || color_shouldSkipSerialization(settings)) { + return settings; + } + + const existingGetEditWrapperProps = settings.getEditWrapperProps; + + settings.getEditWrapperProps = attributes => { + let props = {}; + + if (existingGetEditWrapperProps) { + props = existingGetEditWrapperProps(attributes); + } + + return color_addSaveProps(props, settings, attributes); + }; + + return settings; +} + +const getLinkColorFromAttributeValue = (colors, value) => { + const attributeParsed = /var:preset\|color\|(.+)/.exec(value); + + if (attributeParsed && attributeParsed[1]) { + return getColorObjectByAttributeValues(colors, attributeParsed[1]).color; + } + + return value; +}; + +function immutableSet(object, path, value) { + return (0,external_lodash_namespaceObject.setWith)(object ? (0,external_lodash_namespaceObject.clone)(object) : {}, path, value, external_lodash_namespaceObject.clone); +} +/** + * Inspector control panel containing the color related configuration + * + * @param {Object} props + * + * @return {WPElement} Color edit element. + */ + + +function ColorEdit(props) { + var _style$color6, _style$color7, _style$color8, _style$elements2, _style$elements2$link, _style$elements2$link2, _style$elements3, _style$elements3$link, _style$elements3$link2; + + const { + name: blockName, + attributes + } = props; // Some color settings have a special handling for deprecated flags in `useSetting`, + // so we can't unwrap them by doing const { ... } = useSetting('color') + // until https://github.com/WordPress/gutenberg/issues/37094 is fixed. + + const userPalette = useSetting('color.palette.custom'); + const themePalette = useSetting('color.palette.theme'); + const defaultPalette = useSetting('color.palette.default'); + const allSolids = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); + const userGradientPalette = useSetting('color.gradients.custom'); + const themeGradientPalette = useSetting('color.gradients.theme'); + const defaultGradientPalette = useSetting('color.gradients.default'); + const allGradients = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userGradientPalette || []), ...(themeGradientPalette || []), ...(defaultGradientPalette || [])], [userGradientPalette, themeGradientPalette, defaultGradientPalette]); + const areCustomSolidsEnabled = useSetting('color.custom'); + const areCustomGradientsEnabled = useSetting('color.customGradient'); + const isBackgroundEnabled = useSetting('color.background'); + const isLinkEnabled = useSetting('color.link'); + const isTextEnabled = useSetting('color.text'); + const solidsEnabled = areCustomSolidsEnabled || !themePalette || (themePalette === null || themePalette === void 0 ? void 0 : themePalette.length) > 0; + const gradientsEnabled = areCustomGradientsEnabled || !themeGradientPalette || (themeGradientPalette === null || themeGradientPalette === void 0 ? void 0 : themeGradientPalette.length) > 0; // Shouldn't be needed but right now the ColorGradientsPanel + // can trigger both onChangeColor and onChangeBackground + // synchronously causing our two callbacks to override changes + // from each other. + + const localAttributes = (0,external_wp_element_namespaceObject.useRef)(attributes); + (0,external_wp_element_namespaceObject.useEffect)(() => { + localAttributes.current = attributes; + }, [attributes]); + + if (!hasColorSupport(blockName)) { + return null; + } + + const hasLinkColor = hasLinkColorSupport(blockName) && isLinkEnabled && solidsEnabled; + const hasTextColor = hasTextColorSupport(blockName) && isTextEnabled && solidsEnabled; + const hasBackgroundColor = hasBackgroundColorSupport(blockName) && isBackgroundEnabled && solidsEnabled; + const hasGradientColor = hasGradientSupport(blockName) && gradientsEnabled; + + if (!hasLinkColor && !hasTextColor && !hasBackgroundColor && !hasGradientColor) { + return null; + } + + const { + style, + textColor, + backgroundColor, + gradient + } = attributes; + let gradientValue; + + if (hasGradientColor && gradient) { + gradientValue = getGradientValueBySlug(allGradients, gradient); + } else if (hasGradientColor) { + var _style$color5; + + gradientValue = style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient; + } + + const onChangeColor = name => value => { + var _localAttributes$curr, _localAttributes$curr2; + + const colorObject = getColorObjectByColorValue(allSolids, value); + const attributeName = name + 'Color'; + const newStyle = { ...localAttributes.current.style, + color: { ...((_localAttributes$curr = localAttributes.current) === null || _localAttributes$curr === void 0 ? void 0 : (_localAttributes$curr2 = _localAttributes$curr.style) === null || _localAttributes$curr2 === void 0 ? void 0 : _localAttributes$curr2.color), + [name]: colorObject !== null && colorObject !== void 0 && colorObject.slug ? undefined : value + } + }; + const newNamedColor = colorObject !== null && colorObject !== void 0 && colorObject.slug ? colorObject.slug : undefined; + const newAttributes = { + style: cleanEmptyObject(newStyle), + [attributeName]: newNamedColor + }; + props.setAttributes(newAttributes); + localAttributes.current = { ...localAttributes.current, + ...newAttributes + }; + }; + + const onChangeGradient = value => { + const slug = getGradientSlugByValue(allGradients, value); + let newAttributes; + + if (slug) { + var _localAttributes$curr3, _localAttributes$curr4, _localAttributes$curr5; + + const newStyle = { ...((_localAttributes$curr3 = localAttributes.current) === null || _localAttributes$curr3 === void 0 ? void 0 : _localAttributes$curr3.style), + color: { ...((_localAttributes$curr4 = localAttributes.current) === null || _localAttributes$curr4 === void 0 ? void 0 : (_localAttributes$curr5 = _localAttributes$curr4.style) === null || _localAttributes$curr5 === void 0 ? void 0 : _localAttributes$curr5.color), + gradient: undefined + } + }; + newAttributes = { + style: cleanEmptyObject(newStyle), + gradient: slug + }; + } else { + var _localAttributes$curr6, _localAttributes$curr7, _localAttributes$curr8; + + const newStyle = { ...((_localAttributes$curr6 = localAttributes.current) === null || _localAttributes$curr6 === void 0 ? void 0 : _localAttributes$curr6.style), + color: { ...((_localAttributes$curr7 = localAttributes.current) === null || _localAttributes$curr7 === void 0 ? void 0 : (_localAttributes$curr8 = _localAttributes$curr7.style) === null || _localAttributes$curr8 === void 0 ? void 0 : _localAttributes$curr8.color), + gradient: value + } + }; + newAttributes = { + style: cleanEmptyObject(newStyle), + gradient: undefined + }; + } + + props.setAttributes(newAttributes); + localAttributes.current = { ...localAttributes.current, + ...newAttributes + }; + }; + + const onChangeLinkColor = value => { + const colorObject = getColorObjectByColorValue(allSolids, value); + const newLinkColorValue = colorObject !== null && colorObject !== void 0 && colorObject.slug ? `var:preset|color|${colorObject.slug}` : value; + const newStyle = cleanEmptyObject(immutableSet(style, ['elements', 'link', 'color', 'text'], newLinkColorValue)); + props.setAttributes({ + style: newStyle + }); + }; + + return (0,external_wp_element_namespaceObject.createElement)(ColorPanel, { + enableContrastChecking: // Turn on contrast checker for web only since it's not supported on mobile yet. + external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient), + clientId: props.clientId, + settings: [...(hasTextColor ? [{ + label: (0,external_wp_i18n_namespaceObject.__)('Text'), + onColorChange: onChangeColor('text'), + colorValue: getColorObjectByAttributeValues(allSolids, textColor, style === null || style === void 0 ? void 0 : (_style$color7 = style.color) === null || _style$color7 === void 0 ? void 0 : _style$color7.text).color + }] : []), ...(hasBackgroundColor || hasGradientColor ? [{ + label: (0,external_wp_i18n_namespaceObject.__)('Background'), + onColorChange: hasBackgroundColor ? onChangeColor('background') : undefined, + colorValue: getColorObjectByAttributeValues(allSolids, backgroundColor, style === null || style === void 0 ? void 0 : (_style$color8 = style.color) === null || _style$color8 === void 0 ? void 0 : _style$color8.background).color, + gradientValue, + onGradientChange: hasGradientColor ? onChangeGradient : undefined + }] : []), ...(hasLinkColor ? [{ + label: (0,external_wp_i18n_namespaceObject.__)('Link'), + onColorChange: onChangeLinkColor, + colorValue: getLinkColorFromAttributeValue(allSolids, style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : (_style$elements2$link2 = _style$elements2$link.color) === null || _style$elements2$link2 === void 0 ? void 0 : _style$elements2$link2.text), + clearable: !!(style !== null && style !== void 0 && (_style$elements3 = style.elements) !== null && _style$elements3 !== void 0 && (_style$elements3$link = _style$elements3.link) !== null && _style$elements3$link !== void 0 && (_style$elements3$link2 = _style$elements3$link.color) !== null && _style$elements3$link2 !== void 0 && _style$elements3$link2.text) + }] : [])] + }); +} +/** + * This adds inline styles for color palette colors. + * Ideally, this is not needed and themes should load their palettes on the editor. + * + * @param {Function} BlockListBlock Original component. + * + * @return {Function} Wrapped component. + */ + +const withColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { + var _props$wrapperProps; + + const { + name, + attributes + } = props; + const { + backgroundColor, + textColor + } = attributes; + const userPalette = useSetting('color.palette.custom') || []; + const themePalette = useSetting('color.palette.theme') || []; + const defaultPalette = useSetting('color.palette.default') || []; + const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); + + if (!hasColorSupport(name) || color_shouldSkipSerialization(name)) { + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props); + } + + const extraStyles = {}; + + if (textColor) { + var _getColorObjectByAttr; + + extraStyles.color = (_getColorObjectByAttr = getColorObjectByAttributeValues(colors, textColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color; + } + + if (backgroundColor) { + var _getColorObjectByAttr2; + + extraStyles.backgroundColor = (_getColorObjectByAttr2 = getColorObjectByAttributeValues(colors, backgroundColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color; + } + + let wrapperProps = props.wrapperProps; + wrapperProps = { ...props.wrapperProps, + style: { ...extraStyles, + ...((_props$wrapperProps = props.wrapperProps) === null || _props$wrapperProps === void 0 ? void 0 : _props$wrapperProps.style) + } + }; + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, { + wrapperProps: wrapperProps + })); +}); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/color/addAttribute', color_addAttributes); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/color/addSaveProps', color_addSaveProps); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/color/addEditProps', color_addEditProps); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/color/with-color-palette-styles', withColorPaletteStyles); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-appearance-control/index.js + + +/** + * WordPress dependencies + */ + + + +const FONT_STYLES = [{ + name: (0,external_wp_i18n_namespaceObject._x)('Regular', 'font style'), + value: 'normal' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Italic', 'font style'), + value: 'italic' +}]; +const FONT_WEIGHTS = [{ + name: (0,external_wp_i18n_namespaceObject._x)('Thin', 'font weight'), + value: '100' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Extra Light', 'font weight'), + value: '200' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Light', 'font weight'), + value: '300' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Regular', 'font weight'), + value: '400' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Medium', 'font weight'), + value: '500' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Semi Bold', 'font weight'), + value: '600' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Bold', 'font weight'), + value: '700' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Extra Bold', 'font weight'), + value: '800' +}, { + name: (0,external_wp_i18n_namespaceObject._x)('Black', 'font weight'), + value: '900' +}]; +/** + * Adjusts font appearance field label in case either font styles or weights + * are disabled. + * + * @param {boolean} hasFontStyles Whether font styles are enabled and present. + * @param {boolean} hasFontWeights Whether font weights are enabled and present. + * @return {string} A label representing what font appearance is being edited. + */ + +const getFontAppearanceLabel = (hasFontStyles, hasFontWeights) => { + if (!hasFontStyles) { + return (0,external_wp_i18n_namespaceObject.__)('Font weight'); + } + + if (!hasFontWeights) { + return (0,external_wp_i18n_namespaceObject.__)('Font style'); + } + + return (0,external_wp_i18n_namespaceObject.__)('Appearance'); +}; +/** + * Control to display unified font style and weight options. + * + * @param {Object} props Component props. + * + * @return {WPElement} Font appearance control. + */ + +function FontAppearanceControl(props) { + const { + onChange, + hasFontStyles = true, + hasFontWeights = true, + value: { + fontStyle, + fontWeight + } + } = props; + const hasStylesOrWeights = hasFontStyles || hasFontWeights; + const label = getFontAppearanceLabel(hasFontStyles, hasFontWeights); + const defaultOption = { + key: 'default', + name: (0,external_wp_i18n_namespaceObject.__)('Default'), + style: { + fontStyle: undefined, + fontWeight: undefined + } + }; // Combines both font style and weight options into a single dropdown. + + const combineOptions = () => { + const combinedOptions = [defaultOption]; + FONT_STYLES.forEach(_ref => { + let { + name: styleName, + value: styleValue + } = _ref; + FONT_WEIGHTS.forEach(_ref2 => { + let { + name: weightName, + value: weightValue + } = _ref2; + const optionName = styleValue === 'normal' ? weightName : (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: 1: Font weight name. 2: Font style name. */ + (0,external_wp_i18n_namespaceObject.__)('%1$s %2$s'), weightName, styleName); + combinedOptions.push({ + key: `${styleValue}-${weightValue}`, + name: optionName, + style: { + fontStyle: styleValue, + fontWeight: weightValue + } + }); + }); + }); + return combinedOptions; + }; // Generates select options for font styles only. + + + const styleOptions = () => { + const combinedOptions = [defaultOption]; + FONT_STYLES.forEach(_ref3 => { + let { + name, + value + } = _ref3; + combinedOptions.push({ + key: value, + name, + style: { + fontStyle: value, + fontWeight: undefined + } + }); + }); + return combinedOptions; + }; // Generates select options for font weights only. + + + const weightOptions = () => { + const combinedOptions = [defaultOption]; + FONT_WEIGHTS.forEach(_ref4 => { + let { + name, + value + } = _ref4; + combinedOptions.push({ + key: value, + name, + style: { + fontStyle: undefined, + fontWeight: value + } + }); + }); + return combinedOptions; + }; // Map font styles and weights to select options. + + + const selectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (hasFontStyles && hasFontWeights) { + return combineOptions(); + } + + return hasFontStyles ? styleOptions() : weightOptions(); + }, [props.options]); // Find current selection by comparing font style & weight against options, + // and fall back to the Default option if there is no matching option. + + const currentSelection = selectOptions.find(option => option.style.fontStyle === fontStyle && option.style.fontWeight === fontWeight) || selectOptions[0]; // Adjusts screen reader description based on styles or weights. + + const getDescribedBy = () => { + if (!currentSelection) { + return (0,external_wp_i18n_namespaceObject.__)('No selected font appearance'); + } + + if (!hasFontStyles) { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Currently selected font weight. + (0,external_wp_i18n_namespaceObject.__)('Currently selected font weight: %s'), currentSelection.name); + } + + if (!hasFontWeights) { + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Currently selected font style. + (0,external_wp_i18n_namespaceObject.__)('Currently selected font style: %s'), currentSelection.name); + } + + return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Currently selected font appearance. + (0,external_wp_i18n_namespaceObject.__)('Currently selected font appearance: %s'), currentSelection.name); + }; + + return hasStylesOrWeights && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, { + className: "components-font-appearance-control", + label: label, + describedBy: getDescribedBy(), + options: selectOptions, + value: currentSelection, + onChange: _ref5 => { + let { + selectedItem + } = _ref5; + return onChange(selectedItem.style); + } + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/utils.js +const BASE_DEFAULT_VALUE = 1.5; +const STEP = 0.1; +/** + * There are varying value types within LineHeightControl: + * + * {undefined} Initial value. No changes from the user. + * {string} Input value. Value consumed/outputted by the input. Empty would be ''. + * {number} Block attribute type. Input value needs to be converted for attribute setting. + * + * Note: If the value is undefined, the input requires it to be an empty string ('') + * in order to be considered "controlled" by props (rather than internal state). + */ + +const RESET_VALUE = ''; +/** + * Determines if the lineHeight attribute has been properly defined. + * + * @param {any} lineHeight The value to check. + * + * @return {boolean} Whether the lineHeight attribute is valid. + */ + +function isLineHeightDefined(lineHeight) { + return lineHeight !== undefined && lineHeight !== RESET_VALUE; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function LineHeightControl(_ref) { + let { + value: lineHeight, + onChange + } = _ref; + const isDefined = isLineHeightDefined(lineHeight); + + const handleOnKeyDown = event => { + const { + keyCode + } = event; + + if (keyCode === external_wp_keycodes_namespaceObject.ZERO && !isDefined) { + /** + * Prevents the onChange callback from firing, which prevents + * the logic from assuming the change was triggered from + * an input arrow CLICK. + */ + event.preventDefault(); + onChange('0'); + } + }; + + const handleOnChange = nextValue => { + // Set the next value without modification if lineHeight has been defined + if (isDefined) { + onChange(nextValue); + return; + } // Otherwise... + + /** + * The following logic handles the initial up/down arrow CLICK of the + * input element. This is so that the next values (from an undefined value state) + * are more better suited for line-height rendering. + */ + + + let adjustedNextValue = nextValue; + + switch (nextValue) { + case `${STEP}`: + // Increment by step value + adjustedNextValue = BASE_DEFAULT_VALUE + STEP; + break; + + case '0': + // Decrement by step value + adjustedNextValue = BASE_DEFAULT_VALUE - STEP; + break; + } + + onChange(adjustedNextValue); + }; + + const value = isDefined ? lineHeight : RESET_VALUE; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-line-height-control" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + autoComplete: "off", + onKeyDown: handleOnKeyDown, + onChange: handleOnChange, + label: (0,external_wp_i18n_namespaceObject.__)('Line height'), + placeholder: BASE_DEFAULT_VALUE, + step: STEP, + type: "number", + value: value, + min: 0 + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/line-height.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight'; +/** + * Inspector control panel containing the line height related configuration + * + * @param {Object} props + * + * @return {WPElement} Line height edit element. + */ + +function LineHeightEdit(props) { + var _style$typography; + + const { + attributes: { + style + }, + setAttributes + } = props; + + const onChange = newLineHeightValue => { + const newStyle = { ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + lineHeight: newLineHeightValue + } + }; + setAttributes({ + style: cleanEmptyObject(newStyle) + }); + }; + + return (0,external_wp_element_namespaceObject.createElement)(LineHeightControl, { + value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.lineHeight, + onChange: onChange + }); +} +/** + * Custom hook that checks if line-height settings have been disabled. + * + * @param {string} name The name of the block. + * @return {boolean} Whether setting is disabled. + */ + +function useIsLineHeightDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const isDisabled = !useSetting('typography.lineHeight'); + return !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, LINE_HEIGHT_SUPPORT_KEY) || isDisabled; +} +/** + * Checks if there is a current value set for the line height block support. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a line height value set. + */ + +function hasLineHeightValue(props) { + var _props$attributes$sty, _props$attributes$sty2; + + return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.lineHeight); +} +/** + * Resets the line height block support attribute. This can be used when + * disabling the line height support controls for a block via a progressive + * discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetLineHeight(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + lineHeight: undefined + } + }) + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-appearance.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +/** + * Key within block settings' support array indicating support for font style. + */ + +const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle'; +/** + * Key within block settings' support array indicating support for font weight. + */ + +const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight'; +/** + * Inspector control panel containing the font appearance options. + * + * @param {Object} props Block properties. + * + * @return {WPElement} Font appearance edit element. + */ + +function FontAppearanceEdit(props) { + var _style$typography, _style$typography2; + + const { + attributes: { + style + }, + setAttributes + } = props; + const hasFontStyles = !useIsFontStyleDisabled(props); + const hasFontWeights = !useIsFontWeightDisabled(props); + + const onChange = newStyles => { + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + fontStyle: newStyles.fontStyle, + fontWeight: newStyles.fontWeight + } + }) + }); + }; + + const fontStyle = style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontStyle; + const fontWeight = style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontWeight; + return (0,external_wp_element_namespaceObject.createElement)(FontAppearanceControl, { + onChange: onChange, + hasFontStyles: hasFontStyles, + hasFontWeights: hasFontWeights, + value: { + fontStyle, + fontWeight + } + }); +} +/** + * Checks if font style support has been disabled either by not opting in for + * support or by failing to provide preset styles. + * + * @param {Object} props Block properties. + * @param {string} props.name Name for the block type. + * + * @return {boolean} Whether font style support has been disabled. + */ + +function useIsFontStyleDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const styleSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, FONT_STYLE_SUPPORT_KEY); + const hasFontStyles = useSetting('typography.fontStyle'); + return !styleSupport || !hasFontStyles; +} +/** + * Checks if font weight support has been disabled either by not opting in for + * support or by failing to provide preset weights. + * + * @param {Object} props Block properties. + * @param {string} props.name Name for the block type. + * + * @return {boolean} Whether font weight support has been disabled. + */ + +function useIsFontWeightDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const weightSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, FONT_WEIGHT_SUPPORT_KEY); + const hasFontWeights = useSetting('typography.fontWeight'); + return !weightSupport || !hasFontWeights; +} +/** + * Checks if font appearance support has been disabled. + * + * @param {Object} props Block properties. + * + * @return {boolean} Whether font appearance support has been disabled. + */ + +function useIsFontAppearanceDisabled(props) { + const stylesDisabled = useIsFontStyleDisabled(props); + const weightsDisabled = useIsFontWeightDisabled(props); + return stylesDisabled && weightsDisabled; +} +/** + * Checks if there is either a font style or weight value set within the + * typography styles. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a font style or weight. + */ + +function hasFontAppearanceValue(props) { + var _props$attributes$sty; + + const { + fontStyle, + fontWeight + } = ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.typography) || {}; + return !!fontStyle || !!fontWeight; +} +/** + * Resets the font style and weight block support attributes. This can be used + * when disabling the font appearance support controls for a block via a + * progressive discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetFontAppearance(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + fontStyle: undefined, + fontWeight: undefined + } + }) + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-family/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function FontFamilyControl(_ref) { + let { + value = '', + onChange, + fontFamilies, + ...props + } = _ref; + const blockLevelFontFamilies = useSetting('typography.fontFamilies'); + + if (!fontFamilies) { + fontFamilies = blockLevelFontFamilies; + } + + if ((0,external_lodash_namespaceObject.isEmpty)(fontFamilies)) { + return null; + } + + const options = [{ + value: '', + label: (0,external_wp_i18n_namespaceObject.__)('Default') + }, ...fontFamilies.map(_ref2 => { + let { + fontFamily, + name + } = _ref2; + return { + value: fontFamily, + label: name || fontFamily + }; + })]; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, _extends({ + label: (0,external_wp_i18n_namespaceObject.__)('Font family'), + options: options, + value: value, + onChange: onChange, + labelPosition: "top" + }, props)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-family.js -/***/ "z+q2": -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useFocusFirstElement; }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1CF3"); -/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("OL6h"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("BhPs"); /** * External dependencies */ @@ -50172,102 +31839,3776 @@ const PanelColorGradientSettings = props => { -/** @typedef {import('@wordpress/element').RefObject} RefObject */ - +const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily'; /** - * Returns the initial position if the block needs to be focussed, `undefined` - * otherwise. The initial position is either 0 (start) or -1 (end). + * Filters registered block settings, extending attributes to include + * the `fontFamily` attribute. * - * @param {string} clientId Block client ID. - * - * @return {number} The initial position, either 0 (start) or -1 (end). + * @param {Object} settings Original block settings + * @return {Object} Filtered block settings */ -function useInitialPosition(clientId) { - return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["useSelect"])(select => { - const { - getSelectedBlocksInitialCaretPosition, - isMultiSelecting, - isNavigationMode, - isBlockSelected - } = select(_store__WEBPACK_IMPORTED_MODULE_5__[/* store */ "a"]); - - if (!isBlockSelected(clientId)) { - return; - } - - if (isMultiSelecting() || isNavigationMode()) { - return; - } // If there's no initial position, return 0 to focus the start. +function font_family_addAttributes(settings) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_FAMILY_SUPPORT_KEY)) { + return settings; + } // Allow blocks to specify a default value if needed. - return getSelectedBlocksInitialCaretPosition(); - }, [clientId]); + if (!settings.attributes.fontFamily) { + Object.assign(settings.attributes, { + fontFamily: { + type: 'string' + } + }); + } + + return settings; } /** - * Transitions focus to the block or inner tabbable when the block becomes - * selected and an initial position is set. + * Override props assigned to save component to inject font family. * - * @param {string} clientId Block client ID. - * - * @return {RefObject} React ref with the block element. + * @param {Object} props Additional props applied to save element + * @param {Object} blockType Block type + * @param {Object} attributes Block attributes + * @return {Object} Filtered props applied to save element */ -function useFocusFirstElement(clientId) { - const ref = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(); - const initialPosition = useInitialPosition(clientId); - Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => { - if (initialPosition === undefined || initialPosition === null) { - return; +function font_family_addSaveProps(props, blockType, attributes) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_FAMILY_SUPPORT_KEY)) { + return props; + } + + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'typography.__experimentalSkipSerialization')) { + return props; + } + + if (!(attributes !== null && attributes !== void 0 && attributes.fontFamily)) { + return props; + } // Use TokenList to dedupe classes. + + + const classes = new (external_wp_tokenList_default())(props.className); + classes.add(`has-${(0,external_lodash_namespaceObject.kebabCase)(attributes === null || attributes === void 0 ? void 0 : attributes.fontFamily)}-font-family`); + const newClassName = classes.value; + props.className = newClassName ? newClassName : undefined; + return props; +} +/** + * Filters registered block settings to expand the block edit wrapper + * by applying the desired styles and classnames. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + + +function font_family_addEditProps(settings) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_FAMILY_SUPPORT_KEY)) { + return settings; + } + + const existingGetEditWrapperProps = settings.getEditWrapperProps; + + settings.getEditWrapperProps = attributes => { + let props = {}; + + if (existingGetEditWrapperProps) { + props = existingGetEditWrapperProps(attributes); } - if (!ref.current) { - return; - } + return font_family_addSaveProps(props, settings, attributes); + }; - const { - ownerDocument - } = ref.current; // Do not focus the block if it already contains the active element. - - if (ref.current.contains(ownerDocument.activeElement)) { - return; - } // Find all tabbables within node. - - - const textInputs = _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__["focus"].tabbable.find(ref.current).filter(node => Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__["isTextField"])(node)); // If reversed (e.g. merge via backspace), use the last in the set of - // tabbables. - - const isReverse = -1 === initialPosition; - const target = (isReverse ? lodash__WEBPACK_IMPORTED_MODULE_0__["last"] : lodash__WEBPACK_IMPORTED_MODULE_0__["first"])(textInputs) || ref.current; - - if (!Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__[/* isInsideRootBlock */ "c"])(ref.current, target)) { - ref.current.focus(); - return; - } - - Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__["placeCaretAtHorizontalEdge"])(target, isReverse); - }, [initialPosition]); - return ref; + return settings; } +function FontFamilyEdit(_ref) { + var _find; -/***/ }), + let { + setAttributes, + attributes: { + fontFamily + } + } = _ref; + const fontFamilies = useSetting('typography.fontFamilies'); + const value = (_find = (0,external_lodash_namespaceObject.find)(fontFamilies, _ref2 => { + let { + slug + } = _ref2; + return fontFamily === slug; + })) === null || _find === void 0 ? void 0 : _find.fontFamily; -/***/ "zQI6": -/***/ (function(module, __webpack_exports__, __webpack_require__) { + function onChange(newValue) { + const predefinedFontFamily = (0,external_lodash_namespaceObject.find)(fontFamilies, _ref3 => { + let { + fontFamily: f + } = _ref3; + return f === newValue; + }); + setAttributes({ + fontFamily: predefinedFontFamily === null || predefinedFontFamily === void 0 ? void 0 : predefinedFontFamily.slug + }); + } -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useBlockSelectionClearer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlockSelectionClearer; }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1ZqX"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("K9lf"); -/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("BhPs"); + return (0,external_wp_element_namespaceObject.createElement)(FontFamilyControl, { + className: "block-editor-hooks-font-family-control", + fontFamilies: fontFamilies, + value: value, + onChange: onChange + }); +} +/** + * Custom hook that checks if font-family functionality is disabled. + * + * @param {string} name The name of the block. + * @return {boolean} Whether setting is disabled. + */ + +function useIsFontFamilyDisabled(_ref4) { + let { + name + } = _ref4; + const fontFamilies = useSetting('typography.fontFamilies'); + return !fontFamilies || fontFamilies.length === 0 || !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_FAMILY_SUPPORT_KEY); +} +/** + * Checks if there is a current value set for the font family block support. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a font family value set. + */ + +function hasFontFamilyValue(props) { + return !!props.attributes.fontFamily; +} +/** + * Resets the font family block support attribute. This can be used when + * disabling the font family support controls for a block via a progressive + * discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetFontFamily(_ref5) { + let { + setAttributes + } = _ref5; + setAttributes({ + fontFamily: undefined + }); +} +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/fontFamily/addAttribute', font_family_addAttributes); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/fontFamily/addSaveProps', font_family_addSaveProps); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/fontFamily/addEditProps', font_family_addEditProps); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/utils.js +/** + * External dependencies + */ + +/** + * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. + * If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. + * + * @param {Array} fontSizes Array of font size objects containing at least the "name" and "size" values as properties. + * @param {?string} fontSizeAttribute Content of the font size attribute (slug). + * @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value). + * + * @return {?Object} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug. + * Otherwise, an object with just the size value based on customFontSize is returned. + */ + +const getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => { + if (fontSizeAttribute) { + const fontSizeObject = (0,external_lodash_namespaceObject.find)(fontSizes, { + slug: fontSizeAttribute + }); + + if (fontSizeObject) { + return fontSizeObject; + } + } + + return { + size: customFontSizeAttribute + }; +}; +/** + * Returns the corresponding font size object for a given value. + * + * @param {Array} fontSizes Array of font size objects. + * @param {number} value Font size value. + * + * @return {Object} Font size object. + */ + +function getFontSizeObjectByValue(fontSizes, value) { + const fontSizeObject = (0,external_lodash_namespaceObject.find)(fontSizes, { + size: value + }); + + if (fontSizeObject) { + return fontSizeObject; + } + + return { + size: value + }; +} +/** + * Returns a class based on fontSizeName. + * + * @param {string} fontSizeSlug Slug of the fontSize. + * + * @return {string} String with the class corresponding to the fontSize passed. + * The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'. + */ + +function getFontSizeClass(fontSizeSlug) { + if (!fontSizeSlug) { + return; + } + + return `has-${(0,external_lodash_namespaceObject.kebabCase)(fontSizeSlug)}-font-size`; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js + + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + +function FontSizePicker(props) { + const fontSizes = useSetting('typography.fontSizes'); + const disableCustomFontSizes = !useSetting('typography.customFontSize'); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FontSizePicker, _extends({}, props, { + fontSizes: fontSizes, + disableCustomFontSizes: disableCustomFontSizes + })); +} + +/* harmony default export */ var font_size_picker = (FontSizePicker); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize'; +/** + * Filters registered block settings, extending attributes to include + * `fontSize` and `fontWeight` attributes. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + +function font_size_addAttributes(settings) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_SIZE_SUPPORT_KEY)) { + return settings; + } // Allow blocks to specify a default value if needed. + + + if (!settings.attributes.fontSize) { + Object.assign(settings.attributes, { + fontSize: { + type: 'string' + } + }); + } + + return settings; +} +/** + * Override props assigned to save component to inject font size. + * + * @param {Object} props Additional props applied to save element. + * @param {Object} blockType Block type. + * @param {Object} attributes Block attributes. + * + * @return {Object} Filtered props applied to save element. + */ + + +function font_size_addSaveProps(props, blockType, attributes) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_SIZE_SUPPORT_KEY)) { + return props; + } + + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'typography.__experimentalSkipSerialization')) { + return props; + } // Use TokenList to dedupe classes. + + + const classes = new (external_wp_tokenList_default())(props.className); + classes.add(getFontSizeClass(attributes.fontSize)); + const newClassName = classes.value; + props.className = newClassName ? newClassName : undefined; + return props; +} +/** + * Filters registered block settings to expand the block edit wrapper + * by applying the desired styles and classnames. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + + +function font_size_addEditProps(settings) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_SIZE_SUPPORT_KEY)) { + return settings; + } + + const existingGetEditWrapperProps = settings.getEditWrapperProps; + + settings.getEditWrapperProps = attributes => { + let props = {}; + + if (existingGetEditWrapperProps) { + props = existingGetEditWrapperProps(attributes); + } + + return font_size_addSaveProps(props, settings, attributes); + }; + + return settings; +} +/** + * Inspector control panel containing the font size related configuration + * + * @param {Object} props + * + * @return {WPElement} Font size edit element. + */ + + +function FontSizeEdit(props) { + var _style$typography, _style$typography2; + + const { + attributes: { + fontSize, + style + }, + setAttributes + } = props; + const fontSizes = useSetting('typography.fontSizes'); + + const onChange = value => { + const fontSizeSlug = getFontSizeObjectByValue(fontSizes, value).slug; + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + fontSize: fontSizeSlug ? undefined : value + } + }), + fontSize: fontSizeSlug + }); + }; + + const fontSizeObject = getFontSize(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize); + const fontSizeValue = (fontSizeObject === null || fontSizeObject === void 0 ? void 0 : fontSizeObject.size) || (style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontSize) || fontSize; + return (0,external_wp_element_namespaceObject.createElement)(font_size_picker, { + onChange: onChange, + value: fontSizeValue, + withReset: false + }); +} +/** + * Checks if there is a current value set for the font size block support. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a font size value set. + */ + +function hasFontSizeValue(props) { + var _style$typography3; + + const { + fontSize, + style + } = props.attributes; + return !!fontSize || !!(style !== null && style !== void 0 && (_style$typography3 = style.typography) !== null && _style$typography3 !== void 0 && _style$typography3.fontSize); +} +/** + * Resets the font size block support attribute. This can be used when + * disabling the font size support controls for a block via a progressive + * discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetFontSize(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + fontSize: undefined, + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + fontSize: undefined + } + }) + }); +} +/** + * Custom hook that checks if font-size settings have been disabled. + * + * @param {string} name The name of the block. + * @return {boolean} Whether setting is disabled. + */ + +function useIsFontSizeDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const fontSizes = useSetting('typography.fontSizes'); + const hasFontSizes = !!(fontSizes !== null && fontSizes !== void 0 && fontSizes.length); + return !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, FONT_SIZE_SUPPORT_KEY) || !hasFontSizes; +} +/** + * Add inline styles for font sizes. + * Ideally, this is not needed and themes load the font-size classes on the + * editor. + * + * @param {Function} BlockListBlock Original component. + * + * @return {Function} Wrapped component. + */ + +const withFontSizeInlineStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { + var _style$typography4, _style$typography5; + + const fontSizes = useSetting('typography.fontSizes'); + const { + name: blockName, + attributes: { + fontSize, + style + }, + wrapperProps + } = props; // Only add inline styles if the block supports font sizes, + // doesn't skip serialization of font sizes, + // doesn't already have an inline font size, + // and does have a class to extract the font size from. + + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, FONT_SIZE_SUPPORT_KEY) || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'typography.__experimentalSkipSerialization') || !fontSize || style !== null && style !== void 0 && (_style$typography4 = style.typography) !== null && _style$typography4 !== void 0 && _style$typography4.fontSize) { + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props); + } + + const fontSizeValue = getFontSize(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography5 = style.typography) === null || _style$typography5 === void 0 ? void 0 : _style$typography5.fontSize).size; + const newProps = { ...props, + wrapperProps: { ...wrapperProps, + style: { + fontSize: fontSizeValue, + ...(wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style) + } + } + }; + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, newProps); +}, 'withFontSizeInlineStyles'); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-underline.js + + +/** + * WordPress dependencies + */ + +const formatUnderline = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z" +})); +/* harmony default export */ var format_underline = (formatUnderline); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js + + +/** + * WordPress dependencies + */ + +const formatStrikethrough = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var format_strikethrough = (formatStrikethrough); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js + + +/** + * WordPress dependencies + */ + + + +const TEXT_DECORATIONS = [{ + name: (0,external_wp_i18n_namespaceObject.__)('Underline'), + value: 'underline', + icon: format_underline +}, { + name: (0,external_wp_i18n_namespaceObject.__)('Strikethrough'), + value: 'line-through', + icon: format_strikethrough +}]; +/** + * Control to facilitate text decoration selections. + * + * @param {Object} props Component props. + * @param {string} props.value Currently selected text decoration. + * @param {Function} props.onChange Handles change in text decoration selection. + * + * @return {WPElement} Text decoration control. + */ + +function TextDecorationControl(_ref) { + let { + value, + onChange + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "block-editor-text-decoration-control" + }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Decoration')), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-text-decoration-control__buttons" + }, TEXT_DECORATIONS.map(textDecoration => { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: textDecoration.value, + icon: textDecoration.icon, + isSmall: true, + isPressed: textDecoration.value === value, + onClick: () => onChange(textDecoration.value === value ? undefined : textDecoration.value), + "aria-label": textDecoration.name + }); + }))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/text-decoration.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +/** + * Key within block settings' supports array indicating support for text + * decorations e.g. settings found in `block.json`. + */ + +const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration'; +/** + * Inspector control panel containing the text decoration options. + * + * @param {Object} props Block properties. + * + * @return {WPElement} Text decoration edit element. + */ + +function TextDecorationEdit(props) { + var _style$typography; + + const { + attributes: { + style + }, + setAttributes + } = props; + + function onChange(newDecoration) { + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + textDecoration: newDecoration + } + }) + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(TextDecorationControl, { + value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.textDecoration, + onChange: onChange + }); +} +/** + * Checks if text-decoration settings have been disabled. + * + * @param {string} name Name of the block. + * + * @return {boolean} Whether or not the setting is disabled. + */ + +function useIsTextDecorationDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const notSupported = !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, TEXT_DECORATION_SUPPORT_KEY); + const hasTextDecoration = useSetting('typography.textDecoration'); + return notSupported || !hasTextDecoration; +} +/** + * Checks if there is a current value set for the text decoration block support. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a text decoration set. + */ + +function hasTextDecorationValue(props) { + var _props$attributes$sty, _props$attributes$sty2; + + return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.textDecoration); +} +/** + * Resets the text decoration block support attribute. This can be used when + * disabling the text decoration support controls for a block via a progressive + * discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetTextDecoration(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + textDecoration: undefined + } + }) + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-uppercase.js + + +/** + * WordPress dependencies + */ + +const formatUppercase = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z" +})); +/* harmony default export */ var format_uppercase = (formatUppercase); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-lowercase.js + + +/** + * WordPress dependencies + */ + +const formatLowercase = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z" +})); +/* harmony default export */ var format_lowercase = (formatLowercase); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-capitalize.js + + +/** + * WordPress dependencies + */ + +const formatCapitalize = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z" +})); +/* harmony default export */ var format_capitalize = (formatCapitalize); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js + + +/** + * WordPress dependencies + */ + + + +const TEXT_TRANSFORMS = [{ + name: (0,external_wp_i18n_namespaceObject.__)('Uppercase'), + value: 'uppercase', + icon: format_uppercase +}, { + name: (0,external_wp_i18n_namespaceObject.__)('Lowercase'), + value: 'lowercase', + icon: format_lowercase +}, { + name: (0,external_wp_i18n_namespaceObject.__)('Capitalize'), + value: 'capitalize', + icon: format_capitalize +}]; +/** + * Control to facilitate text transform selections. + * + * @param {Object} props Component props. + * @param {string} props.value Currently selected text transform. + * @param {Function} props.onChange Handles change in text transform selection. + * + * @return {WPElement} Text transform control. + */ + +function TextTransformControl(_ref) { + let { + value, + onChange + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "block-editor-text-transform-control" + }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Letter case')), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-text-transform-control__buttons" + }, TEXT_TRANSFORMS.map(textTransform => { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: textTransform.value, + icon: textTransform.icon, + isSmall: true, + isPressed: value === textTransform.value, + "aria-label": textTransform.name, + onClick: () => onChange(value === textTransform.value ? undefined : textTransform.value) + }); + }))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/text-transform.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +/** + * Key within block settings' supports array indicating support for text + * transforms e.g. settings found in `block.json`. + */ + +const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform'; +/** + * Inspector control panel containing the text transform options. + * + * @param {Object} props Block properties. + * + * @return {WPElement} Text transform edit element. + */ + +function TextTransformEdit(props) { + var _style$typography; + + const { + attributes: { + style + }, + setAttributes + } = props; + + function onChange(newTransform) { + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + textTransform: newTransform + } + }) + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(TextTransformControl, { + value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.textTransform, + onChange: onChange + }); +} +/** + * Checks if text-transform settings have been disabled. + * + * @param {string} name Name of the block. + * + * @return {boolean} Whether or not the setting is disabled. + */ + +function useIsTextTransformDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const notSupported = !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, TEXT_TRANSFORM_SUPPORT_KEY); + const hasTextTransforms = useSetting('typography.textTransform'); + return notSupported || !hasTextTransforms; +} +/** + * Checks if there is a current value set for the text transform block support. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a text transform set. + */ + +function hasTextTransformValue(props) { + var _props$attributes$sty, _props$attributes$sty2; + + return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.textTransform); +} +/** + * Resets the text transform block support attribute. This can be used when + * disabling the text transform support controls for a block via a progressive + * discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetTextTransform(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + textTransform: undefined + } + }) + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/letter-spacing-control/index.js + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * Control for letter-spacing. + * + * @param {Object} props Component props. + * @param {string} props.value Currently selected letter-spacing. + * @param {Function} props.onChange Handles change in letter-spacing selection. + * @param {boolean} props.__unstableInputWidth Input width to pass through to inner UnitControl. + * + * @return {WPElement} Letter-spacing control. + */ + +function LetterSpacingControl(_ref) { + let { + value, + onChange, + __unstableInputWidth = '60px' + } = _ref; + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem'], + defaultValues: { + px: '2', + em: '.2', + rem: '.2' + } + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Letter-spacing'), + value: value, + __unstableInputWidth: __unstableInputWidth, + units: units, + onChange: onChange + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/letter-spacing.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +/** + * Key within block settings' supports array indicating support for letter-spacing + * e.g. settings found in `block.json`. + */ + +const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing'; +/** + * Inspector control panel containing the letter-spacing options. + * + * @param {Object} props Block properties. + * @return {WPElement} Letter-spacing edit element. + */ + +function LetterSpacingEdit(props) { + var _style$typography; + + const { + attributes: { + style + }, + setAttributes + } = props; + + function onChange(newSpacing) { + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + letterSpacing: newSpacing + } + }) + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(LetterSpacingControl, { + value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.letterSpacing, + onChange: onChange, + __unstableInputWidth: false + }); +} +/** + * Checks if letter-spacing settings have been disabled. + * + * @param {string} name Name of the block. + * @return {boolean} Whether or not the setting is disabled. + */ + +function useIsLetterSpacingDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const notSupported = !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, LETTER_SPACING_SUPPORT_KEY); + const hasLetterSpacing = useSetting('typography.letterSpacing'); + return notSupported || !hasLetterSpacing; +} +/** + * Checks if there is a current value set for the letter spacing block support. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a letter spacing set. + */ + +function hasLetterSpacingValue(props) { + var _props$attributes$sty, _props$attributes$sty2; + + return !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.typography) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.letterSpacing); +} +/** + * Resets the letter spacing block support attribute. This can be used when + * disabling the letter spacing support controls for a block via a progressive + * discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetLetterSpacing(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: cleanEmptyObject({ ...style, + typography: { ...(style === null || style === void 0 ? void 0 : style.typography), + letterSpacing: undefined + } + }) + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + + + + + +const TYPOGRAPHY_SUPPORT_KEY = 'typography'; +const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY]; +function TypographyPanel(props) { + const { + clientId + } = props; + const isFontFamilyDisabled = useIsFontFamilyDisabled(props); + const isFontSizeDisabled = useIsFontSizeDisabled(props); + const isFontAppearanceDisabled = useIsFontAppearanceDisabled(props); + const isLineHeightDisabled = useIsLineHeightDisabled(props); + const isTextDecorationDisabled = useIsTextDecorationDisabled(props); + const isTextTransformDisabled = useIsTextTransformDisabled(props); + const isLetterSpacingDisabled = useIsLetterSpacingDisabled(props); + const hasFontStyles = !useIsFontStyleDisabled(props); + const hasFontWeights = !useIsFontWeightDisabled(props); + const isDisabled = useIsTypographyDisabled(props); + const isSupported = hasTypographySupport(props.name); + if (isDisabled || !isSupported) return null; + const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [TYPOGRAPHY_SUPPORT_KEY, '__experimentalDefaultControls']); + + const createResetAllFilter = attribute => newAttributes => { + var _newAttributes$style; + + return { ...newAttributes, + style: { ...newAttributes.style, + typography: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.typography), + [attribute]: undefined + } + } + }; + }; + + return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, { + __experimentalGroup: "typography" + }, !isFontFamilyDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => hasFontFamilyValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Font family'), + onDeselect: () => resetFontFamily(props), + isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontFamily, + resetAllFilter: newAttributes => ({ ...newAttributes, + fontFamily: undefined + }), + panelId: clientId + }, (0,external_wp_element_namespaceObject.createElement)(FontFamilyEdit, props)), !isFontSizeDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => hasFontSizeValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Font size'), + onDeselect: () => resetFontSize(props), + isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontSize, + resetAllFilter: newAttributes => { + var _newAttributes$style2; + + return { ...newAttributes, + fontSize: undefined, + style: { ...newAttributes.style, + typography: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.typography), + fontSize: undefined + } + } + }; + }, + panelId: clientId + }, (0,external_wp_element_namespaceObject.createElement)(FontSizeEdit, props)), !isFontAppearanceDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + className: "single-column", + hasValue: () => hasFontAppearanceValue(props), + label: getFontAppearanceLabel(hasFontStyles, hasFontWeights), + onDeselect: () => resetFontAppearance(props), + isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontAppearance, + resetAllFilter: newAttributes => { + var _newAttributes$style3; + + return { ...newAttributes, + style: { ...newAttributes.style, + typography: { ...((_newAttributes$style3 = newAttributes.style) === null || _newAttributes$style3 === void 0 ? void 0 : _newAttributes$style3.typography), + fontStyle: undefined, + fontWeight: undefined + } + } + }; + }, + panelId: clientId + }, (0,external_wp_element_namespaceObject.createElement)(FontAppearanceEdit, props)), !isLineHeightDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + className: "single-column", + hasValue: () => hasLineHeightValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Line height'), + onDeselect: () => resetLineHeight(props), + isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.lineHeight, + resetAllFilter: createResetAllFilter('lineHeight'), + panelId: clientId + }, (0,external_wp_element_namespaceObject.createElement)(LineHeightEdit, props)), !isTextDecorationDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + className: "single-column", + hasValue: () => hasTextDecorationValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Decoration'), + onDeselect: () => resetTextDecoration(props), + isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textDecoration, + resetAllFilter: createResetAllFilter('textDecoration'), + panelId: clientId + }, (0,external_wp_element_namespaceObject.createElement)(TextDecorationEdit, props)), !isTextTransformDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + className: "single-column", + hasValue: () => hasTextTransformValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Letter case'), + onDeselect: () => resetTextTransform(props), + isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textTransform, + resetAllFilter: createResetAllFilter('textTransform'), + panelId: clientId + }, (0,external_wp_element_namespaceObject.createElement)(TextTransformEdit, props)), !isLetterSpacingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + className: "single-column", + hasValue: () => hasLetterSpacingValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Letter-spacing'), + onDeselect: () => resetLetterSpacing(props), + isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.letterSpacing, + resetAllFilter: createResetAllFilter('letterSpacing'), + panelId: clientId + }, (0,external_wp_element_namespaceObject.createElement)(LetterSpacingEdit, props))); +} +const hasTypographySupport = blockName => { + return TYPOGRAPHY_SUPPORT_KEYS.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, key)); +}; + +function useIsTypographyDisabled() { + let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const configs = [useIsFontAppearanceDisabled(props), useIsFontSizeDisabled(props), useIsLineHeightDisabled(props), useIsFontFamilyDisabled(props), useIsTextDecorationDisabled(props), useIsTextTransformDisabled(props), useIsLetterSpacingDisabled(props)]; + return configs.filter(Boolean).length === configs.length; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/gap.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + +/** + * Determines if there is gap support. + * + * @param {string|Object} blockType Block name or Block Type object. + * @return {boolean} Whether there is support. + */ + +function hasGapSupport(blockType) { + const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY); + return !!(true === support || support !== null && support !== void 0 && support.blockGap); +} +/** + * Checks if there is a current value in the gap block support attributes. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a gap value set. + */ + +function hasGapValue(props) { + var _props$attributes$sty, _props$attributes$sty2; + + return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.blockGap) !== undefined; +} +/** + * Resets the gap block support attribute. This can be used when disabling + * the gap support controls for a block via a progressive discovery panel. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetGap(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: { ...style, + spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), + blockGap: undefined + } + } + }); +} +/** + * Custom hook that checks if gap settings have been disabled. + * + * @param {string} name The name of the block. + * @return {boolean} Whether the gap setting is disabled. + */ + +function useIsGapDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const isDisabled = !useSetting('spacing.blockGap'); + return !hasGapSupport(blockName) || isDisabled; +} +/** + * Inspector control panel containing the gap related configuration + * + * @param {Object} props + * + * @return {WPElement} Gap edit element. + */ + +function GapEdit(props) { + var _style$spacing; + + const { + clientId, + attributes: { + style + }, + setAttributes + } = props; + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] + }); + const ref = useBlockRef(clientId); + + if (useIsGapDisabled(props)) { + return null; + } + + const onChange = next => { + var _window; + + const newStyle = { ...style, + spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), + blockGap: next + } + }; + setAttributes({ + style: cleanEmptyObject(newStyle) + }); // In Safari, changing the `gap` CSS value on its own will not trigger the layout + // to be recalculated / re-rendered. To force the updated gap to re-render, here + // we replace the block's node with itself. + + const isSafari = ((_window = window) === null || _window === void 0 ? void 0 : _window.navigator.userAgent) && window.navigator.userAgent.includes('Safari') && !window.navigator.userAgent.includes('Chrome ') && !window.navigator.userAgent.includes('Chromium '); + + if (ref.current && isSafari) { + var _ref$current$parentNo; + + (_ref$current$parentNo = ref.current.parentNode) === null || _ref$current$parentNo === void 0 ? void 0 : _ref$current$parentNo.replaceChild(ref.current, ref.current); + } + }; + + return external_wp_element_namespaceObject.Platform.select({ + web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'), + __unstableInputWidth: "80px", + min: 0, + onChange: onChange, + units: units, + value: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap + })), + native: null + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/margin.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +/** + * Determines if there is margin support. + * + * @param {string|Object} blockType Block name or Block Type object. + * + * @return {boolean} Whether there is support. + */ + +function hasMarginSupport(blockType) { + const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY); + return !!(true === support || support !== null && support !== void 0 && support.margin); +} +/** + * Checks if there is a current value in the margin block support attributes. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a margin value set. + */ + +function hasMarginValue(props) { + var _props$attributes$sty, _props$attributes$sty2; + + return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.margin) !== undefined; +} +/** + * Resets the margin block support attributes. This can be used when disabling + * the margin support controls for a block via a `ToolsPanel`. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetMargin(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: cleanEmptyObject({ ...style, + spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), + margin: undefined + } + }) + }); +} +/** + * Custom hook that checks if margin settings have been disabled. + * + * @param {string} name The name of the block. + * + * @return {boolean} Whether margin setting is disabled. + */ + +function useIsMarginDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const isDisabled = !useSetting('spacing.margin'); + const isInvalid = !useIsDimensionsSupportValid(blockName, 'margin'); + return !hasMarginSupport(blockName) || isDisabled || isInvalid; +} +/** + * Inspector control panel containing the margin related configuration + * + * @param {Object} props Block props. + * + * @return {WPElement} Margin edit element. + */ + +function MarginEdit(props) { + var _style$spacing; + + const { + name: blockName, + attributes: { + style + }, + setAttributes + } = props; + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] + }); + const sides = useCustomSides(blockName, 'margin'); + const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side)); + + if (useIsMarginDisabled(props)) { + return null; + } + + const onChange = next => { + const newStyle = { ...style, + spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), + margin: next + } + }; + setAttributes({ + style: cleanEmptyObject(newStyle) + }); + }; + + const onChangeShowVisualizer = next => { + const newStyle = { ...style, + visualizers: { + margin: next + } + }; + setAttributes({ + style: cleanEmptyObject(newStyle) + }); + }; + + return external_wp_element_namespaceObject.Platform.select({ + web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, { + values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin, + onChange: onChange, + onChangeShowVisualizer: onChangeShowVisualizer, + label: (0,external_wp_i18n_namespaceObject.__)('Margin'), + sides: sides, + units: units, + allowReset: false, + splitOnAxis: splitOnAxis + })), + native: null + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/padding.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +/** + * Determines if there is padding support. + * + * @param {string|Object} blockType Block name or Block Type object. + * + * @return {boolean} Whether there is support. + */ + +function hasPaddingSupport(blockType) { + const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY); + return !!(true === support || support !== null && support !== void 0 && support.padding); +} +/** + * Checks if there is a current value in the padding block support attributes. + * + * @param {Object} props Block props. + * @return {boolean} Whether or not the block has a padding value set. + */ + +function hasPaddingValue(props) { + var _props$attributes$sty, _props$attributes$sty2; + + return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.padding) !== undefined; +} +/** + * Resets the padding block support attributes. This can be used when disabling + * the padding support controls for a block via a `ToolsPanel`. + * + * @param {Object} props Block props. + * @param {Object} props.attributes Block's attributes. + * @param {Object} props.setAttributes Function to set block's attributes. + */ + +function resetPadding(_ref) { + let { + attributes = {}, + setAttributes + } = _ref; + const { + style + } = attributes; + setAttributes({ + style: cleanEmptyObject({ ...style, + spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), + padding: undefined + } + }) + }); +} +/** + * Custom hook that checks if padding settings have been disabled. + * + * @param {string} name The name of the block. + * + * @return {boolean} Whether padding setting is disabled. + */ + +function useIsPaddingDisabled() { + let { + name: blockName + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const isDisabled = !useSetting('spacing.padding'); + const isInvalid = !useIsDimensionsSupportValid(blockName, 'padding'); + return !hasPaddingSupport(blockName) || isDisabled || isInvalid; +} +/** + * Inspector control panel containing the padding related configuration + * + * @param {Object} props + * + * @return {WPElement} Padding edit element. + */ + +function PaddingEdit(props) { + var _style$spacing; + + const { + name: blockName, + attributes: { + style + }, + setAttributes + } = props; + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] + }); + const sides = useCustomSides(blockName, 'padding'); + const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side)); + + if (useIsPaddingDisabled(props)) { + return null; + } + + const onChange = next => { + const newStyle = { ...style, + spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing), + padding: next + } + }; + setAttributes({ + style: cleanEmptyObject(newStyle) + }); + }; + + const onChangeShowVisualizer = next => { + const newStyle = { ...style, + visualizers: { + padding: next + } + }; + setAttributes({ + style: cleanEmptyObject(newStyle) + }); + }; + + return external_wp_element_namespaceObject.Platform.select({ + web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, { + values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding, + onChange: onChange, + onChangeShowVisualizer: onChangeShowVisualizer, + label: (0,external_wp_i18n_namespaceObject.__)('Padding'), + sides: sides, + units: units, + allowReset: false, + splitOnAxis: splitOnAxis + })), + native: null + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/dimensions.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + +const SPACING_SUPPORT_KEY = 'spacing'; +const ALL_SIDES = ['top', 'right', 'bottom', 'left']; +const AXIAL_SIDES = ['vertical', 'horizontal']; +/** + * Inspector controls for dimensions support. + * + * @param {Object} props Block props. + * + * @return {WPElement} Inspector controls for spacing support features. + */ + +function DimensionsPanel(props) { + const isGapDisabled = useIsGapDisabled(props); + const isPaddingDisabled = useIsPaddingDisabled(props); + const isMarginDisabled = useIsMarginDisabled(props); + const isDisabled = useIsDimensionsDisabled(props); + const isSupported = hasDimensionsSupport(props.name); + + if (isDisabled || !isSupported) { + return null; + } + + const defaultSpacingControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']); + + const createResetAllFilter = attribute => newAttributes => { + var _newAttributes$style; + + return { ...newAttributes, + style: { ...newAttributes.style, + spacing: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.spacing), + [attribute]: undefined + } + } + }; + }; + + return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, { + __experimentalGroup: "dimensions" + }, !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => hasPaddingValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Padding'), + onDeselect: () => resetPadding(props), + resetAllFilter: createResetAllFilter('padding'), + isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.padding, + panelId: props.clientId + }, (0,external_wp_element_namespaceObject.createElement)(PaddingEdit, props)), !isMarginDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => hasMarginValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Margin'), + onDeselect: () => resetMargin(props), + resetAllFilter: createResetAllFilter('margin'), + isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.margin, + panelId: props.clientId + }, (0,external_wp_element_namespaceObject.createElement)(MarginEdit, props)), !isGapDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => hasGapValue(props), + label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'), + onDeselect: () => resetGap(props), + resetAllFilter: createResetAllFilter('blockGap'), + isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap, + panelId: props.clientId + }, (0,external_wp_element_namespaceObject.createElement)(GapEdit, props))); +} +/** + * Determine whether there is dimensions related block support. + * + * @param {string} blockName Block name. + * + * @return {boolean} Whether there is support. + */ + +function hasDimensionsSupport(blockName) { + if (external_wp_element_namespaceObject.Platform.OS !== 'web') { + return false; + } + + return hasGapSupport(blockName) || hasPaddingSupport(blockName) || hasMarginSupport(blockName); +} +/** + * Determines whether dimensions support has been disabled. + * + * @param {Object} props Block properties. + * + * @return {boolean} If spacing support is completely disabled. + */ + +const useIsDimensionsDisabled = function () { + let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const gapDisabled = useIsGapDisabled(props); + const paddingDisabled = useIsPaddingDisabled(props); + const marginDisabled = useIsMarginDisabled(props); + return gapDisabled && paddingDisabled && marginDisabled; +}; +/** + * Custom hook to retrieve which padding/margin is supported + * e.g. top, right, bottom or left. + * + * Sides are opted into by default. It is only if a specific side is set to + * false that it is omitted. + * + * @param {string} blockName Block name. + * @param {string} feature The feature custom sides relate to e.g. padding or margins. + * + * @return {Object} Sides supporting custom margin. + */ + + +function useCustomSides(blockName, feature) { + const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, SPACING_SUPPORT_KEY); // Skip when setting is boolean as theme isn't setting arbitrary sides. + + if (!support || typeof support[feature] === 'boolean') { + return; + } + + return support[feature]; +} +/** + * Custom hook to determine whether the sides configured in the + * block support are valid. A dimension property cannot declare + * support for a mix of axial and individual sides. + * + * @param {string} blockName Block name. + * @param {string} feature The feature custom sides relate to e.g. padding or margins. + * + * @return {boolean} If the feature has a valid configuration of sides. + */ + +function useIsDimensionsSupportValid(blockName, feature) { + const sides = useCustomSides(blockName, feature); + + if (sides && sides.some(side => ALL_SIDES.includes(side)) && sides.some(side => AXIAL_SIDES.includes(side))) { + // eslint-disable-next-line no-console + console.warn(`The ${feature} support for the "${blockName}" block can not be configured to support both axial and arbitrary sides.`); + return false; + } + + return true; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/style.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + + +const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY]; + +const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key)); + +const VARIABLE_REFERENCE_PREFIX = 'var:'; +const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|'; +const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--'; + +function compileStyleValue(uncompiledValue) { + if ((0,external_lodash_namespaceObject.startsWith)(uncompiledValue, VARIABLE_REFERENCE_PREFIX)) { + const variable = uncompiledValue.slice(VARIABLE_REFERENCE_PREFIX.length).split(VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).join(VARIABLE_PATH_SEPARATOR_TOKEN_STYLE); + return `var(--wp--${variable})`; + } + + return uncompiledValue; +} +/** + * Returns the inline styles to add depending on the style object + * + * @param {Object} styles Styles configuration. + * + * @return {Object} Flattened CSS variables declaration. + */ + + +function getInlineStyles() { + let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const ignoredStyles = ['spacing.blockGap']; + const output = {}; + Object.keys(external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY).forEach(propKey => { + const path = external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[propKey].value; + const subPaths = external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[propKey].properties; // Ignore styles on elements because they are handled on the server. + + if ((0,external_lodash_namespaceObject.has)(styles, path) && 'elements' !== (0,external_lodash_namespaceObject.first)(path)) { + // Checking if style value is a string allows for shorthand css + // option and backwards compatibility for border radius support. + const styleValue = (0,external_lodash_namespaceObject.get)(styles, path); + + if (!!subPaths && !(0,external_lodash_namespaceObject.isString)(styleValue)) { + Object.entries(subPaths).forEach(entry => { + const [name, subPath] = entry; + const value = (0,external_lodash_namespaceObject.get)(styleValue, [subPath]); + + if (value) { + output[name] = compileStyleValue(value); + } + }); + } else if (!ignoredStyles.includes(path.join('.'))) { + output[propKey] = compileStyleValue((0,external_lodash_namespaceObject.get)(styles, path)); + } + } + }); + return output; +} + +function compileElementsStyles(selector) { + let elements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return (0,external_lodash_namespaceObject.map)(elements, (styles, element) => { + const elementStyles = getInlineStyles(styles); + + if (!(0,external_lodash_namespaceObject.isEmpty)(elementStyles)) { + return [`.${selector} ${external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]}{`, ...(0,external_lodash_namespaceObject.map)(elementStyles, (value, property) => `\t${(0,external_lodash_namespaceObject.kebabCase)(property)}: ${value};`), '}'].join('\n'); + } + + return ''; + }).join('\n'); +} +/** + * Filters registered block settings, extending attributes to include `style` attribute. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + + +function style_addAttribute(settings) { + if (!hasStyleSupport(settings)) { + return settings; + } // allow blocks to specify their own attribute definition with default values if needed. + + + if (!settings.attributes.style) { + Object.assign(settings.attributes, { + style: { + type: 'object' + } + }); + } + + return settings; +} +/** + * A dictionary of paths to flag skipping block support serialization as the key, + * with values providing the style paths to be omitted from serialization. + * + * @constant + * @type {Record} + */ + + +const skipSerializationPathsEdit = { + [`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['border'], + [`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [COLOR_SUPPORT_KEY], + [`${TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [TYPOGRAPHY_SUPPORT_KEY], + [`${SPACING_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['spacing'] +}; +/** + * A dictionary of paths to flag skipping block support serialization as the key, + * with values providing the style paths to be omitted from serialization. + * + * Extends the Edit skip paths to enable skipping additional paths in just + * the Save component. This allows a block support to be serialized within the + * editor, while using an alternate approach, such as server-side rendering, when + * the support is saved. + * + * @constant + * @type {Record} + */ + +const skipSerializationPathsSave = { ...skipSerializationPathsEdit, + [`${SPACING_SUPPORT_KEY}`]: ['spacing.blockGap'] +}; +/** + * Override props assigned to save component to inject the CSS variables definition. + * + * @param {Object} props Additional props applied to save element. + * @param {Object} blockType Block type. + * @param {Object} attributes Block attributes. + * @param {?Record} skipPaths An object of keys and paths to skip serialization. + * + * @return {Object} Filtered props applied to save element. + */ + +function style_addSaveProps(props, blockType, attributes) { + let skipPaths = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : skipSerializationPathsSave; + + if (!hasStyleSupport(blockType)) { + return props; + } + + let { + style + } = attributes; + (0,external_lodash_namespaceObject.forEach)(skipPaths, (path, indicator) => { + if ((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, indicator)) { + style = (0,external_lodash_namespaceObject.omit)(style, path); + } + }); + props.style = { ...getInlineStyles(style), + ...props.style + }; + return props; +} +/** + * Filters registered block settings to extend the block edit wrapper + * to apply the desired styles and classnames properly. + * + * @param {Object} settings Original block settings. + * + * @return {Object}.Filtered block settings. + */ + +function style_addEditProps(settings) { + if (!hasStyleSupport(settings)) { + return settings; + } + + const existingGetEditWrapperProps = settings.getEditWrapperProps; + + settings.getEditWrapperProps = attributes => { + let props = {}; + + if (existingGetEditWrapperProps) { + props = existingGetEditWrapperProps(attributes); + } + + return style_addSaveProps(props, settings, attributes, skipSerializationPathsEdit); + }; + + return settings; +} +/** + * Override the default edit UI to include new inspector controls for + * all the custom styles configs. + * + * @param {Function} BlockEdit Original component. + * + * @return {Function} Wrapped component. + */ + +const withBlockControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { + const shouldDisplayControls = useDisplayBlockControls(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, shouldDisplayControls && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ColorEdit, props), (0,external_wp_element_namespaceObject.createElement)(TypographyPanel, props), (0,external_wp_element_namespaceObject.createElement)(BorderPanel, props), (0,external_wp_element_namespaceObject.createElement)(DimensionsPanel, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props)); +}, 'withToolbarControls'); +/** + * Override the default block element to include duotone styles. + * + * @param {Function} BlockListBlock Original component + * @return {Function} Wrapped component + */ + +const withElementsStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { + var _props$attributes$sty, _props$attributes$sty2; + + const elements = (_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements; + const blockElementsContainerIdentifier = `wp-elements-${(0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock)}`; + const styles = compileElementsStyles(blockElementsContainerIdentifier, (_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements); + const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, elements && element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)("style", { + dangerouslySetInnerHTML: { + __html: styles + } + }), element), (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, { + className: elements ? classnames_default()(props.className, blockElementsContainerIdentifier) : props.className + }))); +}); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/style/addAttribute', style_addAttribute); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/style/addSaveProps', style_addSaveProps); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/style/addEditProps', style_addEditProps); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/style/with-block-controls', withBlockControls); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/with-elements-styles', withElementsStyles); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/duotone-control/index.js + + +/** + * WordPress dependencies + */ + + + + +function DuotoneControl(_ref) { + let { + colorPalette, + duotonePalette, + disableCustomColors, + disableCustomDuotone, + value, + onChange + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + popoverProps: { + className: 'block-editor-duotone-control__popover', + headerTitle: (0,external_wp_i18n_namespaceObject.__)('Duotone'), + isAlternate: true + }, + renderToggle: _ref2 => { + let { + isOpen, + onToggle + } = _ref2; + + const openOnArrowDown = event => { + if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { + event.preventDefault(); + onToggle(); + } + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + showTooltip: true, + onClick: onToggle, + "aria-haspopup": "true", + "aria-expanded": isOpen, + onKeyDown: openOnArrowDown, + label: (0,external_wp_i18n_namespaceObject.__)('Apply duotone filter'), + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DuotoneSwatch, { + values: value + }) + }); + }, + renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Duotone') + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-duotone-control__description" + }, (0,external_wp_i18n_namespaceObject.__)('Create a two-tone color effect without losing your original image.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DuotonePicker, { + colorPalette: colorPalette, + duotonePalette: duotonePalette, + disableCustomColors: disableCustomColors, + disableCustomDuotone: disableCustomDuotone, + value: value, + onChange: onChange + })) + }); +} + +/* harmony default export */ var duotone_control = (DuotoneControl); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/duotone.js + + + +/** + * External dependencies + */ + + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const duotone_EMPTY_ARRAY = []; +k([names]); +/** + * Convert a list of colors to an object of R, G, and B values. + * + * @param {string[]} colors Array of RBG color strings. + * + * @return {Object} R, G, and B values. + */ + +function getValuesFromColors() { + let colors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + const values = { + r: [], + g: [], + b: [], + a: [] + }; + colors.forEach(color => { + const rgbColor = w(color).toRgb(); + values.r.push(rgbColor.r / 255); + values.g.push(rgbColor.g / 255); + values.b.push(rgbColor.b / 255); + values.a.push(rgbColor.a); + }); + return values; +} +/** + * Values for the SVG `feComponentTransfer`. + * + * @typedef Values {Object} + * @property {number[]} r Red values. + * @property {number[]} g Green values. + * @property {number[]} b Blue values. + * @property {number[]} a Alpha values. + */ + +/** + * SVG and stylesheet needed for rendering the duotone filter. + * + * @param {Object} props Duotone props. + * @param {string} props.selector Selector to apply the filter to. + * @param {string} props.id Unique id for this duotone filter. + * @param {Values} props.values R, G, B, and A values to filter with. + * + * @return {WPElement} Duotone element. + */ + +function DuotoneFilter(_ref) { + let { + selector, + id, + values + } = _ref; + const stylesheet = ` +${selector} { + filter: url( #${id} ); +} +`; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + xmlnsXlink: "http://www.w3.org/1999/xlink", + viewBox: "0 0 0 0", + width: "0", + height: "0", + focusable: "false", + role: "none", + style: { + visibility: 'hidden', + position: 'absolute', + left: '-9999px', + overflow: 'hidden' + } + }, (0,external_wp_element_namespaceObject.createElement)("defs", null, (0,external_wp_element_namespaceObject.createElement)("filter", { + id: id + }, (0,external_wp_element_namespaceObject.createElement)("feColorMatrix", { + // Use sRGB instead of linearRGB so transparency looks correct. + colorInterpolationFilters: "sRGB", + type: "matrix" // Use perceptual brightness to convert to grayscale. + , + values: " .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " + }), (0,external_wp_element_namespaceObject.createElement)("feComponentTransfer", { + // Use sRGB instead of linearRGB to be consistent with how CSS gradients work. + colorInterpolationFilters: "sRGB" + }, (0,external_wp_element_namespaceObject.createElement)("feFuncR", { + type: "table", + tableValues: values.r.join(' ') + }), (0,external_wp_element_namespaceObject.createElement)("feFuncG", { + type: "table", + tableValues: values.g.join(' ') + }), (0,external_wp_element_namespaceObject.createElement)("feFuncB", { + type: "table", + tableValues: values.b.join(' ') + }), (0,external_wp_element_namespaceObject.createElement)("feFuncA", { + type: "table", + tableValues: values.a.join(' ') + })), (0,external_wp_element_namespaceObject.createElement)("feComposite", { + // Re-mask the image with the original transparency since the feColorMatrix above loses that information. + in2: "SourceGraphic", + operator: "in" + })))), (0,external_wp_element_namespaceObject.createElement)("style", { + dangerouslySetInnerHTML: { + __html: stylesheet + } + })); +} + +function DuotonePanel(_ref2) { + var _style$color; + + let { + attributes, + setAttributes + } = _ref2; + const style = attributes === null || attributes === void 0 ? void 0 : attributes.style; + const duotone = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone; + const duotonePalette = useSetting('color.duotone') || duotone_EMPTY_ARRAY; + const colorPalette = useSetting('color.palette') || duotone_EMPTY_ARRAY; + const disableCustomColors = !useSetting('color.custom'); + const disableCustomDuotone = !useSetting('color.customDuotone') || (colorPalette === null || colorPalette === void 0 ? void 0 : colorPalette.length) === 0 && disableCustomColors; + + if ((duotonePalette === null || duotonePalette === void 0 ? void 0 : duotonePalette.length) === 0 && disableCustomDuotone) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(block_controls, { + group: "block", + __experimentalShareWithChildBlocks: true + }, (0,external_wp_element_namespaceObject.createElement)(duotone_control, { + duotonePalette: duotonePalette, + colorPalette: colorPalette, + disableCustomDuotone: disableCustomDuotone, + disableCustomColors: disableCustomColors, + value: duotone, + onChange: newDuotone => { + const newStyle = { ...style, + color: { ...(style === null || style === void 0 ? void 0 : style.color), + duotone: newDuotone + } + }; + setAttributes({ + style: newStyle + }); + } + })); +} +/** + * Filters registered block settings, extending attributes to include + * the `duotone` attribute. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + + +function addDuotoneAttributes(settings) { + if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'color.__experimentalDuotone')) { + return settings; + } // Allow blocks to specify their own attribute definition with default + // values if needed. + + + if (!settings.attributes.style) { + Object.assign(settings.attributes, { + style: { + type: 'object' + } + }); + } + + return settings; +} +/** + * Override the default edit UI to include toolbar controls for duotone if the + * block supports duotone. + * + * @param {Function} BlockEdit Original component. + * + * @return {Function} Wrapped component. + */ + + +const withDuotoneControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { + const hasDuotoneSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(props.name, 'color.__experimentalDuotone'); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props), hasDuotoneSupport && (0,external_wp_element_namespaceObject.createElement)(DuotonePanel, props)); +}, 'withDuotoneControls'); +/** + * Function that scopes a selector with another one. This works a bit like + * SCSS nesting except the `&` operator isn't supported. + * + * @example + * ```js + * const scope = '.a, .b .c'; + * const selector = '> .x, .y'; + * const merged = scopeSelector( scope, selector ); + * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y' + * ``` + * + * @param {string} scope Selector to scope to. + * @param {string} selector Original selector. + * + * @return {string} Scoped selector. + */ + +function scopeSelector(scope, selector) { + const scopes = scope.split(','); + const selectors = selector.split(','); + const selectorsScoped = []; + scopes.forEach(outer => { + selectors.forEach(inner => { + selectorsScoped.push(`${outer.trim()} ${inner.trim()}`); + }); + }); + return selectorsScoped.join(', '); +} +/** + * Override the default block element to include duotone styles. + * + * @param {Function} BlockListBlock Original component. + * + * @return {Function} Wrapped component. + */ + + +const withDuotoneStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { + var _props$attributes, _props$attributes$sty, _props$attributes$sty2; + + const duotoneSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, 'color.__experimentalDuotone'); + const values = props === null || props === void 0 ? void 0 : (_props$attributes = props.attributes) === null || _props$attributes === void 0 ? void 0 : (_props$attributes$sty = _props$attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.color) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.duotone; + + if (!duotoneSupport || !values) { + return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props); + } + + const id = `wp-duotone-${(0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock)}`; // Extra .editor-styles-wrapper specificity is needed in the editor + // since we're not using inline styles to apply the filter. We need to + // override duotone applied by global styles and theme.json. + + const selectorsGroup = scopeSelector(`.editor-styles-wrapper .${id}`, duotoneSupport); + const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, id); + const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(DuotoneFilter, { + selector: selectorsGroup, + id: id, + values: getValuesFromColors(values) + }), element), (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, { + className: className + }))); +}, 'withDuotoneStyles'); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/duotone/add-attributes', addDuotoneAttributes); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/duotone/with-editor-controls', withDuotoneControls); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/duotone/with-styles', withDuotoneStyles); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/layout.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const layoutBlockSupportKey = '__experimentalLayout'; + +function LayoutPanel(_ref) { + let { + setAttributes, + attributes, + name: blockName + } = _ref; + const { + layout + } = attributes; + const defaultThemeLayout = useSetting('layout'); + const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = select(store); + return getSettings().supportsLayout; + }, []); + const layoutBlockSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, layoutBlockSupportKey, {}); + const { + allowSwitching, + allowEditing = true, + allowInheriting = true, + default: defaultBlockLayout + } = layoutBlockSupport; + + if (!allowEditing) { + return null; + } + + const usedLayout = layout || defaultBlockLayout || {}; + const { + inherit = false, + type = 'default' + } = usedLayout; + /** + * `themeSupportsLayout` is only relevant to the `default/flow` + * layout and it should not be taken into account when other + * `layout` types are used. + */ + + if (type === 'default' && !themeSupportsLayout) { + return null; + } + + const layoutType = getLayoutType(type); + + const onChangeType = newType => setAttributes({ + layout: { + type: newType + } + }); + + const onChangeLayout = newLayout => setAttributes({ + layout: newLayout + }); + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Layout') + }, allowInheriting && !!defaultThemeLayout && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Inherit default layout'), + checked: !!inherit, + onChange: () => setAttributes({ + layout: { + inherit: !inherit + } + }) + }), !inherit && allowSwitching && (0,external_wp_element_namespaceObject.createElement)(LayoutTypeSwitcher, { + type: type, + onChange: onChangeType + }), !inherit && layoutType && (0,external_wp_element_namespaceObject.createElement)(layoutType.inspectorControls, { + layout: usedLayout, + onChange: onChangeLayout, + layoutBlockSupport: layoutBlockSupport + }))), !inherit && layoutType && (0,external_wp_element_namespaceObject.createElement)(layoutType.toolBarControls, { + layout: usedLayout, + onChange: onChangeLayout, + layoutBlockSupport: layoutBlockSupport + })); +} + +function LayoutTypeSwitcher(_ref2) { + let { + type, + onChange + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, null, getLayoutTypes().map(_ref3 => { + let { + name, + label + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: name, + isPressed: type === name, + onClick: () => onChange(name) + }, label); + })); +} +/** + * Filters registered block settings, extending attributes to include `layout`. + * + * @param {Object} settings Original block settings. + * + * @return {Object} Filtered block settings. + */ + + +function layout_addAttribute(settings) { + if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['layout', 'type'])) { + return settings; + } + + if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, layoutBlockSupportKey)) { + settings.attributes = { ...settings.attributes, + layout: { + type: 'object' + } + }; + } + + return settings; +} +/** + * Override the default edit UI to include layout controls + * + * @param {Function} BlockEdit Original component. + * + * @return {Function} Wrapped component. + */ + +const withInspectorControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { + const { + name: blockName + } = props; + const supportLayout = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, layoutBlockSupportKey); + return [supportLayout && (0,external_wp_element_namespaceObject.createElement)(LayoutPanel, _extends({ + key: "layout" + }, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({ + key: "edit" + }, props))]; +}, 'withInspectorControls'); +/** + * Override the default block element to add the layout styles. + * + * @param {Function} BlockListBlock Original component. + * + * @return {Function} Wrapped component. + */ + +const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { + const { + name, + attributes + } = props; + const shouldRenderLayoutStyles = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, layoutBlockSupportKey); + const id = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock); + const defaultThemeLayout = useSetting('layout') || {}; + const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext); + const { + layout + } = attributes; + const { + default: defaultBlockLayout + } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {}; + const usedLayout = layout !== null && layout !== void 0 && layout.inherit ? defaultThemeLayout : layout || defaultBlockLayout || {}; + const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, { + [`wp-container-${id}`]: shouldRenderLayoutStyles + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, shouldRenderLayoutStyles && element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(LayoutStyle, { + selector: `.wp-container-${id}`, + layout: usedLayout, + style: attributes === null || attributes === void 0 ? void 0 : attributes.style + }), element), (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, { + className: className + }))); +}); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/layout/addAttribute', layout_addAttribute); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/layout/with-layout-styles', withLayoutStyles); +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/layout/with-inspector-controls', withInspectorControls); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-border-props.js +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + + // This utility is intended to assist where the serialization of the border +// block support is being skipped for a block but the border related CSS classes +// & styles still need to be generated so they can be applied to inner elements. + +const use_border_props_EMPTY_ARRAY = []; +/** + * Provides the CSS class names and inline styles for a block's border support + * attributes. + * + * @param {Object} attributes Block attributes. + * @param {string} attributes.borderColor Selected named border color. + * @param {Object} attributes.style Block's styles attribute. + * + * @return {Object} Border block support derived CSS classes & styles. + */ + +function getBorderClassesAndStyles(_ref) { + var _style$border; + + let { + borderColor, + style + } = _ref; + const borderStyles = (style === null || style === void 0 ? void 0 : style.border) || {}; + const borderClass = getColorClassName('border-color', borderColor); + const className = classnames_default()({ + [borderClass]: !!borderClass, + 'has-border-color': borderColor || (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.color) + }); + return { + className: className || undefined, + style: getInlineStyles({ + border: borderStyles + }) + }; +} +/** + * Derives the border related props for a block from its border block support + * attributes. + * + * Inline styles are forced for named colors to ensure these selections are + * reflected when themes do not load their color stylesheets in the editor. + * + * @param {Object} attributes Block attributes. + * + * @return {Object} ClassName & style props from border block support. + */ + +function useBorderProps(attributes) { + const colors = useSetting('color.palette') || use_border_props_EMPTY_ARRAY; + const borderProps = getBorderClassesAndStyles(attributes); // Force inline style to apply border color when themes do not load their + // color stylesheets in the editor. + + if (attributes.borderColor) { + const borderColorObject = getColorObjectByAttributeValues(colors, attributes.borderColor); + borderProps.style.borderColor = borderColorObject.color; + } + + return borderProps; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-color-props.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + // The code in this file has largely been lifted from the color block support +// hook. +// +// This utility is intended to assist where the serialization of the colors +// block support is being skipped for a block but the color related CSS classes +// & styles still need to be generated so they can be applied to inner elements. + +/** + * Provides the CSS class names and inline styles for a block's color support + * attributes. + * + * @param {Object} attributes Block attributes. + * + * @return {Object} Color block support derived CSS classes & styles. + */ + +function getColorClassesAndStyles(attributes) { + var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link; + + const { + backgroundColor, + textColor, + gradient, + style + } = attributes; // Collect color CSS classes. + + const backgroundClass = getColorClassName('background-color', backgroundColor); + const textClass = getColorClassName('color', textColor); + + const gradientClass = __experimentalGetGradientClass(gradient); + + const hasGradient = gradientClass || (style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.gradient); // Determine color CSS class name list. + + const className = classnames_default()(textClass, gradientClass, { + // Don't apply the background class if there's a gradient. + [backgroundClass]: !hasGradient && !!backgroundClass, + 'has-text-color': textColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.text), + 'has-background': backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.background) || gradient || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.gradient), + 'has-link-color': style === null || style === void 0 ? void 0 : (_style$elements = style.elements) === null || _style$elements === void 0 ? void 0 : (_style$elements$link = _style$elements.link) === null || _style$elements$link === void 0 ? void 0 : _style$elements$link.color + }); // Collect inline styles for colors. + + const colorStyles = (style === null || style === void 0 ? void 0 : style.color) || {}; + const styleProp = getInlineStyles({ + color: colorStyles + }); + return { + className: className || undefined, + style: styleProp + }; +} +const use_color_props_EMPTY_OBJECT = {}; +/** + * Determines the color related props for a block derived from its color block + * support attributes. + * + * Inline styles are forced for named colors to ensure these selections are + * reflected when themes do not load their color stylesheets in the editor. + * + * @param {Object} attributes Block attributes. + * + * @return {Object} ClassName & style props from colors block support. + */ + +function useColorProps(attributes) { + const { + backgroundColor, + textColor, + gradient + } = attributes; // Some color settings have a special handling for deprecated flags in `useSetting`, + // so we can't unwrap them by doing const { ... } = useSetting('color') + // until https://github.com/WordPress/gutenberg/issues/37094 is fixed. + + const userPalette = useSetting('color.palette.custom') || []; + const themePalette = useSetting('color.palette.theme') || []; + const defaultPalette = useSetting('color.palette.default') || []; + const gradientsPerOrigin = useSetting('color.gradients') || use_color_props_EMPTY_OBJECT; + const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); + const gradients = (0,external_wp_element_namespaceObject.useMemo)(() => [...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.custom) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.theme) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.default) || [])], [gradientsPerOrigin]); + const colorProps = getColorClassesAndStyles(attributes); // Force inline styles to apply colors when themes do not load their color + // stylesheets in the editor. + + if (backgroundColor) { + const backgroundColorObject = getColorObjectByAttributeValues(colors, backgroundColor); + colorProps.style.backgroundColor = backgroundColorObject.color; + } + + if (gradient) { + colorProps.style.background = getGradientValueBySlug(gradients, gradient); + } + + if (textColor) { + const textColorObject = getColorObjectByAttributeValues(colors, textColor); + colorProps.style.color = textColorObject.color; + } + + return colorProps; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-spacing-props.js +/** + * Internal dependencies + */ + // This utility is intended to assist where the serialization of the spacing +// block support is being skipped for a block but the spacing related CSS +// styles still need to be generated so they can be applied to inner elements. + +/** + * Provides the CSS class names and inline styles for a block's spacing support + * attributes. + * + * @param {Object} attributes Block attributes. + * + * @return {Object} Spacing block support derived CSS classes & styles. + */ + +function getSpacingClassesAndStyles(attributes) { + const { + style + } = attributes; // Collect inline styles for spacing. + + const spacingStyles = (style === null || style === void 0 ? void 0 : style.spacing) || {}; + const styleProp = getInlineStyles({ + spacing: spacingStyles + }); + return { + style: styleProp + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-cached-truthy.js +/** + * WordPress dependencies + */ + +/** + * Keeps an up-to-date copy of the passed value and returns it. If value becomes falsy, it will return the last truthy copy. + * + * @param {any} value + * @return {any} value + */ + +function useCachedTruthy(value) { + const [cachedValue, setCachedValue] = (0,external_wp_element_namespaceObject.useState)(value); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (value) { + setCachedValue(value); + } + }, [value]); + return cachedValue; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/index.js +/** + * Internal dependencies + */ + + + + + + + + + + + + + + + + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/with-colors.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +/** + * Higher order component factory for injecting the `colorsArray` argument as + * the colors prop in the `withCustomColors` HOC. + * + * @param {Array} colorsArray An array of color objects. + * + * @return {Function} The higher order component. + */ + +const withCustomColorPalette = colorsArray => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, { + colors: colorsArray +})), 'withCustomColorPalette'); +/** + * Higher order component factory for injecting the editor colors as the + * `colors` prop in the `withColors` HOC. + * + * @return {Function} The higher order component. + */ + + +const withEditorColorPalette = () => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => { + // Some color settings have a special handling for deprecated flags in `useSetting`, + // so we can't unwrap them by doing const { ... } = useSetting('color') + // until https://github.com/WordPress/gutenberg/issues/37094 is fixed. + const userPalette = useSetting('color.palette.custom'); + const themePalette = useSetting('color.palette.theme'); + const defaultPalette = useSetting('color.palette.default'); + const allColors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); + return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, { + colors: allColors + })); +}, 'withEditorColorPalette'); +/** + * Helper function used with `createHigherOrderComponent` to create + * higher order components for managing color logic. + * + * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor). + * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent. + * + * @return {WPComponent} The component that can be used as a HOC. + */ + + +function createColorHOC(colorTypes, withColorPalette) { + const colorMap = (0,external_lodash_namespaceObject.reduce)(colorTypes, (colorObject, colorType) => { + return { ...colorObject, + ...((0,external_lodash_namespaceObject.isString)(colorType) ? { + [colorType]: (0,external_lodash_namespaceObject.kebabCase)(colorType) + } : colorType) + }; + }, {}); + return (0,external_wp_compose_namespaceObject.compose)([withColorPalette, WrappedComponent => { + return class extends external_wp_element_namespaceObject.Component { + constructor(props) { + super(props); + this.setters = this.createSetters(); + this.colorUtils = { + getMostReadableColor: this.getMostReadableColor.bind(this) + }; + this.state = {}; + } + + getMostReadableColor(colorValue) { + const { + colors + } = this.props; + return getMostReadableColor(colors, colorValue); + } + + createSetters() { + return (0,external_lodash_namespaceObject.reduce)(colorMap, (settersAccumulator, colorContext, colorAttributeName) => { + const upperFirstColorAttributeName = (0,external_lodash_namespaceObject.upperFirst)(colorAttributeName); + const customColorAttributeName = `custom${upperFirstColorAttributeName}`; + settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName); + return settersAccumulator; + }, {}); + } + + createSetColor(colorAttributeName, customColorAttributeName) { + return colorValue => { + const colorObject = getColorObjectByColorValue(this.props.colors, colorValue); + this.props.setAttributes({ + [colorAttributeName]: colorObject && colorObject.slug ? colorObject.slug : undefined, + [customColorAttributeName]: colorObject && colorObject.slug ? undefined : colorValue + }); + }; + } + + static getDerivedStateFromProps(_ref, previousState) { + let { + attributes, + colors + } = _ref; + return (0,external_lodash_namespaceObject.reduce)(colorMap, (newState, colorContext, colorAttributeName) => { + const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${(0,external_lodash_namespaceObject.upperFirst)(colorAttributeName)}`]); + const previousColorObject = previousState[colorAttributeName]; + const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color; + /** + * The "and previousColorObject" condition checks that a previous color object was already computed. + * At the start previousColorObject and colorValue are both equal to undefined + * bus as previousColorObject does not exist we should compute the object. + */ + + if (previousColor === colorObject.color && previousColorObject) { + newState[colorAttributeName] = previousColorObject; + } else { + newState[colorAttributeName] = { ...colorObject, + class: getColorClassName(colorContext, colorObject.slug) + }; + } + + return newState; + }, {}); + } + + render() { + return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, this.props, { + colors: undefined + }, this.state, this.setters, { + colorUtils: this.colorUtils + })); + } + + }; + }]); +} +/** + * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic + * for class generation color value, retrieval and color attribute setting. + * + * Use this higher-order component to work with a custom set of colors. + * + * @example + * + * ```jsx + * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ]; + * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS ); + * // ... + * export default compose( + * withCustomColors( 'backgroundColor', 'borderColor' ), + * MyColorfulComponent, + * ); + * ``` + * + * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ). + * + * @return {Function} Higher-order component. + */ + + +function createCustomColorsHOC(colorsArray) { + return function () { + const withColorPalette = withCustomColorPalette(colorsArray); + + for (var _len = arguments.length, colorTypes = new Array(_len), _key = 0; _key < _len; _key++) { + colorTypes[_key] = arguments[_key]; + } + + return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(createColorHOC(colorTypes, withColorPalette), 'withCustomColors'); + }; +} +/** + * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting. + * + * For use with the default editor/theme color palette. + * + * @example + * + * ```jsx + * export default compose( + * withColors( 'backgroundColor', { textColor: 'color' } ), + * MyColorfulComponent, + * ); + * ``` + * + * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object, + * it should contain the color attribute name as key and the color context as value. + * If the argument is a string the value should be the color attribute name, + * the color context is computed by applying a kebab case transform to the value. + * Color context represents the context/place where the color is going to be used. + * The class name of the color is generated using 'has' followed by the color name + * and ending with the color context all in kebab case e.g: has-green-background-color. + * + * @return {Function} Higher-order component. + */ + +function withColors() { + const withColorPalette = withEditorColorPalette(); + + for (var _len2 = arguments.length, colorTypes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + colorTypes[_key2] = arguments[_key2]; + } + + return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(createColorHOC(colorTypes, withColorPalette), 'withColors'); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/index.js + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/gradients/index.js + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/with-font-sizes.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const DEFAULT_FONT_SIZES = []; +/** + * Higher-order component, which handles font size logic for class generation, + * font size value retrieval, and font size change handling. + * + * @param {...(Object|string)} fontSizeNames The arguments should all be strings. + * Each string contains the font size + * attribute name e.g: 'fontSize'. + * + * @return {Function} Higher-order component. + */ + +/* harmony default export */ var with_font_sizes = (function () { + for (var _len = arguments.length, fontSizeNames = new Array(_len), _key = 0; _key < _len; _key++) { + fontSizeNames[_key] = arguments[_key]; + } + + /* + * Computes an object whose key is the font size attribute name as passed in the array, + * and the value is the custom font size attribute name. + * Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized. + */ + const fontSizeAttributeNames = (0,external_lodash_namespaceObject.reduce)(fontSizeNames, (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => { + fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${(0,external_lodash_namespaceObject.upperFirst)(fontSizeAttributeName)}`; + return fontSizeAttributeNamesAccumulator; + }, {}); + return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => { + const fontSizes = useSetting('typography.fontSizes') || DEFAULT_FONT_SIZES; + return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, { + fontSizes: fontSizes + })); + }, 'withFontSizes'), WrappedComponent => { + return class extends external_wp_element_namespaceObject.Component { + constructor(props) { + super(props); + this.setters = this.createSetters(); + this.state = {}; + } + + createSetters() { + return (0,external_lodash_namespaceObject.reduce)(fontSizeAttributeNames, (settersAccumulator, customFontSizeAttributeName, fontSizeAttributeName) => { + const upperFirstFontSizeAttributeName = (0,external_lodash_namespaceObject.upperFirst)(fontSizeAttributeName); + settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName); + return settersAccumulator; + }, {}); + } + + createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) { + return fontSizeValue => { + const fontSizeObject = (0,external_lodash_namespaceObject.find)(this.props.fontSizes, { + size: Number(fontSizeValue) + }); + this.props.setAttributes({ + [fontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : undefined, + [customFontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? undefined : fontSizeValue + }); + }; + } + + static getDerivedStateFromProps(_ref, previousState) { + let { + attributes, + fontSizes + } = _ref; + + const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => { + if (previousState[fontSizeAttributeName]) { + // if new font size is name compare with the previous slug + if (attributes[fontSizeAttributeName]) { + return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug; + } // if font size is not named, update when the font size value changes. + + + return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName]; + } // in this case we need to build the font size object + + + return true; + }; + + if (!(0,external_lodash_namespaceObject.some)(fontSizeAttributeNames, didAttributesChange)) { + return null; + } + + const newState = (0,external_lodash_namespaceObject.reduce)((0,external_lodash_namespaceObject.pickBy)(fontSizeAttributeNames, didAttributesChange), (newStateAccumulator, customFontSizeAttributeName, fontSizeAttributeName) => { + const fontSizeAttributeValue = attributes[fontSizeAttributeName]; + const fontSizeObject = getFontSize(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]); + newStateAccumulator[fontSizeAttributeName] = { ...fontSizeObject, + class: getFontSizeClass(fontSizeAttributeValue) + }; + return newStateAccumulator; + }, {}); + return { ...previousState, + ...newState + }; + } + + render() { + return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, this.props, { + fontSizes: undefined + }, this.state, this.setters)); + } + + }; + }]), 'withFontSizes'); +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js + + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js + + +/** + * WordPress dependencies + */ + +const alignLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z" +})); +/* harmony default export */ var align_left = (alignLeft); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js + + +/** + * WordPress dependencies + */ + +const alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z" +})); +/* harmony default export */ var align_center = (alignCenter); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js + + +/** + * WordPress dependencies + */ + +const alignRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z" +})); +/* harmony default export */ var align_right = (alignRight); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/ui.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +const DEFAULT_ALIGNMENT_CONTROLS = [{ + icon: align_left, + title: (0,external_wp_i18n_namespaceObject.__)('Align text left'), + align: 'left' +}, { + icon: align_center, + title: (0,external_wp_i18n_namespaceObject.__)('Align text center'), + align: 'center' +}, { + icon: align_right, + title: (0,external_wp_i18n_namespaceObject.__)('Align text right'), + align: 'right' +}]; +const ui_POPOVER_PROPS = { + position: 'bottom right', + isAlternate: true +}; + +function AlignmentUI(_ref) { + let { + value, + onChange, + alignmentControls = DEFAULT_ALIGNMENT_CONTROLS, + label = (0,external_wp_i18n_namespaceObject.__)('Align'), + describedBy = (0,external_wp_i18n_namespaceObject.__)('Change text alignment'), + isCollapsed = true, + isToolbar + } = _ref; + + function applyOrUnset(align) { + return () => onChange(value === align ? undefined : align); + } + + const activeAlignment = (0,external_lodash_namespaceObject.find)(alignmentControls, control => control.align === value); + + function setIcon() { + if (activeAlignment) return activeAlignment.icon; + return (0,external_wp_i18n_namespaceObject.isRTL)() ? align_right : align_left; + } + + const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; + const extraProps = isToolbar ? { + isCollapsed + } : {}; + return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({ + icon: setIcon(), + label: label, + toggleProps: { + describedBy + }, + popoverProps: ui_POPOVER_PROPS, + controls: alignmentControls.map(control => { + const { + align + } = control; + const isActive = value === align; + return { ...control, + isActive, + role: isCollapsed ? 'menuitemradio' : undefined, + onClick: applyOrUnset(align) + }; + }) + }, extraProps)); +} + +/* harmony default export */ var alignment_control_ui = (AlignmentUI); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/index.js + + + +/** + * Internal dependencies + */ + +function AlignmentControl(props) { + return (0,external_wp_element_namespaceObject.createElement)(alignment_control_ui, _extends({}, props, { + isToolbar: false + })); +} +function AlignmentToolbar(props) { + return (0,external_wp_element_namespaceObject.createElement)(alignment_control_ui, _extends({}, props, { + isToolbar: true + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/autocompleters/block.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + +const block_SHOWN_BLOCK_TYPES = 9; +/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */ + +/** + * Creates a blocks repeater for replacing the current block with a selected block type. + * + * @return {WPCompleter} A blocks completer. + */ + +function createBlockCompleter() { + return { + name: 'blocks', + className: 'block-editor-autocompleters__block', + triggerPrefix: '/', + + useItems(filterValue) { + const { + rootClientId, + selectedBlockName + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSelectedBlockClientId, + getBlockName, + getBlockInsertionPoint + } = select(store); + const selectedBlockClientId = getSelectedBlockClientId(); + return { + selectedBlockName: selectedBlockClientId ? getBlockName(selectedBlockClientId) : null, + rootClientId: getBlockInsertionPoint().rootClientId + }; + }, []); + const [items, categories, collections] = use_block_types_state(rootClientId, external_lodash_namespaceObject.noop); + const filteredItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + const initialFilteredItems = !!filterValue.trim() ? searchBlockItems(items, categories, collections, filterValue) : (0,external_lodash_namespaceObject.orderBy)(items, ['frecency'], ['desc']); + return initialFilteredItems.filter(item => item.name !== selectedBlockName).slice(0, block_SHOWN_BLOCK_TYPES); + }, [filterValue, selectedBlockName, items, categories, collections]); + const options = (0,external_wp_element_namespaceObject.useMemo)(() => filteredItems.map(blockItem => { + const { + title, + icon, + isDisabled + } = blockItem; + return { + key: `block-${blockItem.id}`, + value: blockItem, + label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_icon, { + key: "icon", + icon: icon, + showColors: true + }), title), + isDisabled + }; + }), [filteredItems]); + return [options]; + }, + + allowContext(before, after) { + return !(/\S/.test(before) || /\S/.test(after)); + }, + + getOptionCompletion(inserterItem) { + const { + name, + initialAttributes, + innerBlocks + } = inserterItem; + return { + action: 'replace', + value: (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocks)) + }; + } + + }; +} +/** + * Creates a blocks repeater for replacing the current block with a selected block type. + * + * @return {WPCompleter} A blocks completer. + */ + + +/* harmony default export */ var autocompleters_block = (createBlockCompleter()); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/autocomplete/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +/** + * Shared reference to an empty array for cases where it is important to avoid + * returning a new array reference on every invocation. + * + * @type {Array} + */ + +const autocomplete_EMPTY_ARRAY = []; + +function useCompleters(_ref) { + let { + completers = autocomplete_EMPTY_ARRAY + } = _ref; + const { + name + } = useBlockEditContext(); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + let filteredCompleters = completers; + + if (name === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalSlashInserter', false)) { + filteredCompleters = filteredCompleters.concat([autocompleters_block]); + } + + if ((0,external_wp_hooks_namespaceObject.hasFilter)('editor.Autocomplete.completers')) { + // Provide copies so filters may directly modify them. + if (filteredCompleters === completers) { + filteredCompleters = filteredCompleters.map(external_lodash_namespaceObject.clone); + } + + filteredCompleters = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.Autocomplete.completers', filteredCompleters, name); + } + + return filteredCompleters; + }, [completers, name]); +} + +function useBlockEditorAutocompleteProps(props) { + return (0,external_wp_components_namespaceObject.__unstableUseAutocompleteProps)({ ...props, + completers: useCompleters(props) + }); +} +/** + * Wrap the default Autocomplete component with one that supports a filter hook + * for customizing its list of autocompleters. + * + * @type {import('react').FC} + */ + +function BlockEditorAutocomplete(props) { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Autocomplete, _extends({}, props, { + completers: useCompleters(props) + })); +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/autocomplete/README.md + */ + + +/* harmony default export */ var autocomplete = (BlockEditorAutocomplete); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/fullscreen.js + + +/** + * WordPress dependencies + */ + +const fullscreen = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z" +})); +/* harmony default export */ var library_fullscreen = (fullscreen); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-full-height-alignment-control/index.js + + +/** + * WordPress dependencies + */ + + + + +function BlockFullHeightAlignmentControl(_ref) { + let { + isActive, + label = (0,external_wp_i18n_namespaceObject.__)('Toggle full height'), + onToggle, + isDisabled + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + isActive: isActive, + icon: library_fullscreen, + label: label, + onClick: () => onToggle(!isActive), + disabled: isDisabled + }); +} + +/* harmony default export */ var block_full_height_alignment_control = (BlockFullHeightAlignmentControl); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-matrix-control/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +function BlockAlignmentMatrixControl(props) { + const { + label = (0,external_wp_i18n_namespaceObject.__)('Change matrix alignment'), + onChange = external_lodash_namespaceObject.noop, + value = 'center', + isDisabled + } = props; + const icon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalAlignmentMatrixControl.Icon, { + value: value + }); + const className = 'block-editor-block-alignment-matrix-control'; + const popoverClassName = `${className}__popover`; + const isAlternate = true; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + position: "bottom right", + className: className, + popoverProps: { + className: popoverClassName, + isAlternate + }, + renderToggle: _ref => { + let { + onToggle, + isOpen + } = _ref; + + const openOnArrowDown = event => { + if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { + event.preventDefault(); + onToggle(); + } + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + onClick: onToggle, + "aria-haspopup": "true", + "aria-expanded": isOpen, + onKeyDown: openOnArrowDown, + label: label, + icon: icon, + showTooltip: true, + disabled: isDisabled + }); + }, + renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalAlignmentMatrixControl, { + hasFocusBorder: false, + onChange: onChange, + value: value + }) + }); +} + +/* harmony default export */ var block_alignment_matrix_control = (BlockAlignmentMatrixControl); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js + + +/** + * WordPress dependencies + */ + +const chevronRightSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var chevron_right_small = (chevronRightSmall); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-breadcrumb/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +/** + * Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb. + * + * @param {Object} props Component props. + * @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail. + * @return {WPElement} Block Breadcrumb. + */ + +function BlockBreadcrumb(_ref) { + let { + rootLabelText + } = _ref; + const { + selectBlock, + clearSelectedBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + clientId, + parents, + hasSelection + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSelectionStart, + getSelectedBlockClientId, + getBlockParents + } = select(store); + const selectedBlockClientId = getSelectedBlockClientId(); + return { + parents: getBlockParents(selectedBlockClientId), + clientId: selectedBlockClientId, + hasSelection: !!getSelectionStart().clientId + }; + }, []); + + const rootLabel = rootLabelText || (0,external_wp_i18n_namespaceObject.__)('Document'); + /* + * Disable reason: The `list` ARIA role is redundant but + * Safari+VoiceOver won't announce the list otherwise. + */ + + /* eslint-disable jsx-a11y/no-redundant-roles */ + + + return (0,external_wp_element_namespaceObject.createElement)("ul", { + className: "block-editor-block-breadcrumb", + role: "list", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block breadcrumb') + }, (0,external_wp_element_namespaceObject.createElement)("li", { + className: !hasSelection ? 'block-editor-block-breadcrumb__current' : undefined, + "aria-current": !hasSelection ? 'true' : undefined + }, hasSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-block-breadcrumb__button", + variant: "tertiary", + onClick: clearSelectedBlock + }, rootLabel), !hasSelection && rootLabel, !!clientId && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: chevron_right_small, + className: "block-editor-block-breadcrumb__separator" + })), parents.map(parentClientId => (0,external_wp_element_namespaceObject.createElement)("li", { + key: parentClientId + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-block-breadcrumb__button", + variant: "tertiary", + onClick: () => selectBlock(parentClientId) + }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, { + clientId: parentClientId + })), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: chevron_right_small, + className: "block-editor-block-breadcrumb__separator" + }))), !!clientId && (0,external_wp_element_namespaceObject.createElement)("li", { + className: "block-editor-block-breadcrumb__current", + "aria-current": "true" + }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, { + clientId: clientId + }))) + /* eslint-enable jsx-a11y/no-redundant-roles */ + ; +} + +/* harmony default export */ var block_breadcrumb = (BlockBreadcrumb); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-content-overlay/index.js @@ -50282,229 +35623,10769 @@ function useFocusFirstElement(clientId) { /** - * Pass the returned ref callback to an element that should clear block - * selection. Selection will only be cleared if the element is clicked directly, - * not if a child element is clicked. - * - * @return {import('react').RefCallback} Ref callback. + * External dependencies */ -function useBlockSelectionClearer() { + +function BlockContentOverlay(_ref) { + let { + clientId, + tagName: TagName = 'div', + wrapperProps, + className + } = _ref; + const baseClassName = 'block-editor-block-content-overlay'; + const [isOverlayActive, setIsOverlayActive] = (0,external_wp_element_namespaceObject.useState)(true); + const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); const { - hasSelectedBlock, - hasMultiSelection - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - const { - clearSelectedBlock - } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]); - return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["useRefEffect"])(node => { - function onMouseDown(event) { - if (!hasSelectedBlock() && !hasMultiSelection()) { - return; - } // Only handle clicks on the element, not the children. - - - if (event.target !== node) { - return; - } - - clearSelectedBlock(); - } - - node.addEventListener('mousedown', onMouseDown); - return () => { - node.removeEventListener('mousedown', onMouseDown); + isParentSelected, + hasChildSelected, + isDraggingBlocks, + isParentHighlighted + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isBlockSelected, + hasSelectedInnerBlock, + isDraggingBlocks: _isDraggingBlocks, + isBlockHighlighted + } = select(store); + return { + isParentSelected: isBlockSelected(clientId), + hasChildSelected: hasSelectedInnerBlock(clientId, true), + isDraggingBlocks: _isDraggingBlocks(), + isParentHighlighted: isBlockHighlighted(clientId) }; - }, [hasSelectedBlock, hasMultiSelection, clearSelectedBlock]); -} -function BlockSelectionClearer(props) { - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ - ref: useBlockSelectionClearer() - }, props)); + }, [clientId]); + const classes = classnames_default()(baseClassName, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className, className, { + 'overlay-active': isOverlayActive, + 'parent-highlighted': isParentHighlighted, + 'is-dragging-blocks': isDraggingBlocks + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // Reenable when blocks are not in use. + if (!isParentSelected && !hasChildSelected && !isOverlayActive) { + setIsOverlayActive(true); + } // Disable if parent selected by another means (such as list view). + // We check hover to ensure the overlay click interaction is not taking place. + // Trying to click the overlay will select the parent block via its 'focusin' + // listener on the wrapper, so if the block is selected while hovered we will + // let the mouseup disable the overlay instead. + + + if (isParentSelected && !isHovered && isOverlayActive) { + setIsOverlayActive(false); + } // Ensure overlay is disabled if a child block is selected. + + + if (hasChildSelected && isOverlayActive) { + setIsOverlayActive(false); + } + }, [isParentSelected, hasChildSelected, isOverlayActive, isHovered]); // Disabled because the overlay div doesn't actually have a role or functionality + // as far as the a11y is concerned. We're just catching the first click so that + // the block can be selected without interacting with its contents. + + /* eslint-disable jsx-a11y/no-static-element-interactions */ + + return (0,external_wp_element_namespaceObject.createElement)(TagName, _extends({}, wrapperProps, { + className: classes, + onMouseEnter: () => setIsHovered(true), + onMouseLeave: () => setIsHovered(false), + onMouseUp: isOverlayActive ? () => setIsOverlayActive(false) : undefined + }), wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.children); } +/* eslint-enable jsx-a11y/no-static-element-interactions */ - -/***/ }), - -/***/ "ziDm": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-style-selector/index.js /** * WordPress dependencies */ -const alignRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { + + + +const ColorSelectorSVGIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + xmlns: "https://www.w3.org/2000/svg", + viewBox: "0 0 20 20" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z" +})); +/** + * Color Selector Icon component. + * + * @param {Object} props Component properties. + * @param {Object} props.style Style object. + * @param {string} props.className Class name for component. + * + * @return {*} React Icon component. + */ + + +const ColorSelectorIcon = _ref => { + let { + style, + className + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-library-colors-selector__icon-container" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: `${className} block-library-colors-selector__state-selection`, + style: style + }, (0,external_wp_element_namespaceObject.createElement)(ColorSelectorSVGIcon, null))); +}; +/** + * Renders the Colors Selector Toolbar with the icon button. + * + * @param {Object} props Component properties. + * @param {Object} props.TextColor Text color component that wraps icon. + * @param {Object} props.BackgroundColor Background color component that wraps icon. + * + * @return {*} React toggle button component. + */ + + +const renderToggleComponent = _ref2 => { + let { + TextColor, + BackgroundColor + } = _ref2; + return _ref3 => { + let { + onToggle, + isOpen + } = _ref3; + + const openOnArrowDown = event => { + if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { + event.preventDefault(); + onToggle(); + } + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + className: "components-toolbar__control block-library-colors-selector__toggle", + label: (0,external_wp_i18n_namespaceObject.__)('Open Colors Selector'), + onClick: onToggle, + onKeyDown: openOnArrowDown, + icon: (0,external_wp_element_namespaceObject.createElement)(BackgroundColor, null, (0,external_wp_element_namespaceObject.createElement)(TextColor, null, (0,external_wp_element_namespaceObject.createElement)(ColorSelectorIcon, null))) + })); + }; +}; + +const BlockColorsStyleSelector = _ref4 => { + let { + children, + ...other + } = _ref4; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + position: "bottom right", + className: "block-library-colors-selector", + contentClassName: "block-library-colors-selector__popover", + renderToggle: renderToggleComponent(other), + renderContent: () => children + }); +}; + +/* harmony default export */ var color_style_selector = (BlockColorsStyleSelector); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js + + +/** + * WordPress dependencies + */ + +const listView = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z" +})); +/* harmony default export */ var list_view = (listView); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/leaf.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +const AnimatedTreeGridRow = animated(external_wp_components_namespaceObject.__experimentalTreeGridRow); +function ListViewLeaf(_ref) { + let { + isSelected, + position, + level, + rowCount, + children, + className, + path, + ...props + } = _ref; + const ref = use_moving_animation({ + isSelected, + adjustScrolling: false, + enableAnimation: true, + triggerAnimationOnChange: path + }); + return (0,external_wp_element_namespaceObject.createElement)(AnimatedTreeGridRow, _extends({ + ref: ref, + className: classnames_default()('block-editor-list-view-leaf', className), + level: level, + positionInSet: position, + setSize: rowCount + }, props), children); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/utils.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +const getBlockPositionDescription = (position, siblingCount, level) => (0,external_wp_i18n_namespaceObject.sprintf)( +/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */ +(0,external_wp_i18n_namespaceObject.__)('Block %1$d of %2$d, Level %3$d'), position, siblingCount, level); +/** + * Returns true if the client ID occurs within the block selection or multi-selection, + * or false otherwise. + * + * @param {string} clientId Block client ID. + * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs. + * + * @return {boolean} Whether the block is in multi-selection set. + */ + +const isClientIdSelected = (clientId, selectedBlockClientIds) => (0,external_lodash_namespaceObject.isArray)(selectedBlockClientIds) && selectedBlockClientIds.length ? selectedBlockClientIds.indexOf(clientId) !== -1 : selectedBlockClientIds === clientId; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/expander.js + + +/** + * WordPress dependencies + */ + +function ListViewExpander(_ref) { + let { + onClick + } = _ref; + return (// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js + // + // The expander component is implemented as a pseudo element in the w3 example + // https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html + // + // We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree. + // For the current tree grid implementation, please do not try to make this a button. + // + // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions + (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-list-view__expander", + onClick: event => onClick(event, { + forceToggle: true + }), + "aria-hidden": "true" + }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: chevron_right_small + })) + ); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-select-button.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + + +function ListViewBlockSelectButton(_ref, ref) { + let { + className, + block: { + clientId + }, + isSelected, + onClick, + onToggleExpanded, + position, + siblingBlockCount, + level, + tabIndex, + onFocus, + onDragStart, + onDragEnd, + draggable + } = _ref; + const blockInformation = useBlockDisplayInformation(clientId); + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlockSelectButton); + const descriptionId = `list-view-block-select-button__${instanceId}`; + const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: classnames_default()('block-editor-list-view-block-select-button', className), + onClick: onClick, + "aria-describedby": descriptionId, + ref: ref, + tabIndex: tabIndex, + onFocus: onFocus, + onDragStart: onDragStart, + onDragEnd: onDragEnd, + draggable: draggable + }, (0,external_wp_element_namespaceObject.createElement)(ListViewExpander, { + onClick: onToggleExpanded + }), (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon, + showColors: true + }), (0,external_wp_element_namespaceObject.createElement)(BlockTitle, { + clientId: clientId + }), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-list-view-block-select-button__anchor" + }, blockInformation.anchor), isSelected && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('(selected block)'))), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-list-view-block-select-button__description", + id: descriptionId + }, blockPositionDescription)); +} + +/* harmony default export */ var block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-contents.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => { + let { + onClick, + onToggleExpanded, + block, + isSelected, + position, + siblingBlockCount, + level, + ...props + } = _ref; + const { + clientId + } = block; + const { + blockMovingClientId, + selectedBlockInBlockEditor + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockRootClientId, + hasBlockMovingClientId, + getSelectedBlockClientId + } = select(store); + return { + rootClientId: getBlockRootClientId(clientId) || '', + blockMovingClientId: hasBlockMovingClientId(), + selectedBlockInBlockEditor: getSelectedBlockClientId() + }; + }, [clientId]); + const isBlockMoveTarget = blockMovingClientId && selectedBlockInBlockEditor === clientId; + const className = classnames_default()('block-editor-list-view-block-contents', { + 'is-dropping-before': isBlockMoveTarget + }); + return (0,external_wp_element_namespaceObject.createElement)(block_draggable, { + clientIds: [block.clientId] + }, _ref2 => { + let { + draggable, + onDragStart, + onDragEnd + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(block_select_button, _extends({ + ref: ref, + className: className, + block: block, + onClick: onClick, + onToggleExpanded: onToggleExpanded, + isSelected: isSelected, + position: position, + siblingBlockCount: siblingBlockCount, + level: level, + draggable: draggable, + onDragStart: onDragStart, + onDragEnd: onDragEnd + }, props)); + }); +}); +/* harmony default export */ var block_contents = (ListViewBlockContents); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/context.js +/** + * WordPress dependencies + */ + +const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({ + __experimentalFeatures: false, + __experimentalPersistentListViewFeatures: false +}); +const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + + + +function ListViewBlock(_ref) { + let { + block, + isDragged, + isSelected, + isBranchSelected, + selectBlock, + position, + level, + rowCount, + siblingBlockCount, + showBlockMovers, + path, + isExpanded + } = _ref; + const cellRef = (0,external_wp_element_namespaceObject.useRef)(null); + const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); + const { + clientId + } = block; + const { + toggleBlockHighlight + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + __experimentalFeatures: withExperimentalFeatures, + __experimentalPersistentListViewFeatures: withExperimentalPersistentListViewFeatures, + __experimentalHideContainerBlockActions: hideContainerBlockActions, + isTreeGridMounted, + expand, + collapse + } = useListViewContext(); + const hasSiblings = siblingBlockCount > 0; + const hasRenderedMovers = showBlockMovers && hasSiblings; + const moverCellClassName = classnames_default()('block-editor-list-view-block__mover-cell', { + 'is-visible': isHovered || isSelected + }); + const listViewBlockSettingsClassName = classnames_default()('block-editor-list-view-block__menu-cell', { + 'is-visible': isHovered || isSelected + }); // If ListView has experimental features related to the Persistent List View, + // only focus the selected list item on mount; otherwise the list would always + // try to steal the focus from the editor canvas. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (withExperimentalPersistentListViewFeatures && !isTreeGridMounted && isSelected) { + cellRef.current.focus(); + } + }, []); + const highlightBlock = withExperimentalPersistentListViewFeatures ? toggleBlockHighlight : () => {}; + const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => { + setIsHovered(true); + highlightBlock(clientId, true); + }, [clientId, setIsHovered, highlightBlock]); + const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => { + setIsHovered(false); + highlightBlock(clientId, false); + }, [clientId, setIsHovered, highlightBlock]); + const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(event => { + event.stopPropagation(); + selectBlock(clientId); + }, [clientId, selectBlock]); + const toggleExpanded = (0,external_wp_element_namespaceObject.useCallback)(event => { + event.stopPropagation(); + + if (isExpanded === true) { + collapse(clientId); + } else if (isExpanded === false) { + expand(clientId); + } + }, [clientId, expand, collapse, isExpanded]); + const showBlockActions = withExperimentalFeatures && ( //hide actions for blocks like core/widget-areas + !hideContainerBlockActions || hideContainerBlockActions && level > 1); + const hideBlockActions = withExperimentalFeatures && !showBlockActions; + let colSpan; + + if (hasRenderedMovers) { + colSpan = 2; + } else if (hideBlockActions) { + colSpan = 3; + } + + const classes = classnames_default()({ + 'is-selected': isSelected, + 'is-branch-selected': withExperimentalPersistentListViewFeatures && isBranchSelected, + 'is-dragging': isDragged, + 'has-single-cell': hideBlockActions + }); + return (0,external_wp_element_namespaceObject.createElement)(ListViewLeaf, { + className: classes, + onMouseEnter: onMouseEnter, + onMouseLeave: onMouseLeave, + onFocus: onMouseEnter, + onBlur: onMouseLeave, + level: level, + position: position, + rowCount: rowCount, + path: path, + id: `list-view-block-${clientId}`, + "data-block": clientId, + isExpanded: isExpanded + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { + className: "block-editor-list-view-block__contents-cell", + colSpan: colSpan, + ref: cellRef + }, _ref2 => { + let { + ref, + tabIndex, + onFocus + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-list-view-block__contents-container" + }, (0,external_wp_element_namespaceObject.createElement)(block_contents, { + block: block, + onClick: selectEditorBlock, + onToggleExpanded: toggleExpanded, + isSelected: isSelected, + position: position, + siblingBlockCount: siblingBlockCount, + level: level, + ref: ref, + tabIndex: tabIndex, + onFocus: onFocus + })); + }), hasRenderedMovers && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { + className: moverCellClassName, + withoutGridItem: true + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridItem, null, _ref3 => { + let { + ref, + tabIndex, + onFocus + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(BlockMoverUpButton, { + orientation: "vertical", + clientIds: [clientId], + ref: ref, + tabIndex: tabIndex, + onFocus: onFocus + }); + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridItem, null, _ref4 => { + let { + ref, + tabIndex, + onFocus + } = _ref4; + return (0,external_wp_element_namespaceObject.createElement)(BlockMoverDownButton, { + orientation: "vertical", + clientIds: [clientId], + ref: ref, + tabIndex: tabIndex, + onFocus: onFocus + }); + }))), showBlockActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { + className: listViewBlockSettingsClassName + }, _ref5 => { + let { + ref, + tabIndex, + onFocus + } = _ref5; + return (0,external_wp_element_namespaceObject.createElement)(block_settings_dropdown, { + clientIds: [clientId], + icon: more_vertical, + toggleProps: { + ref, + className: 'block-editor-list-view-block__menu', + tabIndex, + onFocus + }, + disableOpenOnArrowDown: true, + __experimentalSelectBlock: selectEditorBlock + }); + })); +} + +/* harmony default export */ var list_view_block = ((0,external_wp_element_namespaceObject.memo)(ListViewBlock)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/branch.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +/** + * Given a block, returns the total number of blocks in that subtree. This is used to help determine + * the list position of a block. + * + * When a block is collapsed, we do not count their children as part of that total. In the current drag + * implementation dragged blocks and their children are not counted. + * + * @param {Object} block block tree + * @param {Object} expandedState state that notes which branches are collapsed + * @param {Array} draggedClientIds a list of dragged client ids + * @return {number} block count + */ + +function countBlocks(block, expandedState, draggedClientIds) { + var _expandedState$block$; + + const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId); + + if (isDragged) { + return 0; + } + + const isExpanded = (_expandedState$block$ = expandedState[block.clientId]) !== null && _expandedState$block$ !== void 0 ? _expandedState$block$ : true; + + if (isExpanded) { + return 1 + block.innerBlocks.reduce(countReducer(expandedState, draggedClientIds), 0); + } + + return 1; +} + +const countReducer = (expandedState, draggedClientIds) => (count, block) => { + var _expandedState$block$2; + + const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId); + + if (isDragged) { + return count; + } + + const isExpanded = (_expandedState$block$2 = expandedState[block.clientId]) !== null && _expandedState$block$2 !== void 0 ? _expandedState$block$2 : true; + + if (isExpanded && block.innerBlocks.length > 0) { + return count + countBlocks(block, expandedState, draggedClientIds); + } + + return count + 1; +}; + +function ListViewBranch(props) { + const { + blocks, + selectBlock, + showBlockMovers, + showNestedBlocks, + selectedClientIds, + level = 1, + path = '', + isBranchSelected = false, + listPosition = 0, + fixedListWindow + } = props; + const { + expandedState, + draggedClientIds, + __experimentalPersistentListViewFeatures + } = useListViewContext(); + const filteredBlocks = (0,external_lodash_namespaceObject.compact)(blocks); + const blockCount = filteredBlocks.length; + let nextPosition = listPosition; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, filteredBlocks.map((block, index) => { + var _expandedState$client; + + const { + clientId, + innerBlocks + } = block; + + if (index > 0) { + nextPosition += countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds); + } + + const usesWindowing = __experimentalPersistentListViewFeatures; + const { + itemInView + } = fixedListWindow; + const blockInView = !usesWindowing || itemInView(nextPosition); + const position = index + 1; + const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`; + const hasNestedBlocks = showNestedBlocks && !!innerBlocks && !!innerBlocks.length; + const isExpanded = hasNestedBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : true : undefined; + const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId)); + const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous, + // but asynchronous for any other block. + + const isSelected = isClientIdSelected(clientId, selectedClientIds); + const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, { + key: clientId, + value: !isSelected + }, showBlock && (0,external_wp_element_namespaceObject.createElement)(list_view_block, { + block: block, + selectBlock: selectBlock, + isSelected: isSelected, + isBranchSelected: isSelectedBranch, + isDragged: isDragged, + level: level, + position: position, + rowCount: blockCount, + siblingBlockCount: blockCount, + showBlockMovers: showBlockMovers, + path: updatedPath, + isExpanded: isExpanded, + listPosition: nextPosition + }), !showBlock && (0,external_wp_element_namespaceObject.createElement)("tr", null, (0,external_wp_element_namespaceObject.createElement)("td", { + className: "block-editor-list-view-placeholder" + })), hasNestedBlocks && isExpanded && !isDragged && (0,external_wp_element_namespaceObject.createElement)(ListViewBranch, { + blocks: innerBlocks, + selectBlock: selectBlock, + showBlockMovers: showBlockMovers, + showNestedBlocks: showNestedBlocks, + level: level + 1, + path: updatedPath, + listPosition: nextPosition + 1, + fixedListWindow: fixedListWindow, + isBranchSelected: isSelectedBranch, + selectedClientIds: selectedClientIds + })); + })); +} + +ListViewBranch.defaultProps = { + selectBlock: () => {} +}; +/* harmony default export */ var branch = ((0,external_wp_element_namespaceObject.memo)(ListViewBranch)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/drop-indicator.js + + +/** + * WordPress dependencies + */ + + +function ListViewDropIndicator(_ref) { + let { + listViewRef, + blockDropTarget + } = _ref; + const { + rootClientId, + clientId, + dropPosition + } = blockDropTarget || {}; + const [rootBlockElement, blockElement] = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!listViewRef.current) { + return []; + } // The rootClientId will be defined whenever dropping into inner + // block lists, but is undefined when dropping at the root level. + + + const _rootBlockElement = rootClientId ? listViewRef.current.querySelector(`[data-block="${rootClientId}"]`) : undefined; // The clientId represents the sibling block, the dragged block will + // usually be inserted adjacent to it. It will be undefined when + // dropping a block into an empty block list. + + + const _blockElement = clientId ? listViewRef.current.querySelector(`[data-block="${clientId}"]`) : undefined; + + return [_rootBlockElement, _blockElement]; + }, [rootClientId, clientId]); // The targetElement is the element that the drop indicator will appear + // before or after. When dropping into an empty block list, blockElement + // is undefined, so the indicator will appear after the rootBlockElement. + + const targetElement = blockElement || rootBlockElement; + const getDropIndicatorIndent = (0,external_wp_element_namespaceObject.useCallback)(() => { + if (!rootBlockElement) { + return 0; + } // Calculate the indent using the block icon of the root block. + // Using a classname selector here might be flaky and could be + // improved. + + + const targetElementRect = targetElement.getBoundingClientRect(); + const rootBlockIconElement = rootBlockElement.querySelector('.block-editor-block-icon'); + const rootBlockIconRect = rootBlockIconElement.getBoundingClientRect(); + return rootBlockIconRect.right - targetElementRect.left; + }, [rootBlockElement, targetElement]); + const style = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!targetElement) { + return {}; + } + + const indent = getDropIndicatorIndent(); + return { + width: targetElement.offsetWidth - indent + }; + }, [getDropIndicatorIndent, targetElement]); + const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => { + if (!targetElement) { + return {}; + } + + const ownerDocument = targetElement.ownerDocument; + const rect = targetElement.getBoundingClientRect(); + const indent = getDropIndicatorIndent(); + const anchorRect = { + left: rect.left + indent, + right: rect.right, + width: 0, + height: rect.height, + ownerDocument + }; + + if (dropPosition === 'top') { + return { ...anchorRect, + top: rect.top, + bottom: rect.top + }; + } + + if (dropPosition === 'bottom' || dropPosition === 'inside') { + return { ...anchorRect, + top: rect.bottom, + bottom: rect.bottom + }; + } + + return {}; + }, [targetElement, dropPosition, getDropIndicatorIndent]); + + if (!targetElement) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { + noArrow: true, + animate: false, + getAnchorRect: getAnchorRect, + focusOnMount: false, + className: "block-editor-list-view-drop-indicator" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + style: style, + className: "block-editor-list-view-drop-indicator__line" + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-client-ids.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +function useListViewClientIds(blocks) { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getDraggedBlockClientIds, + getSelectedBlockClientIds, + __unstableGetClientIdsTree + } = select(store); + return { + selectedClientIds: getSelectedBlockClientIds(), + draggedClientIds: getDraggedBlockClientIds(), + clientIdsTree: blocks ? blocks : __unstableGetClientIdsTree() + }; + }, [blocks]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-drop-zone.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +/** @typedef {import('../../utils/math').WPPoint} WPPoint */ + +/** + * The type of a drag event. + * + * @typedef {'default'|'file'|'html'} WPDragEventType + */ + +/** + * An array representing data for blocks in the DOM used by drag and drop. + * + * @typedef {Object} WPListViewDropZoneBlocks + * @property {string} clientId The client id for the block. + * @property {string} rootClientId The root client id for the block. + * @property {number} blockIndex The block's index. + * @property {Element} element The DOM element representing the block. + * @property {number} innerBlockCount The number of inner blocks the block has. + * @property {boolean} isDraggedBlock Whether the block is currently being dragged. + * @property {boolean} canInsertDraggedBlocksAsSibling Whether the dragged block can be a sibling of this block. + * @property {boolean} canInsertDraggedBlocksAsChild Whether the dragged block can be a child of this block. + */ + +/** + * An object containing details of a drop target. + * + * @typedef {Object} WPListViewDropZoneTarget + * @property {string} blockIndex The insertion index. + * @property {string} rootClientId The root client id for the block. + * @property {string|undefined} clientId The client id for the block. + * @property {'top'|'bottom'|'inside'} dropPosition The position relative to the block that the user is dropping to. + * 'inside' refers to nesting as an inner block. + */ + +/** + * Is the point contained by the rectangle. + * + * @param {WPPoint} point The point. + * @param {DOMRect} rect The rectangle. + * + * @return {boolean} True if the point is contained by the rectangle, false otherwise. + */ + +function isPointContainedByRect(point, rect) { + return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y; +} +/** + * Determines whether the user positioning the dragged block to nest as an + * inner block. + * + * Presently this is determined by whether the cursor is on the right hand side + * of the block. + * + * @param {WPPoint} point The point representing the cursor position when dragging. + * @param {DOMRect} rect The rectangle. + */ + + +function isNestingGesture(point, rect) { + const blockCenterX = rect.left + rect.width / 2; + return point.x > blockCenterX; +} // Block navigation is always a vertical list, so only allow dropping +// to the above or below a block. + + +const ALLOWED_DROP_EDGES = ['top', 'bottom']; +/** + * Given blocks data and the cursor position, compute the drop target. + * + * @param {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. + * @param {WPPoint} position The point representing the cursor position when dragging. + * + * @return {WPListViewDropZoneTarget} An object containing data about the drop target. + */ + +function getListViewDropTarget(blocksData, position) { + let candidateEdge; + let candidateBlockData; + let candidateDistance; + let candidateRect; + + for (const blockData of blocksData) { + if (blockData.isDraggedBlock) { + continue; + } + + const rect = blockData.element.getBoundingClientRect(); + const [distance, edge] = getDistanceToNearestEdge(position, rect, ALLOWED_DROP_EDGES); + const isCursorWithinBlock = isPointContainedByRect(position, rect); + + if (candidateDistance === undefined || distance < candidateDistance || isCursorWithinBlock) { + candidateDistance = distance; + const index = blocksData.indexOf(blockData); + const previousBlockData = blocksData[index - 1]; // If dragging near the top of a block and the preceding block + // is at the same level, use the preceding block as the candidate + // instead, as later it makes determining a nesting drop easier. + + if (edge === 'top' && previousBlockData && previousBlockData.rootClientId === blockData.rootClientId && !previousBlockData.isDraggedBlock) { + candidateBlockData = previousBlockData; + candidateEdge = 'bottom'; + candidateRect = previousBlockData.element.getBoundingClientRect(); + } else { + candidateBlockData = blockData; + candidateEdge = edge; + candidateRect = rect; + } // If the mouse position is within the block, break early + // as the user would intend to drop either before or after + // this block. + // + // This solves an issue where some rows in the list view + // tree overlap slightly due to sub-pixel rendering. + + + if (isCursorWithinBlock) { + break; + } + } + } + + if (!candidateBlockData) { + return; + } + + const isDraggingBelow = candidateEdge === 'bottom'; // If the user is dragging towards the bottom of the block check whether + // they might be trying to nest the block as a child. + // If the block already has inner blocks, this should always be treated + // as nesting since the next block in the tree will be the first child. + + if (isDraggingBelow && candidateBlockData.canInsertDraggedBlocksAsChild && (candidateBlockData.innerBlockCount > 0 || isNestingGesture(position, candidateRect))) { + return { + rootClientId: candidateBlockData.clientId, + blockIndex: 0, + dropPosition: 'inside' + }; + } // If dropping as a sibling, but block cannot be inserted in + // this context, return early. + + + if (!candidateBlockData.canInsertDraggedBlocksAsSibling) { + return; + } + + const offset = isDraggingBelow ? 1 : 0; + return { + rootClientId: candidateBlockData.rootClientId, + clientId: candidateBlockData.clientId, + blockIndex: candidateBlockData.blockIndex + offset, + dropPosition: candidateEdge + }; +} +/** + * A react hook for implementing a drop zone in list view. + * + * @return {WPListViewDropZoneTarget} The drop target. + */ + + +function useListViewDropZone() { + const { + getBlockRootClientId, + getBlockIndex, + getBlockCount, + getDraggedBlockClientIds, + canInsertBlocks + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const [target, setTarget] = (0,external_wp_element_namespaceObject.useState)(); + const { + rootClientId: targetRootClientId, + blockIndex: targetBlockIndex + } = target || {}; + const onBlockDrop = useOnBlockDrop(targetRootClientId, targetBlockIndex); + const draggedBlockClientIds = getDraggedBlockClientIds(); + const throttled = (0,external_wp_compose_namespaceObject.useThrottle)((0,external_wp_element_namespaceObject.useCallback)((event, currentTarget) => { + const position = { + x: event.clientX, + y: event.clientY + }; + const isBlockDrag = !!(draggedBlockClientIds !== null && draggedBlockClientIds !== void 0 && draggedBlockClientIds.length); + const blockElements = Array.from(currentTarget.querySelectorAll('[data-block]')); + const blocksData = blockElements.map(blockElement => { + const clientId = blockElement.dataset.block; + const rootClientId = getBlockRootClientId(clientId); + return { + clientId, + rootClientId, + blockIndex: getBlockIndex(clientId), + element: blockElement, + isDraggedBlock: isBlockDrag ? draggedBlockClientIds.includes(clientId) : false, + innerBlockCount: getBlockCount(clientId), + canInsertDraggedBlocksAsSibling: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, rootClientId) : true, + canInsertDraggedBlocksAsChild: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, clientId) : true + }; + }); + const newTarget = getListViewDropTarget(blocksData, position); + + if (newTarget) { + setTarget(newTarget); + } + }, [draggedBlockClientIds]), 200); + const ref = (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({ + onDrop: onBlockDrop, + + onDragOver(event) { + // `currentTarget` is only available while the event is being + // handled, so get it now and pass it to the thottled function. + // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget + throttled(event, event.currentTarget); + }, + + onDragEnd() { + throttled.cancel(); + setTarget(null); + } + + }); + return { + ref, + target + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/index.js + + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + + + +const list_view_noop = () => {}; + +const expanded = (state, action) => { + switch (action.type) { + case 'expand': + return { ...state, + ...{ + [action.clientId]: true + } + }; + + case 'collapse': + return { ...state, + ...{ + [action.clientId]: false + } + }; + + default: + return state; + } +}; +/** + * Wrap `ListViewRows` with `TreeGrid`. ListViewRows is a + * recursive component (it renders itself), so this ensures TreeGrid is only + * present at the very top of the navigation grid. + * + * @param {Object} props Components props. + * @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy. + * @param {Function} props.onSelect Block selection callback. + * @param {boolean} props.showNestedBlocks Flag to enable displaying nested blocks. + * @param {boolean} props.showBlockMovers Flag to enable block movers + * @param {boolean} props.__experimentalFeatures Flag to enable experimental features. + * @param {boolean} props.__experimentalPersistentListViewFeatures Flag to enable features for the Persistent List View experiment. + * @param {boolean} props.__experimentalHideContainerBlockActions Flag to hide actions of top level blocks (like core/widget-area) + * @param {Object} ref Forwarded ref + */ + + +function ListView(_ref, ref) { + let { + blocks, + onSelect = list_view_noop, + __experimentalFeatures, + __experimentalPersistentListViewFeatures, + __experimentalHideContainerBlockActions, + showNestedBlocks, + showBlockMovers, + ...props + } = _ref; + const { + clientIdsTree, + draggedClientIds, + selectedClientIds + } = useListViewClientIds(blocks); + const { + selectBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + visibleBlockCount + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getGlobalBlockCount, + getClientIdsOfDescendants + } = select(store); + const draggedBlockCount = (draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.length) > 0 ? getClientIdsOfDescendants(draggedClientIds).length + 1 : 0; + return { + visibleBlockCount: getGlobalBlockCount() - draggedBlockCount + }; + }, [draggedClientIds]); + const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(clientId => { + selectBlock(clientId); + onSelect(clientId); + }, [selectBlock, onSelect]); + const [expandedState, setExpandedState] = (0,external_wp_element_namespaceObject.useReducer)(expanded, {}); + const { + ref: dropZoneRef, + target: blockDropTarget + } = useListViewDropZone(); + const elementRef = (0,external_wp_element_namespaceObject.useRef)(); + const treeGridRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([elementRef, dropZoneRef, ref]); + const isMounted = (0,external_wp_element_namespaceObject.useRef)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { + isMounted.current = true; + }, []); // List View renders a fixed number of items and relies on each having a fixed item height of 36px. + // If this value changes, we should also change the itemHeight value set in useFixedWindowList. + // See: https://github.com/WordPress/gutenberg/pull/35230 for additional context. + + const [fixedListWindow] = (0,external_wp_compose_namespaceObject.__experimentalUseFixedWindowList)(elementRef, 36, visibleBlockCount, { + useWindowing: __experimentalPersistentListViewFeatures, + windowOverscan: 40 + }); + const expand = (0,external_wp_element_namespaceObject.useCallback)(clientId => { + if (!clientId) { + return; + } + + setExpandedState({ + type: 'expand', + clientId + }); + }, [setExpandedState]); + const collapse = (0,external_wp_element_namespaceObject.useCallback)(clientId => { + if (!clientId) { + return; + } + + setExpandedState({ + type: 'collapse', + clientId + }); + }, [setExpandedState]); + const expandRow = (0,external_wp_element_namespaceObject.useCallback)(row => { + var _row$dataset; + + expand(row === null || row === void 0 ? void 0 : (_row$dataset = row.dataset) === null || _row$dataset === void 0 ? void 0 : _row$dataset.block); + }, [expand]); + const collapseRow = (0,external_wp_element_namespaceObject.useCallback)(row => { + var _row$dataset2; + + collapse(row === null || row === void 0 ? void 0 : (_row$dataset2 = row.dataset) === null || _row$dataset2 === void 0 ? void 0 : _row$dataset2.block); + }, [collapse]); + const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + __experimentalFeatures, + __experimentalPersistentListViewFeatures, + __experimentalHideContainerBlockActions, + isTreeGridMounted: isMounted.current, + draggedClientIds, + expandedState, + expand, + collapse + }), [__experimentalFeatures, __experimentalPersistentListViewFeatures, __experimentalHideContainerBlockActions, isMounted.current, draggedClientIds, expandedState, expand, collapse]); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, { + value: true + }, (0,external_wp_element_namespaceObject.createElement)(ListViewDropIndicator, { + listViewRef: elementRef, + blockDropTarget: blockDropTarget + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGrid, { + className: "block-editor-list-view-tree", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'), + ref: treeGridRef, + onCollapseRow: collapseRow, + onExpandRow: expandRow + }, (0,external_wp_element_namespaceObject.createElement)(ListViewContext.Provider, { + value: contextValue + }, (0,external_wp_element_namespaceObject.createElement)(branch, _extends({ + blocks: clientIdsTree, + selectBlock: selectEditorBlock, + showNestedBlocks: showNestedBlocks, + showBlockMovers: showBlockMovers, + fixedListWindow: fixedListWindow, + selectedClientIds: selectedClientIds + }, props))))); +} + +/* harmony default export */ var components_list_view = ((0,external_wp_element_namespaceObject.forwardRef)(ListView)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-navigation/dropdown.js + + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +function BlockNavigationDropdownToggle(_ref) { + let { + isEnabled, + onToggle, + isOpen, + innerRef, + ...props + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, props, { + ref: innerRef, + icon: list_view, + "aria-expanded": isOpen, + "aria-haspopup": "true", + onClick: isEnabled ? onToggle : undefined + /* translators: button label text should, if possible, be under 16 characters. */ + , + label: (0,external_wp_i18n_namespaceObject.__)('List view'), + className: "block-editor-block-navigation", + "aria-disabled": !isEnabled + })); +} + +function BlockNavigationDropdown(_ref2, ref) { + let { + isDisabled, + __experimentalFeatures, + ...props + } = _ref2; + const hasBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(store).getBlockCount(), []); + const isEnabled = hasBlocks && !isDisabled; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + contentClassName: "block-editor-block-navigation__popover", + position: "bottom right", + renderToggle: _ref3 => { + let { + isOpen, + onToggle + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(BlockNavigationDropdownToggle, _extends({}, props, { + innerRef: ref, + isOpen: isOpen, + onToggle: onToggle, + isEnabled: isEnabled + })); + }, + renderContent: () => (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-navigation__container" + }, (0,external_wp_element_namespaceObject.createElement)("p", { + className: "block-editor-block-navigation__label" + }, (0,external_wp_i18n_namespaceObject.__)('List view')), (0,external_wp_element_namespaceObject.createElement)(components_list_view, { + showNestedBlocks: true, + __experimentalFeatures: __experimentalFeatures + })) + }); +} + +/* harmony default export */ var dropdown = ((0,external_wp_element_namespaceObject.forwardRef)(BlockNavigationDropdown)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js + + +/** + * WordPress dependencies + */ + +const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ __webpack_exports__["a"] = (alignRight); +/* harmony default export */ var library_layout = (layout); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-variation-picker/index.js -/***/ }), +/** + * External dependencies + */ -/***/ "zmSX": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _use_gradient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Cn0l"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["a"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["b"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["c"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["d"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["e"]; }); +/** + * WordPress dependencies + */ -/***/ }), -/***/ "zt9T": -/***/ (function(module, exports, __webpack_require__) { +function BlockVariationPicker(_ref) { + let { + icon = library_layout, + label = (0,external_wp_i18n_namespaceObject.__)('Choose variation'), + instructions = (0,external_wp_i18n_namespaceObject.__)('Select a variation to start with.'), + variations, + onSelect, + allowSkip + } = _ref; + const classes = classnames_default()('block-editor-block-variation-picker', { + 'has-many-variations': variations.length > 4 + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { + icon: icon, + label: label, + instructions: instructions, + className: classes + }, (0,external_wp_element_namespaceObject.createElement)("ul", { + className: "block-editor-block-variation-picker__variations", + role: "list", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block variations') + }, variations.map(variation => (0,external_wp_element_namespaceObject.createElement)("li", { + key: variation.name + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "secondary", + icon: variation.icon, + iconSize: 48, + onClick: () => onSelect(variation), + className: "block-editor-block-variation-picker__variation", + label: variation.description || variation.title + }), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-block-variation-picker__variation-label", + role: "presentation" + }, variation.title)))), allowSkip && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-variation-picker__skip" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "link", + onClick: () => onSelect() + }, (0,external_wp_i18n_namespaceObject.__)('Skip')))); +} -"use strict"; +/* harmony default export */ var block_variation_picker = (BlockVariationPicker); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js -var util = __webpack_require__("jB5C"); +/** + * WordPress dependencies + */ -function scrollIntoView(elem, container, config) { - config = config || {}; - // document 归一化到 window - if (container.nodeType === 9) { - container = util.getWindow(container); - } +const grid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z", + fillRule: "evenodd", + clipRule: "evenodd" +})); +/* harmony default export */ var library_grid = (grid); - var allowHorizontalScroll = config.allowHorizontalScroll; - var onlyScrollIfNeeded = config.onlyScrollIfNeeded; - var alignWithTop = config.alignWithTop; - var alignWithLeft = config.alignWithLeft; - var offsetTop = config.offsetTop || 0; - var offsetLeft = config.offsetLeft || 0; - var offsetBottom = config.offsetBottom || 0; - var offsetRight = config.offsetRight || 0; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/constants.js +const VIEWMODES = { + carousel: 'carousel', + grid: 'grid' +}; - allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/setup-toolbar.js - var isWin = util.isWindow(container); - var elemOffset = util.offset(elem); - var eh = util.outerHeight(elem); - var ew = util.outerWidth(elem); - var containerOffset = undefined; - var ch = undefined; - var cw = undefined; - var containerScroll = undefined; - var diffTop = undefined; - var diffBottom = undefined; - var win = undefined; - var winScroll = undefined; - var ww = undefined; - var wh = undefined; - if (isWin) { - win = container; - wh = util.height(win); - ww = util.width(win); - winScroll = { - left: util.scrollLeft(win), - top: util.scrollTop(win) - }; - // elem 相对 container 可视视窗的距离 - diffTop = { - left: elemOffset.left - winScroll.left - offsetLeft, - top: elemOffset.top - winScroll.top - offsetTop - }; - diffBottom = { - left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight, - top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom - }; - containerScroll = winScroll; - } else { - containerOffset = util.offset(container); - ch = container.clientHeight; - cw = container.clientWidth; - containerScroll = { - left: container.scrollLeft, - top: container.scrollTop - }; - // elem 相对 container 可视视窗的距离 - // 注意边框, offset 是边框到根节点 - diffTop = { - left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft, - top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop - }; - diffBottom = { - left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight, - top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom - }; - } +/** + * WordPress dependencies + */ - if (diffTop.top < 0 || diffBottom.top > 0) { - // 强制向上 - if (alignWithTop === true) { - util.scrollTop(container, containerScroll.top + diffTop.top); - } else if (alignWithTop === false) { - util.scrollTop(container, containerScroll.top + diffBottom.top); - } else { - // 自动调整 - if (diffTop.top < 0) { - util.scrollTop(container, containerScroll.top + diffTop.top); - } else { - util.scrollTop(container, containerScroll.top + diffBottom.top); - } - } - } else { - if (!onlyScrollIfNeeded) { - alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; - if (alignWithTop) { - util.scrollTop(container, containerScroll.top + diffTop.top); - } else { - util.scrollTop(container, containerScroll.top + diffBottom.top); - } + + +/** + * Internal dependencies + */ + + + +const Actions = _ref => { + let { + onStartBlank, + onBlockPatternSelect + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-pattern-setup__actions" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + onClick: onStartBlank + }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "primary", + onClick: onBlockPatternSelect + }, (0,external_wp_i18n_namespaceObject.__)('Choose'))); +}; + +const CarouselNavigation = _ref2 => { + let { + handlePrevious, + handleNext, + activeSlide, + totalSlides + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-pattern-setup__navigation" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: chevron_left, + label: (0,external_wp_i18n_namespaceObject.__)('Previous pattern'), + onClick: handlePrevious, + disabled: activeSlide === 0 + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: chevron_right, + label: (0,external_wp_i18n_namespaceObject.__)('Next pattern'), + onClick: handleNext, + disabled: activeSlide === totalSlides - 1 + })); +}; + +const SetupToolbar = _ref3 => { + let { + viewMode, + setViewMode, + handlePrevious, + handleNext, + activeSlide, + totalSlides, + onBlockPatternSelect, + onStartBlank + } = _ref3; + const isCarouselView = viewMode === VIEWMODES.carousel; + const displayControls = (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-pattern-setup__display-controls" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: stretch_full_width, + label: (0,external_wp_i18n_namespaceObject.__)('Carousel view'), + onClick: () => setViewMode(VIEWMODES.carousel), + isPressed: isCarouselView + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: library_grid, + label: (0,external_wp_i18n_namespaceObject.__)('Grid view'), + onClick: () => setViewMode(VIEWMODES.grid), + isPressed: viewMode === VIEWMODES.grid + })); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-pattern-setup__toolbar" + }, isCarouselView && (0,external_wp_element_namespaceObject.createElement)(CarouselNavigation, { + handlePrevious: handlePrevious, + handleNext: handleNext, + activeSlide: activeSlide, + totalSlides: totalSlides + }), displayControls, isCarouselView && (0,external_wp_element_namespaceObject.createElement)(Actions, { + onBlockPatternSelect: onBlockPatternSelect, + onStartBlank: onStartBlank + })); +}; + +/* harmony default export */ var setup_toolbar = (SetupToolbar); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/use-patterns-setup.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + +function usePatternsSetup(clientId, blockName, filterPatternsFn) { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockRootClientId, + __experimentalGetPatternsByBlockTypes, + __experimentalGetAllowedPatterns + } = select(store); + const rootClientId = getBlockRootClientId(clientId); + + if (filterPatternsFn) { + return __experimentalGetAllowedPatterns(rootClientId).filter(filterPatternsFn); } + + return __experimentalGetPatternsByBlockTypes(blockName, rootClientId); + }, [clientId, blockName, filterPatternsFn]); +} + +/* harmony default export */ var use_patterns_setup = (usePatternsSetup); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/index.js + + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const SetupContent = _ref => { + let { + viewMode, + activeSlide, + patterns, + onBlockPatternSelect + } = _ref; + const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)(); + const containerClass = 'block-editor-block-pattern-setup__container'; + + if (viewMode === VIEWMODES.carousel) { + const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: containerClass + }, (0,external_wp_element_namespaceObject.createElement)("ul", { + className: "carousel-container" + }, patterns.map((pattern, index) => (0,external_wp_element_namespaceObject.createElement)(BlockPatternSlide, { + className: slideClass.get(index) || '', + key: pattern.name, + pattern: pattern + })))); } - if (allowHorizontalScroll) { - if (diffTop.left < 0 || diffBottom.left > 0) { - // 强制向上 - if (alignWithLeft === true) { - util.scrollLeft(container, containerScroll.left + diffTop.left); - } else if (alignWithLeft === false) { - util.scrollLeft(container, containerScroll.left + diffBottom.left); - } else { - // 自动调整 - if (diffTop.left < 0) { - util.scrollLeft(container, containerScroll.left + diffTop.left); - } else { - util.scrollLeft(container, containerScroll.left + diffBottom.left); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, { + role: "listbox", + className: containerClass, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Patterns list') + }), patterns.map(pattern => (0,external_wp_element_namespaceObject.createElement)(block_pattern_setup_BlockPattern, { + key: pattern.name, + pattern: pattern, + onSelect: onBlockPatternSelect, + composite: composite + }))); +}; + +function block_pattern_setup_BlockPattern(_ref2) { + let { + pattern, + onSelect, + composite + } = _ref2; + const baseClassName = 'block-editor-block-pattern-setup-list'; + const { + blocks, + title, + description, + viewportWidth = 700 + } = pattern; + const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(block_pattern_setup_BlockPattern, `${baseClassName}__item-description`); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: `${baseClassName}__list-item`, + "aria-label": pattern.title, + "aria-describedby": pattern.description ? descriptionId : undefined + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, _extends({ + role: "option", + as: "div" + }, composite, { + className: `${baseClassName}__item`, + onClick: () => onSelect(blocks) + }), (0,external_wp_element_namespaceObject.createElement)(block_preview, { + blocks: blocks, + viewportWidth: viewportWidth + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: `${baseClassName}__item-title` + }, title)), !!description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + id: descriptionId + }, description)); +} + +function BlockPatternSlide(_ref3) { + let { + className, + pattern + } = _ref3; + const { + blocks, + title, + description + } = pattern; + const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockPatternSlide, 'block-editor-block-pattern-setup-list__item-description'); + return (0,external_wp_element_namespaceObject.createElement)("li", { + className: `pattern-slide ${className}`, + "aria-label": title, + "aria-describedby": description ? descriptionId : undefined + }, (0,external_wp_element_namespaceObject.createElement)(block_preview, { + blocks: blocks, + __experimentalLive: true + }), !!description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + id: descriptionId + }, description)); +} + +const BlockPatternSetup = _ref4 => { + let { + clientId, + blockName, + filterPatternsFn, + startBlankComponent, + onBlockPatternSelect + } = _ref4; + const [viewMode, setViewMode] = (0,external_wp_element_namespaceObject.useState)(VIEWMODES.carousel); + const [activeSlide, setActiveSlide] = (0,external_wp_element_namespaceObject.useState)(0); + const [showBlank, setShowBlank] = (0,external_wp_element_namespaceObject.useState)(false); + const { + replaceBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const patterns = use_patterns_setup(clientId, blockName, filterPatternsFn); + + if (!(patterns !== null && patterns !== void 0 && patterns.length) || showBlank) { + return startBlankComponent; + } + + const onBlockPatternSelectDefault = blocks => { + const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); + replaceBlock(clientId, clonedBlocks); + }; + + const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: `block-editor-block-pattern-setup view-mode-${viewMode}` + }, (0,external_wp_element_namespaceObject.createElement)(setup_toolbar, { + viewMode: viewMode, + setViewMode: setViewMode, + activeSlide: activeSlide, + totalSlides: patterns.length, + handleNext: () => { + setActiveSlide(active => active + 1); + }, + handlePrevious: () => { + setActiveSlide(active => active - 1); + }, + onBlockPatternSelect: () => { + onPatternSelectCallback(patterns[activeSlide].blocks); + }, + onStartBlank: () => { + setShowBlank(true); + } + }), (0,external_wp_element_namespaceObject.createElement)(SetupContent, { + viewMode: viewMode, + activeSlide: activeSlide, + patterns: patterns, + onBlockPatternSelect: onPatternSelectCallback + })); +}; + +/* harmony default export */ var block_pattern_setup = (BlockPatternSetup); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/block-variation-transforms.js +/** + * External dependencies + */ + +/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ + +/** + * Matches the provided block variations with a block's attributes. If no match + * or more than one matches are found it returns `undefined`. If a single match is + * found it returns it. + * + * This is a simple implementation for now as it takes into account only the attributes + * of a block variation and not `InnerBlocks`. + * + * @param {Object} blockAttributes - The block attributes to try to find a match. + * @param {WPBlockVariation[]} variations - A list of block variations to test for a match. + * @return {?WPBlockVariation} - If a match is found returns it. If not or more than one matches are found returns `undefined`. + */ + +const __experimentalGetMatchingVariation = (blockAttributes, variations) => { + if (!variations || !blockAttributes) return; + const matches = variations.filter(_ref => { + let { + attributes + } = _ref; + if (!attributes || !Object.keys(attributes).length) return false; + return (0,external_lodash_namespaceObject.isMatch)(blockAttributes, attributes); + }); + if (matches.length !== 1) return; + return matches[0]; +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-variation-transforms/index.js + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +function __experimentalBlockVariationTransforms(_ref) { + let { + blockClientId + } = _ref; + const [selectedValue, setSelectedValue] = (0,external_wp_element_namespaceObject.useState)(); + const { + updateBlockAttributes + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + variations, + blockAttributes + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockVariations + } = select(external_wp_blocks_namespaceObject.store); + const { + getBlockName, + getBlockAttributes + } = select(store); + const blockName = blockClientId && getBlockName(blockClientId); + return { + variations: blockName && getBlockVariations(blockName, 'transform'), + blockAttributes: getBlockAttributes(blockClientId) + }; + }, [blockClientId]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + var _getMatchingVariation; + + setSelectedValue((_getMatchingVariation = __experimentalGetMatchingVariation(blockAttributes, variations)) === null || _getMatchingVariation === void 0 ? void 0 : _getMatchingVariation.name); + }, [blockAttributes, variations]); + if (!(variations !== null && variations !== void 0 && variations.length)) return null; + const selectOptions = variations.map(_ref2 => { + let { + name, + title, + description + } = _ref2; + return { + value: name, + label: title, + info: description + }; + }); + + const onSelectVariation = variationName => { + updateBlockAttributes(blockClientId, { ...variations.find(_ref3 => { + let { + name + } = _ref3; + return name === variationName; + }).attributes + }); + }; + + const baseClass = 'block-editor-block-variation-transforms'; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { + className: baseClass, + label: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'), + text: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'), + popoverProps: { + position: 'bottom center', + className: `${baseClass}__popover` + }, + icon: chevron_down, + toggleProps: { + iconPosition: 'right' + } + }, () => (0,external_wp_element_namespaceObject.createElement)("div", { + className: `${baseClass}__container` + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, { + choices: selectOptions, + value: selectedValue, + onSelect: onSelectVariation + })))); +} + +/* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/icons.js + + +/** + * WordPress dependencies + */ + +const alignBottom = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z" +})); +const icons_alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" +})); +const alignTop = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z" +})); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/ui.js + + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +const ui_BLOCK_ALIGNMENTS_CONTROLS = { + top: { + icon: alignTop, + title: (0,external_wp_i18n_namespaceObject._x)('Align top', 'Block vertical alignment setting') + }, + center: { + icon: icons_alignCenter, + title: (0,external_wp_i18n_namespaceObject._x)('Align middle', 'Block vertical alignment setting') + }, + bottom: { + icon: alignBottom, + title: (0,external_wp_i18n_namespaceObject._x)('Align bottom', 'Block vertical alignment setting') + } +}; +const ui_DEFAULT_CONTROLS = ['top', 'center', 'bottom']; +const ui_DEFAULT_CONTROL = 'top'; +const block_vertical_alignment_control_ui_POPOVER_PROPS = { + isAlternate: true +}; + +function BlockVerticalAlignmentUI(_ref) { + let { + value, + onChange, + controls = ui_DEFAULT_CONTROLS, + isCollapsed = true, + isToolbar + } = _ref; + + function applyOrUnset(align) { + return () => onChange(value === align ? undefined : align); + } + + const activeAlignment = ui_BLOCK_ALIGNMENTS_CONTROLS[value]; + const defaultAlignmentControl = ui_BLOCK_ALIGNMENTS_CONTROLS[ui_DEFAULT_CONTROL]; + const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; + const extraProps = isToolbar ? { + isCollapsed + } : {}; + return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({ + popoverProps: block_vertical_alignment_control_ui_POPOVER_PROPS, + icon: activeAlignment ? activeAlignment.icon : defaultAlignmentControl.icon, + label: (0,external_wp_i18n_namespaceObject._x)('Change vertical alignment', 'Block vertical alignment setting label'), + controls: controls.map(control => { + return { ...ui_BLOCK_ALIGNMENTS_CONTROLS[control], + isActive: value === control, + role: isCollapsed ? 'menuitemradio' : undefined, + onClick: applyOrUnset(control) + }; + }) + }, extraProps)); +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md + */ + + +/* harmony default export */ var block_vertical_alignment_control_ui = (BlockVerticalAlignmentUI); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/index.js + + + +/** + * Internal dependencies + */ + +function BlockVerticalAlignmentControl(props) { + return (0,external_wp_element_namespaceObject.createElement)(block_vertical_alignment_control_ui, _extends({}, props, { + isToolbar: false + })); +} +function BlockVerticalAlignmentToolbar(props) { + return (0,external_wp_element_namespaceObject.createElement)(block_vertical_alignment_control_ui, _extends({}, props, { + isToolbar: true + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-palette/with-color-context.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/* harmony default export */ var with_color_context = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => { + return props => { + const colorsFeature = useSetting('color.palette'); + const disableCustomColorsFeature = !useSetting('color.custom'); + const colors = props.colors === undefined ? colorsFeature : props.colors; + const disableCustomColors = props.disableCustomColors === undefined ? disableCustomColorsFeature : props.disableCustomColors; + const hasColorsToChoose = !(0,external_lodash_namespaceObject.isEmpty)(colors) || !disableCustomColors; + return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, { + colors, + disableCustomColors, + hasColorsToChoose + })); + }; +}, 'withColorContext')); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-palette/index.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +/* harmony default export */ var color_palette = (with_color_context(external_wp_components_namespaceObject.ColorPalette)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-palette/control.js + + + +/** + * Internal dependencies + */ + +function ColorPaletteControl(_ref) { + let { + onChange, + value, + ...otherProps + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(control, _extends({}, otherProps, { + onColorChange: onChange, + colorValue: value, + gradients: [], + disableCustomGradients: true + })); +} + +;// CONCATENATED MODULE: ./node_modules/react-easy-crop/node_modules/tslib/tslib.es6.js +/*! ***************************************************************************** +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 */ + +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) { + 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 __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; + return g = { next: verb(0), "throw": verb(1), "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 (_) 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; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (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; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +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 __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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + 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: n === "return" } : 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, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} + +// EXTERNAL MODULE: ./node_modules/normalize-wheel/index.js +var normalize_wheel = __webpack_require__(7970); +var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel); +;// CONCATENATED MODULE: ./node_modules/react-easy-crop/index.module.js + + + + +/** + * Compute the dimension of the crop area based on media size, + * aspect ratio and optionally rotation + */ + +function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) { + if (rotation === void 0) { + rotation = 0; + } + + var _a = translateSize(mediaWidth, mediaHeight, rotation), + width = _a.width, + height = _a.height; + + var fittingWidth = Math.min(width, containerWidth); + var fittingHeight = Math.min(height, containerHeight); + + if (fittingWidth > fittingHeight * aspect) { + return { + width: fittingHeight * aspect, + height: fittingHeight + }; + } + + return { + width: fittingWidth, + height: fittingWidth / aspect + }; +} +/** + * Ensure a new media position stays in the crop area. + */ + +function restrictPosition(position, mediaSize, cropSize, zoom, rotation) { + if (rotation === void 0) { + rotation = 0; + } + + var _a = translateSize(mediaSize.width, mediaSize.height, rotation), + width = _a.width, + height = _a.height; + + return { + x: restrictPositionCoord(position.x, width, cropSize.width, zoom), + y: restrictPositionCoord(position.y, height, cropSize.height, zoom) + }; +} + +function restrictPositionCoord(position, mediaSize, cropSize, zoom) { + var maxPosition = mediaSize * zoom / 2 - cropSize / 2; + return Math.min(maxPosition, Math.max(position, -maxPosition)); +} + +function getDistanceBetweenPoints(pointA, pointB) { + return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2)); +} +function getRotationBetweenPoints(pointA, pointB) { + return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI; +} +/** + * Compute the output cropped area of the media in percentages and pixels. + * x/y are the top-left coordinates on the src media + */ + +function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) { + if (rotation === void 0) { + rotation = 0; + } + + if (restrictPosition === void 0) { + restrictPosition = true; + } // if the media is rotated by the user, we cannot limit the position anymore + // as it might need to be negative. + + + var limitAreaFn = restrictPosition && rotation === 0 ? limitArea : noOp; + var croppedAreaPercentages = { + x: limitAreaFn(100, ((mediaSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaSize.width * 100), + y: limitAreaFn(100, ((mediaSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaSize.height * 100), + width: limitAreaFn(100, cropSize.width / mediaSize.width * 100 / zoom), + height: limitAreaFn(100, cropSize.height / mediaSize.height * 100 / zoom) + }; // we compute the pixels size naively + + var widthInPixels = Math.round(limitAreaFn(mediaSize.naturalWidth, croppedAreaPercentages.width * mediaSize.naturalWidth / 100)); + var heightInPixels = Math.round(limitAreaFn(mediaSize.naturalHeight, croppedAreaPercentages.height * mediaSize.naturalHeight / 100)); + var isImgWiderThanHigh = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; // then we ensure the width and height exactly match the aspect (to avoid rounding approximations) + // if the media is wider than high, when zoom is 0, the crop height will be equals to iamge height + // thus we want to compute the width from the height and aspect for accuracy. + // Otherwise, we compute the height from width and aspect. + + var sizePixels = isImgWiderThanHigh ? { + width: Math.round(heightInPixels * aspect), + height: heightInPixels + } : { + width: widthInPixels, + height: Math.round(widthInPixels / aspect) + }; + + var croppedAreaPixels = __assign(__assign({}, sizePixels), { + x: Math.round(limitAreaFn(mediaSize.naturalWidth - sizePixels.width, croppedAreaPercentages.x * mediaSize.naturalWidth / 100)), + y: Math.round(limitAreaFn(mediaSize.naturalHeight - sizePixels.height, croppedAreaPercentages.y * mediaSize.naturalHeight / 100)) + }); + + return { + croppedAreaPercentages: croppedAreaPercentages, + croppedAreaPixels: croppedAreaPixels + }; +} +/** + * Ensure the returned value is between 0 and max + */ + +function limitArea(max, value) { + return Math.min(max, Math.max(0, value)); +} + +function noOp(_max, value) { + return value; +} +/** + * Compute the crop and zoom from the croppedAreaPixels + */ + + +function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { + var mediaZoom = mediaSize.width / mediaSize.naturalWidth; + + if (cropSize) { + var isHeightMaxSize_1 = cropSize.height > cropSize.width; + return isHeightMaxSize_1 ? cropSize.height / mediaZoom / croppedAreaPixels.height : cropSize.width / mediaZoom / croppedAreaPixels.width; + } + + var aspect = croppedAreaPixels.width / croppedAreaPixels.height; + var isHeightMaxSize = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; + return isHeightMaxSize ? mediaSize.naturalHeight / croppedAreaPixels.height : mediaSize.naturalWidth / croppedAreaPixels.width; +} +/** + * Compute the crop and zoom from the croppedAreaPixels + */ + + +function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { + var mediaZoom = mediaSize.width / mediaSize.naturalWidth; + var zoom = getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize); + var cropZoom = mediaZoom * zoom; + var crop = { + x: ((mediaSize.naturalWidth - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom, + y: ((mediaSize.naturalHeight - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom + }; + return { + crop: crop, + zoom: zoom + }; +} +/** + * Return the point that is the center of point a and b + */ + +function getCenter(a, b) { + return { + x: (b.x + a.x) / 2, + y: (b.y + a.y) / 2 + }; +} +/** + * + * Returns an x,y point once rotated around xMid,yMid + */ + +function rotateAroundMidPoint(x, y, xMid, yMid, degrees) { + var cos = Math.cos; + var sin = Math.sin; + var radian = degrees * Math.PI / 180; // Convert to radians + // Subtract midpoints, so that midpoint is translated to origin + // and add it in the end again + + var xr = (x - xMid) * cos(radian) - (y - yMid) * sin(radian) + xMid; + var yr = (x - xMid) * sin(radian) + (y - yMid) * cos(radian) + yMid; + return [xr, yr]; +} +/** + * Returns the new bounding area of a rotated rectangle. + */ + +function translateSize(width, height, rotation) { + var centerX = width / 2; + var centerY = height / 2; + var outerBounds = [rotateAroundMidPoint(0, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, height, centerX, centerY, rotation), rotateAroundMidPoint(0, height, centerX, centerY, rotation)]; + var minX = Math.min.apply(Math, outerBounds.map(function (p) { + return p[0]; + })); + var maxX = Math.max.apply(Math, outerBounds.map(function (p) { + return p[0]; + })); + var minY = Math.min.apply(Math, outerBounds.map(function (p) { + return p[1]; + })); + var maxY = Math.max.apply(Math, outerBounds.map(function (p) { + return p[1]; + })); + return { + width: maxX - minX, + height: maxY - minY + }; +} +/** + * Combine multiple class names into a single string. + */ + +function classNames() { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + return args.filter(function (value) { + if (typeof value === 'string' && value.length > 0) { + return true; + } + + return false; + }).join(' ').trim(); +} + +var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n"; + +var MIN_ZOOM = 1; +var MAX_ZOOM = 3; + +var Cropper = +/** @class */ +function (_super) { + __extends(Cropper, _super); + + function Cropper() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.imageRef = null; + _this.videoRef = null; + _this.containerRef = null; + _this.styleRef = null; + _this.containerRect = null; + _this.mediaSize = { + width: 0, + height: 0, + naturalWidth: 0, + naturalHeight: 0 + }; + _this.dragStartPosition = { + x: 0, + y: 0 + }; + _this.dragStartCrop = { + x: 0, + y: 0 + }; + _this.lastPinchDistance = 0; + _this.lastPinchRotation = 0; + _this.rafDragTimeout = null; + _this.rafPinchTimeout = null; + _this.wheelTimer = null; + _this.state = { + cropSize: null, + hasWheelJustStarted: false + }; // this is to prevent Safari on iOS >= 10 to zoom the page + + _this.preventZoomSafari = function (e) { + return e.preventDefault(); + }; + + _this.cleanEvents = function () { + document.removeEventListener('mousemove', _this.onMouseMove); + document.removeEventListener('mouseup', _this.onDragStopped); + document.removeEventListener('touchmove', _this.onTouchMove); + document.removeEventListener('touchend', _this.onDragStopped); + }; + + _this.clearScrollEvent = function () { + if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel); + + if (_this.wheelTimer) { + clearTimeout(_this.wheelTimer); + } + }; + + _this.onMediaLoad = function () { + _this.computeSizes(); + + _this.emitCropData(); + + _this.setInitialCrop(); + + if (_this.props.onMediaLoaded) { + _this.props.onMediaLoaded(_this.mediaSize); + } + }; + + _this.setInitialCrop = function () { + var _a = _this.props, + initialCroppedAreaPixels = _a.initialCroppedAreaPixels, + cropSize = _a.cropSize; + + if (!initialCroppedAreaPixels) { + return; + } + + var _b = getInitialCropFromCroppedAreaPixels(initialCroppedAreaPixels, _this.mediaSize, cropSize), + crop = _b.crop, + zoom = _b.zoom; + + _this.props.onCropChange(crop); + + _this.props.onZoomChange && _this.props.onZoomChange(zoom); + }; + + _this.computeSizes = function () { + var _a, _b, _c, _d, _e, _f; + + var mediaRef = _this.imageRef || _this.videoRef; + + if (mediaRef && _this.containerRef) { + _this.containerRect = _this.containerRef.getBoundingClientRect(); + _this.mediaSize = { + width: mediaRef.offsetWidth, + height: mediaRef.offsetHeight, + naturalWidth: ((_a = _this.imageRef) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0, + naturalHeight: ((_c = _this.imageRef) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0 + }; + var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(mediaRef.offsetWidth, mediaRef.offsetHeight, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation); + + if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) { + _this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize); } + + _this.setState({ + cropSize: cropSize + }, _this.recomputeCropPosition); } + }; + + _this.onMouseDown = function (e) { + e.preventDefault(); + document.addEventListener('mousemove', _this.onMouseMove); + document.addEventListener('mouseup', _this.onDragStopped); + + _this.onDragStart(Cropper.getMousePoint(e)); + }; + + _this.onMouseMove = function (e) { + return _this.onDrag(Cropper.getMousePoint(e)); + }; + + _this.onTouchStart = function (e) { + document.addEventListener('touchmove', _this.onTouchMove, { + passive: false + }); // iOS 11 now defaults to passive: true + + document.addEventListener('touchend', _this.onDragStopped); + + if (e.touches.length === 2) { + _this.onPinchStart(e); + } else if (e.touches.length === 1) { + _this.onDragStart(Cropper.getTouchPoint(e.touches[0])); + } + }; + + _this.onTouchMove = function (e) { + // Prevent whole page from scrolling on iOS. + e.preventDefault(); + + if (e.touches.length === 2) { + _this.onPinchMove(e); + } else if (e.touches.length === 1) { + _this.onDrag(Cropper.getTouchPoint(e.touches[0])); + } + }; + + _this.onDragStart = function (_a) { + var _b, _c; + + var x = _a.x, + y = _a.y; + _this.dragStartPosition = { + x: x, + y: y + }; + _this.dragStartCrop = __assign({}, _this.props.crop); + (_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b); + }; + + _this.onDrag = function (_a) { + var x = _a.x, + y = _a.y; + if (_this.rafDragTimeout) window.cancelAnimationFrame(_this.rafDragTimeout); + _this.rafDragTimeout = window.requestAnimationFrame(function () { + if (!_this.state.cropSize) return; + if (x === undefined || y === undefined) return; + var offsetX = x - _this.dragStartPosition.x; + var offsetY = y - _this.dragStartPosition.y; + var requestedPosition = { + x: _this.dragStartCrop.x + offsetX, + y: _this.dragStartCrop.y + offsetY + }; + var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition; + + _this.props.onCropChange(newPosition); + }); + }; + + _this.onDragStopped = function () { + var _a, _b; + + _this.cleanEvents(); + + _this.emitCropData(); + + (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); + }; + + _this.onWheel = function (e) { + e.preventDefault(); + var point = Cropper.getMousePoint(e); + var pixelY = normalize_wheel_default()(e).pixelY; + var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200; + + _this.setNewZoom(newZoom, point); + + if (!_this.state.hasWheelJustStarted) { + _this.setState({ + hasWheelJustStarted: true + }, function () { + var _a, _b; + + return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a); + }); + } + + if (_this.wheelTimer) { + clearTimeout(_this.wheelTimer); + } + + _this.wheelTimer = window.setTimeout(function () { + return _this.setState({ + hasWheelJustStarted: false + }, function () { + var _a, _b; + + return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); + }); + }, 250); + }; + + _this.getPointOnContainer = function (_a) { + var x = _a.x, + y = _a.y; + + if (!_this.containerRect) { + throw new Error('The Cropper is not mounted'); + } + + return { + x: _this.containerRect.width / 2 - (x - _this.containerRect.left), + y: _this.containerRect.height / 2 - (y - _this.containerRect.top) + }; + }; + + _this.getPointOnMedia = function (_a) { + var x = _a.x, + y = _a.y; + var _b = _this.props, + crop = _b.crop, + zoom = _b.zoom; + return { + x: (x + crop.x) / zoom, + y: (y + crop.y) / zoom + }; + }; + + _this.setNewZoom = function (zoom, point) { + if (!_this.state.cropSize || !_this.props.onZoomChange) return; + + var zoomPoint = _this.getPointOnContainer(point); + + var zoomTarget = _this.getPointOnMedia(zoomPoint); + + var newZoom = Math.min(_this.props.maxZoom, Math.max(zoom, _this.props.minZoom)); + var requestedPosition = { + x: zoomTarget.x * newZoom - zoomPoint.x, + y: zoomTarget.y * newZoom - zoomPoint.y + }; + var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition; + + _this.props.onCropChange(newPosition); + + _this.props.onZoomChange(newZoom); + }; + + _this.getCropData = function () { + if (!_this.state.cropSize) { + return null; + } // this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ricardo-ch/react-easy-crop/issues/6) + + + var restrictedPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; + return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition); + }; + + _this.emitCropData = function () { + var cropData = _this.getCropData(); + + if (!cropData) return; + var croppedAreaPercentages = cropData.croppedAreaPercentages, + croppedAreaPixels = cropData.croppedAreaPixels; + + if (_this.props.onCropComplete) { + _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels); + } + + if (_this.props.onCropAreaChange) { + _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); + } + }; + + _this.emitCropAreaChange = function () { + var cropData = _this.getCropData(); + + if (!cropData) return; + var croppedAreaPercentages = cropData.croppedAreaPercentages, + croppedAreaPixels = cropData.croppedAreaPixels; + + if (_this.props.onCropAreaChange) { + _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); + } + }; + + _this.recomputeCropPosition = function () { + if (!_this.state.cropSize) return; + var newPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; + + _this.props.onCropChange(newPosition); + + _this.emitCropData(); + }; + + return _this; + } + + Cropper.prototype.componentDidMount = function () { + window.addEventListener('resize', this.computeSizes); + + if (this.containerRef) { + this.props.zoomWithScroll && this.containerRef.addEventListener('wheel', this.onWheel, { + passive: false + }); + this.containerRef.addEventListener('gesturestart', this.preventZoomSafari); + this.containerRef.addEventListener('gesturechange', this.preventZoomSafari); + } + + if (!this.props.disableAutomaticStylesInjection) { + this.styleRef = document.createElement('style'); + this.styleRef.setAttribute('type', 'text/css'); + this.styleRef.innerHTML = css_248z; + document.head.appendChild(this.styleRef); + } // when rendered via SSR, the image can already be loaded and its onLoad callback will never be called + + + if (this.imageRef && this.imageRef.complete) { + this.onMediaLoad(); + } + }; + + Cropper.prototype.componentWillUnmount = function () { + var _a; + + window.removeEventListener('resize', this.computeSizes); + + if (this.containerRef) { + this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari); + this.containerRef.removeEventListener('gesturechange', this.preventZoomSafari); + } + + if (this.styleRef) { + (_a = this.styleRef.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this.styleRef); + } + + this.cleanEvents(); + this.props.zoomWithScroll && this.clearScrollEvent(); + }; + + Cropper.prototype.componentDidUpdate = function (prevProps) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + + if (prevProps.rotation !== this.props.rotation) { + this.computeSizes(); + this.recomputeCropPosition(); + } else if (prevProps.aspect !== this.props.aspect) { + this.computeSizes(); + } else if (prevProps.zoom !== this.props.zoom) { + this.recomputeCropPosition(); + } else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) { + this.computeSizes(); + } else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) { + this.emitCropAreaChange(); + } + + if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) { + this.props.zoomWithScroll ? this.containerRef.addEventListener('wheel', this.onWheel, { + passive: false + }) : this.clearScrollEvent(); + } + + if (prevProps.video !== this.props.video) { + (_j = this.videoRef) === null || _j === void 0 ? void 0 : _j.load(); + } + }; + + Cropper.prototype.getAspect = function () { + var _a = this.props, + cropSize = _a.cropSize, + aspect = _a.aspect; + + if (cropSize) { + return cropSize.width / cropSize.height; + } + + return aspect; + }; + + Cropper.prototype.onPinchStart = function (e) { + var pointA = Cropper.getTouchPoint(e.touches[0]); + var pointB = Cropper.getTouchPoint(e.touches[1]); + this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB); + this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB); + this.onDragStart(getCenter(pointA, pointB)); + }; + + Cropper.prototype.onPinchMove = function (e) { + var _this = this; + + var pointA = Cropper.getTouchPoint(e.touches[0]); + var pointB = Cropper.getTouchPoint(e.touches[1]); + var center = getCenter(pointA, pointB); + this.onDrag(center); + if (this.rafPinchTimeout) window.cancelAnimationFrame(this.rafPinchTimeout); + this.rafPinchTimeout = window.requestAnimationFrame(function () { + var distance = getDistanceBetweenPoints(pointA, pointB); + var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance); + + _this.setNewZoom(newZoom, center); + + _this.lastPinchDistance = distance; + var rotation = getRotationBetweenPoints(pointA, pointB); + var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation); + _this.props.onRotationChange && _this.props.onRotationChange(newRotation); + _this.lastPinchRotation = rotation; + }); + }; + + Cropper.prototype.render = function () { + var _this = this; + + var _a = this.props, + image = _a.image, + video = _a.video, + mediaProps = _a.mediaProps, + transform = _a.transform, + _b = _a.crop, + x = _b.x, + y = _b.y, + rotation = _a.rotation, + zoom = _a.zoom, + cropShape = _a.cropShape, + showGrid = _a.showGrid, + _c = _a.style, + containerStyle = _c.containerStyle, + cropAreaStyle = _c.cropAreaStyle, + mediaStyle = _c.mediaStyle, + _d = _a.classes, + containerClassName = _d.containerClassName, + cropAreaClassName = _d.cropAreaClassName, + mediaClassName = _d.mediaClassName, + objectFit = _a.objectFit; + return /*#__PURE__*/external_React_default().createElement("div", { + onMouseDown: this.onMouseDown, + onTouchStart: this.onTouchStart, + ref: function ref(el) { + return _this.containerRef = el; + }, + "data-testid": "container", + style: containerStyle, + className: classNames('reactEasyCrop_Container', containerClassName) + }, image ? /*#__PURE__*/external_React_default().createElement("img", __assign({ + alt: "", + className: classNames('reactEasyCrop_Image', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName) + }, mediaProps, { + src: image, + ref: function ref(el) { + return _this.imageRef = el; + }, + style: __assign(__assign({}, mediaStyle), { + transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" + }), + onLoad: this.onMediaLoad + })) : video && /*#__PURE__*/external_React_default().createElement("video", __assign({ + autoPlay: true, + loop: true, + muted: true, + className: classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName) + }, mediaProps, { + ref: function ref(el) { + return _this.videoRef = el; + }, + onLoadedMetadata: this.onMediaLoad, + style: __assign(__assign({}, mediaStyle), { + transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" + }), + controls: false + }), (Array.isArray(video) ? video : [{ + src: video + }]).map(function (item) { + return /*#__PURE__*/external_React_default().createElement("source", __assign({ + key: item.src + }, item)); + })), this.state.cropSize && /*#__PURE__*/external_React_default().createElement("div", { + style: __assign(__assign({}, cropAreaStyle), { + width: this.state.cropSize.width, + height: this.state.cropSize.height + }), + "data-testid": "cropper", + className: classNames('reactEasyCrop_CropArea', cropShape === 'round' && 'reactEasyCrop_CropAreaRound', showGrid && 'reactEasyCrop_CropAreaGrid', cropAreaClassName) + })); + }; + + Cropper.defaultProps = { + zoom: 1, + rotation: 0, + aspect: 4 / 3, + maxZoom: MAX_ZOOM, + minZoom: MIN_ZOOM, + cropShape: 'rect', + objectFit: 'contain', + showGrid: true, + style: {}, + classes: {}, + mediaProps: {}, + zoomSpeed: 1, + restrictPosition: true, + zoomWithScroll: true + }; + + Cropper.getMousePoint = function (e) { + return { + x: Number(e.clientX), + y: Number(e.clientY) + }; + }; + + Cropper.getTouchPoint = function (touch) { + return { + x: Number(touch.clientX), + y: Number(touch.clientY) + }; + }; + + return Cropper; +}((external_React_default()).Component); + +/* harmony default export */ var index_module = (Cropper); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/constants.js +const constants_MIN_ZOOM = 100; +const constants_MAX_ZOOM = 300; +const constants_POPOVER_PROPS = { + position: 'bottom right', + isAlternate: true +}; + +;// CONCATENATED MODULE: external ["wp","apiFetch"] +var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; +var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-save-image.js +/** + * WordPress dependencies + */ + + + + + +function useSaveImage(_ref) { + let { + crop, + rotation, + height, + width, + aspect, + url, + id, + onSaveImage, + onFinishEditing + } = _ref; + const { + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const [isInProgress, setIsInProgress] = (0,external_wp_element_namespaceObject.useState)(false); + const cancel = (0,external_wp_element_namespaceObject.useCallback)(() => { + setIsInProgress(false); + onFinishEditing(); + }, [setIsInProgress, onFinishEditing]); + const apply = (0,external_wp_element_namespaceObject.useCallback)(() => { + setIsInProgress(true); + let attrs = {}; // The crop script may return some very small, sub-pixel values when the image was not cropped. + // Crop only when the new size has changed by more than 0.1%. + + if (crop.width < 99.9 || crop.height < 99.9) { + attrs = crop; + } + + if (rotation > 0) { + attrs.rotation = rotation; + } + + attrs.src = url; + external_wp_apiFetch_default()({ + path: `/wp/v2/media/${id}/edit`, + method: 'POST', + data: attrs + }).then(response => { + onSaveImage({ + id: response.id, + url: response.source_url, + height: height && width ? width / aspect : undefined + }); + }).catch(error => { + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: 1. Error message */ + (0,external_wp_i18n_namespaceObject.__)('Could not edit image. %s'), error.message), { + id: 'image-editing-error', + type: 'snackbar' + }); + }).finally(() => { + setIsInProgress(false); + onFinishEditing(); + }); + }, [setIsInProgress, crop, rotation, height, width, aspect, url, onSaveImage, createErrorNotice, setIsInProgress, onFinishEditing]); + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + isInProgress, + apply, + cancel + }), [isInProgress, apply, cancel]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-transform-image.js +/** + * WordPress dependencies + */ + + + +function useTransformState(_ref) { + let { + url, + naturalWidth, + naturalHeight + } = _ref; + const [editedUrl, setEditedUrl] = (0,external_wp_element_namespaceObject.useState)(); + const [crop, setCrop] = (0,external_wp_element_namespaceObject.useState)(); + const [position, setPosition] = (0,external_wp_element_namespaceObject.useState)({ + x: 0, + y: 0 + }); + const [zoom, setZoom] = (0,external_wp_element_namespaceObject.useState)(); + const [rotation, setRotation] = (0,external_wp_element_namespaceObject.useState)(); + const [aspect, setAspect] = (0,external_wp_element_namespaceObject.useState)(); + const [defaultAspect, setDefaultAspect] = (0,external_wp_element_namespaceObject.useState)(); + const initializeTransformValues = (0,external_wp_element_namespaceObject.useCallback)(() => { + setPosition({ + x: 0, + y: 0 + }); + setZoom(100); + setRotation(0); + setAspect(naturalWidth / naturalHeight); + setDefaultAspect(naturalWidth / naturalHeight); + }, [naturalWidth, naturalHeight, setPosition, setZoom, setRotation, setAspect, setDefaultAspect]); + const rotateClockwise = (0,external_wp_element_namespaceObject.useCallback)(() => { + const angle = (rotation + 90) % 360; + let naturalAspectRatio = naturalWidth / naturalHeight; + + if (rotation % 180 === 90) { + naturalAspectRatio = naturalHeight / naturalWidth; + } + + if (angle === 0) { + setEditedUrl(); + setRotation(angle); + setAspect(1 / aspect); + setPosition({ + x: -(position.y * naturalAspectRatio), + y: position.x * naturalAspectRatio + }); + return; + } + + function editImage(event) { + const canvas = document.createElement('canvas'); + let translateX = 0; + let translateY = 0; + + if (angle % 180) { + canvas.width = event.target.height; + canvas.height = event.target.width; + } else { + canvas.width = event.target.width; + canvas.height = event.target.height; + } + + if (angle === 90 || angle === 180) { + translateX = canvas.width; + } + + if (angle === 270 || angle === 180) { + translateY = canvas.height; + } + + const context = canvas.getContext('2d'); + context.translate(translateX, translateY); + context.rotate(angle * Math.PI / 180); + context.drawImage(event.target, 0, 0); + canvas.toBlob(blob => { + setEditedUrl(URL.createObjectURL(blob)); + setRotation(angle); + setAspect(1 / aspect); + setPosition({ + x: -(position.y * naturalAspectRatio), + y: position.x * naturalAspectRatio + }); + }); + } + + const el = new window.Image(); + el.src = url; + el.onload = editImage; + const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url); + + if (typeof imgCrossOrigin === 'string') { + el.crossOrigin = imgCrossOrigin; + } + }, [rotation, naturalWidth, naturalHeight, setEditedUrl, setRotation, setAspect, setPosition]); + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + editedUrl, + setEditedUrl, + crop, + setCrop, + position, + setPosition, + zoom, + setZoom, + rotation, + setRotation, + rotateClockwise, + aspect, + setAspect, + defaultAspect, + initializeTransformValues + }), [editedUrl, setEditedUrl, crop, setCrop, position, setPosition, zoom, setZoom, rotation, setRotation, rotateClockwise, aspect, setAspect, defaultAspect, initializeTransformValues]); +} + +function useTransformImage(imageProperties, isEditing) { + const transformState = useTransformState(imageProperties); + const { + initializeTransformValues + } = transformState; + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (isEditing) { + initializeTransformValues(); + } + }, [isEditing, initializeTransformValues]); + return transformState; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/context.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + +const ImageEditingContext = (0,external_wp_element_namespaceObject.createContext)({}); +const useImageEditingContext = () => (0,external_wp_element_namespaceObject.useContext)(ImageEditingContext); +function ImageEditingProvider(_ref) { + let { + id, + url, + naturalWidth, + naturalHeight, + isEditing, + onFinishEditing, + onSaveImage, + children + } = _ref; + const transformImage = useTransformImage({ + url, + naturalWidth, + naturalHeight + }, isEditing); + const saveImage = useSaveImage({ + id, + url, + onSaveImage, + onFinishEditing, + ...transformImage + }); + const providerValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...transformImage, + ...saveImage + }), [transformImage, saveImage]); + return (0,external_wp_element_namespaceObject.createElement)(ImageEditingContext.Provider, { + value: providerValue + }, children); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/cropper.js + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function ImageCropper(_ref) { + let { + url, + width, + height, + clientWidth, + naturalHeight, + naturalWidth + } = _ref; + const { + isInProgress, + editedUrl, + position, + zoom, + aspect, + setPosition, + setCrop, + setZoom, + rotation + } = useImageEditingContext(); + let editedHeight = height || clientWidth * naturalHeight / naturalWidth; + + if (rotation % 180 === 90) { + editedHeight = clientWidth * naturalWidth / naturalHeight; + } + + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: classnames_default()('wp-block-image__crop-area', { + 'is-applying': isInProgress + }), + style: { + width: width || clientWidth, + height: editedHeight + } + }, (0,external_wp_element_namespaceObject.createElement)(index_module, { + image: editedUrl || url, + disabled: isInProgress, + minZoom: constants_MIN_ZOOM / 100, + maxZoom: constants_MAX_ZOOM / 100, + crop: position, + zoom: zoom / 100, + aspect: aspect, + onCropChange: setPosition, + onCropComplete: newCropPercent => { + setCrop(newCropPercent); + }, + onZoomChange: newZoom => { + setZoom(newZoom * 100); + } + }), isInProgress && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js + + +/** + * WordPress dependencies + */ + +const search = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z" +})); +/* harmony default export */ var library_search = (search); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/zoom-dropdown.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function ZoomDropdown() { + const { + isInProgress, + zoom, + setZoom + } = useImageEditingContext(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + contentClassName: "wp-block-image__zoom", + popoverProps: constants_POPOVER_PROPS, + renderToggle: _ref => { + let { + isOpen, + onToggle + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + icon: library_search, + label: (0,external_wp_i18n_namespaceObject.__)('Zoom'), + onClick: onToggle, + "aria-expanded": isOpen, + disabled: isInProgress + }); + }, + renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Zoom'), + min: constants_MIN_ZOOM, + max: constants_MAX_ZOOM, + value: Math.round(zoom), + onChange: setZoom + }) + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js + + +/** + * WordPress dependencies + */ + +const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" +})); +/* harmony default export */ var library_check = (check); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/aspect-ratio.js + + +/** + * WordPress dependencies + */ + +const aspectRatio = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" +})); +/* harmony default export */ var aspect_ratio = (aspectRatio); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/aspect-ratio-dropdown.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function AspectGroup(_ref) { + let { + aspectRatios, + isDisabled, + label, + onClick, + value + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { + label: label + }, aspectRatios.map(_ref2 => { + let { + title, + aspect + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + key: aspect, + disabled: isDisabled, + onClick: () => { + onClick(aspect); + }, + role: "menuitemradio", + isSelected: aspect === value, + icon: aspect === value ? library_check : undefined + }, title); + })); +} + +function AspectRatioDropdown(_ref3) { + let { + toggleProps + } = _ref3; + const { + isInProgress, + aspect, + setAspect, + defaultAspect + } = useImageEditingContext(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { + icon: aspect_ratio, + label: (0,external_wp_i18n_namespaceObject.__)('Aspect Ratio'), + popoverProps: constants_POPOVER_PROPS, + toggleProps: toggleProps, + className: "wp-block-image__aspect-ratio" + }, _ref4 => { + let { + onClose + } = _ref4; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AspectGroup, { + isDisabled: isInProgress, + onClick: newAspect => { + setAspect(newAspect); + onClose(); + }, + value: aspect, + aspectRatios: [{ + title: (0,external_wp_i18n_namespaceObject.__)('Original'), + aspect: defaultAspect + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Square'), + aspect: 1 + }] + }), (0,external_wp_element_namespaceObject.createElement)(AspectGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Landscape'), + isDisabled: isInProgress, + onClick: newAspect => { + setAspect(newAspect); + onClose(); + }, + value: aspect, + aspectRatios: [{ + title: (0,external_wp_i18n_namespaceObject.__)('16:10'), + aspect: 16 / 10 + }, { + title: (0,external_wp_i18n_namespaceObject.__)('16:9'), + aspect: 16 / 9 + }, { + title: (0,external_wp_i18n_namespaceObject.__)('4:3'), + aspect: 4 / 3 + }, { + title: (0,external_wp_i18n_namespaceObject.__)('3:2'), + aspect: 3 / 2 + }] + }), (0,external_wp_element_namespaceObject.createElement)(AspectGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Portrait'), + isDisabled: isInProgress, + onClick: newAspect => { + setAspect(newAspect); + onClose(); + }, + value: aspect, + aspectRatios: [{ + title: (0,external_wp_i18n_namespaceObject.__)('10:16'), + aspect: 10 / 16 + }, { + title: (0,external_wp_i18n_namespaceObject.__)('9:16'), + aspect: 9 / 16 + }, { + title: (0,external_wp_i18n_namespaceObject.__)('3:4'), + aspect: 3 / 4 + }, { + title: (0,external_wp_i18n_namespaceObject.__)('2:3'), + aspect: 2 / 3 + }] + })); + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rotate-right.js + + +/** + * WordPress dependencies + */ + +const rotateRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var rotate_right = (rotateRight); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/rotation-button.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function RotationButton() { + const { + isInProgress, + rotateClockwise + } = useImageEditingContext(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + icon: rotate_right, + label: (0,external_wp_i18n_namespaceObject.__)('Rotate'), + onClick: rotateClockwise, + disabled: isInProgress + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/form-controls.js + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function FormControls() { + const { + isInProgress, + apply, + cancel + } = useImageEditingContext(); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + onClick: apply, + disabled: isInProgress + }, (0,external_wp_i18n_namespaceObject.__)('Apply')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + onClick: cancel + }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/index.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + + + + +function ImageEditor(_ref) { + let { + url, + width, + height, + clientWidth, + naturalHeight, + naturalWidth + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ImageCropper, { + url: url, + width: width, + height: height, + clientWidth: clientWidth, + naturalHeight: naturalHeight, + naturalWidth: naturalWidth + }), (0,external_wp_element_namespaceObject.createElement)(block_controls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(ZoomDropdown, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, toggleProps => (0,external_wp_element_namespaceObject.createElement)(AspectRatioDropdown, { + toggleProps: toggleProps + })), (0,external_wp_element_namespaceObject.createElement)(RotationButton, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(FormControls, null)))); +} + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/use-dimension-handler.js +/** + * WordPress dependencies + */ + +function useDimensionHandler(customHeight, customWidth, defaultHeight, defaultWidth, onChange) { + var _ref, _ref2; + + const [currentWidth, setCurrentWidth] = (0,external_wp_element_namespaceObject.useState)((_ref = customWidth !== null && customWidth !== void 0 ? customWidth : defaultWidth) !== null && _ref !== void 0 ? _ref : ''); + const [currentHeight, setCurrentHeight] = (0,external_wp_element_namespaceObject.useState)((_ref2 = customHeight !== null && customHeight !== void 0 ? customHeight : defaultHeight) !== null && _ref2 !== void 0 ? _ref2 : ''); // When an image is first inserted, the default dimensions are initially + // undefined. This effect updates the dimensions when the default values + // come through. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (customWidth === undefined && defaultWidth !== undefined) { + setCurrentWidth(defaultWidth); + } + + if (customHeight === undefined && defaultHeight !== undefined) { + setCurrentHeight(defaultHeight); + } + }, [defaultWidth, defaultHeight]); // If custom values change, it means an outsider has resized the image using some other method (eg resize box) + // this keeps track of these values too. We need to parse before comparing; custom values can be strings. + + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (customWidth !== undefined && Number.parseInt(customWidth) !== Number.parseInt(currentWidth)) { + setCurrentWidth(customWidth); + } + + if (customHeight !== undefined && Number.parseInt(customHeight) !== Number.parseInt(currentHeight)) { + setCurrentHeight(customHeight); + } + }, [customWidth, customHeight]); + + const updateDimension = (dimension, value) => { + if (dimension === 'width') { + setCurrentWidth(value); } else { - if (!onlyScrollIfNeeded) { - alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; - if (alignWithLeft) { - util.scrollLeft(container, containerScroll.left + diffTop.left); - } else { - util.scrollLeft(container, containerScroll.left + diffBottom.left); - } + setCurrentHeight(value); + } + + onChange({ + [dimension]: value === '' ? undefined : parseInt(value, 10) + }); + }; + + const updateDimensions = (nextHeight, nextWidth) => { + setCurrentHeight(nextHeight !== null && nextHeight !== void 0 ? nextHeight : defaultHeight); + setCurrentWidth(nextWidth !== null && nextWidth !== void 0 ? nextWidth : defaultWidth); + onChange({ + height: nextHeight, + width: nextWidth + }); + }; + + return { + currentHeight, + currentWidth, + updateDimension, + updateDimensions + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +const IMAGE_SIZE_PRESETS = [25, 50, 75, 100]; +function ImageSizeControl(_ref) { + let { + imageWidth, + imageHeight, + imageSizeOptions = [], + isResizable = true, + slug, + width, + height, + onChange, + onChangeImage = external_lodash_namespaceObject.noop + } = _ref; + const { + currentHeight, + currentWidth, + updateDimension, + updateDimensions + } = useDimensionHandler(height, width, imageHeight, imageWidth, onChange); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !(0,external_lodash_namespaceObject.isEmpty)(imageSizeOptions) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Image size'), + value: slug, + options: imageSizeOptions, + onChange: onChangeImage + }), isResizable && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-image-size-control" + }, (0,external_wp_element_namespaceObject.createElement)("p", { + className: "block-editor-image-size-control__row" + }, (0,external_wp_i18n_namespaceObject.__)('Image dimensions')), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-image-size-control__row" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + type: "number", + className: "block-editor-image-size-control__width", + label: (0,external_wp_i18n_namespaceObject.__)('Width'), + value: currentWidth, + min: 1, + onChange: value => updateDimension('width', value) + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + type: "number", + className: "block-editor-image-size-control__height", + label: (0,external_wp_i18n_namespaceObject.__)('Height'), + value: currentHeight, + min: 1, + onChange: value => updateDimension('height', value) + })), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-image-size-control__row" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image size presets') + }, IMAGE_SIZE_PRESETS.map(scale => { + const scaledWidth = Math.round(imageWidth * (scale / 100)); + const scaledHeight = Math.round(imageHeight * (scale / 100)); + const isCurrent = currentWidth === scaledWidth && currentHeight === scaledHeight; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + key: scale, + isSmall: true, + variant: isCurrent ? 'primary' : undefined, + isPressed: isCurrent, + onClick: () => updateDimensions(scaledHeight, scaledWidth) + }, scale, "%"); + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + isSmall: true, + onClick: () => updateDimensions() + }, (0,external_wp_i18n_namespaceObject.__)('Reset'))))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js + + +/** + * WordPress dependencies + */ + +const keyboardReturn = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "-2 -2 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z" +})); +/* harmony default export */ var keyboard_return = (keyboardReturn); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/settings-drawer.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +const LinkControlSettingsDrawer = _ref => { + let { + value, + onChange = external_lodash_namespaceObject.noop, + settings + } = _ref; + + if (!settings || !settings.length) { + return null; + } + + const handleSettingChange = setting => newValue => { + onChange({ ...value, + [setting.id]: newValue + }); + }; + + const theSettings = settings.map(setting => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + className: "block-editor-link-control__setting", + key: setting.id, + label: setting.title, + onChange: handleSettingChange(setting), + checked: value ? !!value[setting.id] : false + })); + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "block-editor-link-control__settings" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "legend" + }, (0,external_wp_i18n_namespaceObject.__)('Currently selected link settings')), theSettings); +}; + +/* harmony default export */ var settings_drawer = (LinkControlSettingsDrawer); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-input/index.js + + + +/** + * External dependencies + */ + + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + +class URLInput extends external_wp_element_namespaceObject.Component { + constructor(props) { + super(props); + this.onChange = this.onChange.bind(this); + this.onFocus = this.onFocus.bind(this); + this.onKeyDown = this.onKeyDown.bind(this); + this.selectLink = this.selectLink.bind(this); + this.handleOnClick = this.handleOnClick.bind(this); + this.bindSuggestionNode = this.bindSuggestionNode.bind(this); + this.autocompleteRef = props.autocompleteRef || (0,external_wp_element_namespaceObject.createRef)(); + this.inputRef = (0,external_wp_element_namespaceObject.createRef)(); + this.updateSuggestions = (0,external_lodash_namespaceObject.debounce)(this.updateSuggestions.bind(this), 200); + this.suggestionNodes = []; + this.isUpdatingSuggestions = false; + this.state = { + suggestions: [], + showSuggestions: false, + selectedSuggestion: null, + suggestionsListboxId: '', + suggestionOptionIdPrefix: '' + }; + } + + componentDidUpdate(prevProps) { + const { + showSuggestions, + selectedSuggestion + } = this.state; + const { + value, + __experimentalShowInitialSuggestions = false + } = this.props; // only have to worry about scrolling selected suggestion into view + // when already expanded + + if (showSuggestions && selectedSuggestion !== null && this.suggestionNodes[selectedSuggestion] && !this.scrollingIntoView) { + this.scrollingIntoView = true; + lib_default()(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, { + onlyScrollIfNeeded: true + }); + this.props.setTimeout(() => { + this.scrollingIntoView = false; + }, 100); + } // Update suggestions when the value changes + + + if (prevProps.value !== value && !this.props.disableSuggestions && !this.isUpdatingSuggestions) { + if (value !== null && value !== void 0 && value.length) { + // If the new value is not empty we need to update with suggestions for it + this.updateSuggestions(value); + } else if (__experimentalShowInitialSuggestions) { + // If the new value is empty and we can show initial suggestions, then show initial suggestions + this.updateSuggestions(); } } } + + componentDidMount() { + if (this.shouldShowInitialSuggestions()) { + this.updateSuggestions(); + } + } + + componentWillUnmount() { + var _this$suggestionsRequ, _this$suggestionsRequ2; + + (_this$suggestionsRequ = this.suggestionsRequest) === null || _this$suggestionsRequ === void 0 ? void 0 : (_this$suggestionsRequ2 = _this$suggestionsRequ.cancel) === null || _this$suggestionsRequ2 === void 0 ? void 0 : _this$suggestionsRequ2.call(_this$suggestionsRequ); + delete this.suggestionsRequest; + } + + bindSuggestionNode(index) { + return ref => { + this.suggestionNodes[index] = ref; + }; + } + + shouldShowInitialSuggestions() { + const { + suggestions + } = this.state; + const { + __experimentalShowInitialSuggestions = false, + value + } = this.props; + return !this.isUpdatingSuggestions && __experimentalShowInitialSuggestions && !(value && value.length) && !(suggestions && suggestions.length); + } + + updateSuggestions() { + var _value; + + let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const { + __experimentalFetchLinkSuggestions: fetchLinkSuggestions, + __experimentalHandleURLSuggestions: handleURLSuggestions + } = this.props; + + if (!fetchLinkSuggestions) { + return; + } // Initial suggestions may only show if there is no value + // (note: this includes whitespace). + + + const isInitialSuggestions = !((_value = value) !== null && _value !== void 0 && _value.length); // Trim only now we've determined whether or not it originally had a "length" + // (even if that value was all whitespace). + + value = value.trim(); // Allow a suggestions request if: + // - there are at least 2 characters in the search input (except manual searches where + // search input length is not required to trigger a fetch) + // - this is a direct entry (eg: a URL) + + if (!isInitialSuggestions && (value.length < 2 || !handleURLSuggestions && (0,external_wp_url_namespaceObject.isURL)(value))) { + this.setState({ + showSuggestions: false, + selectedSuggestion: null, + loading: false + }); + return; + } + + this.isUpdatingSuggestions = true; + this.setState({ + selectedSuggestion: null, + loading: true + }); + const request = fetchLinkSuggestions(value, { + isInitialSuggestions + }); + request.then(suggestions => { + // A fetch Promise doesn't have an abort option. It's mimicked by + // comparing the request reference in on the instance, which is + // reset or deleted on subsequent requests or unmounting. + if (this.suggestionsRequest !== request) { + return; + } + + this.setState({ + suggestions, + loading: false, + showSuggestions: !!suggestions.length + }); + + if (!!suggestions.length) { + this.props.debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: number of results. */ + (0,external_wp_i18n_namespaceObject._n)('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', suggestions.length), suggestions.length), 'assertive'); + } else { + this.props.debouncedSpeak((0,external_wp_i18n_namespaceObject.__)('No results.'), 'assertive'); + } + + this.isUpdatingSuggestions = false; + }).catch(() => { + if (this.suggestionsRequest === request) { + this.setState({ + loading: false + }); + this.isUpdatingSuggestions = false; + } + }); // Note that this assignment is handled *before* the async search request + // as a Promise always resolves on the next tick of the event loop. + + this.suggestionsRequest = request; + } + + onChange(event) { + const inputValue = event.target.value; + this.props.onChange(inputValue); + + if (!this.props.disableSuggestions) { + this.updateSuggestions(inputValue); + } + } + + onFocus() { + const { + suggestions + } = this.state; + const { + disableSuggestions, + value + } = this.props; // When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value + // Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons) + + if (value && !disableSuggestions && !this.isUpdatingSuggestions && !(suggestions && suggestions.length)) { + // Ensure the suggestions are updated with the current input value + this.updateSuggestions(value); + } + } + + onKeyDown(event) { + const { + showSuggestions, + selectedSuggestion, + suggestions, + loading + } = this.state; // If the suggestions are not shown or loading, we shouldn't handle the arrow keys + // We shouldn't preventDefault to allow block arrow keys navigation + + if (!showSuggestions || !suggestions.length || loading) { + // In the Windows version of Firefox the up and down arrows don't move the caret + // within an input field like they do for Mac Firefox/Chrome/Safari. This causes + // a form of focus trapping that is disruptive to the user experience. This disruption + // only happens if the caret is not in the first or last position in the text input. + // See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747 + switch (event.keyCode) { + // When UP is pressed, if the caret is at the start of the text, move it to the 0 + // position. + case external_wp_keycodes_namespaceObject.UP: + { + if (0 !== event.target.selectionStart) { + event.preventDefault(); // Set the input caret to position 0 + + event.target.setSelectionRange(0, 0); + } + + break; + } + // When DOWN is pressed, if the caret is not at the end of the text, move it to the + // last position. + + case external_wp_keycodes_namespaceObject.DOWN: + { + if (this.props.value.length !== event.target.selectionStart) { + event.preventDefault(); // Set the input caret to the last position + + event.target.setSelectionRange(this.props.value.length, this.props.value.length); + } + + break; + } + // Submitting while loading should trigger onSubmit + + case external_wp_keycodes_namespaceObject.ENTER: + { + if (this.props.onSubmit) { + this.props.onSubmit(null, event); + } + + break; + } + } + + return; + } + + const suggestion = this.state.suggestions[this.state.selectedSuggestion]; + + switch (event.keyCode) { + case external_wp_keycodes_namespaceObject.UP: + { + event.preventDefault(); + const previousIndex = !selectedSuggestion ? suggestions.length - 1 : selectedSuggestion - 1; + this.setState({ + selectedSuggestion: previousIndex + }); + break; + } + + case external_wp_keycodes_namespaceObject.DOWN: + { + event.preventDefault(); + const nextIndex = selectedSuggestion === null || selectedSuggestion === suggestions.length - 1 ? 0 : selectedSuggestion + 1; + this.setState({ + selectedSuggestion: nextIndex + }); + break; + } + + case external_wp_keycodes_namespaceObject.TAB: + { + if (this.state.selectedSuggestion !== null) { + this.selectLink(suggestion); // Announce a link has been selected when tabbing away from the input field. + + this.props.speak((0,external_wp_i18n_namespaceObject.__)('Link selected.')); + } + + break; + } + + case external_wp_keycodes_namespaceObject.ENTER: + { + if (this.state.selectedSuggestion !== null) { + this.selectLink(suggestion); + + if (this.props.onSubmit) { + this.props.onSubmit(suggestion, event); + } + } else if (this.props.onSubmit) { + this.props.onSubmit(null, event); + } + + break; + } + } + } + + selectLink(suggestion) { + this.props.onChange(suggestion.url, suggestion); + this.setState({ + selectedSuggestion: null, + showSuggestions: false + }); + } + + handleOnClick(suggestion) { + this.selectLink(suggestion); // Move focus to the input field when a link suggestion is clicked. + + this.inputRef.current.focus(); + } + + static getDerivedStateFromProps(_ref, _ref2) { + let { + value, + instanceId, + disableSuggestions, + __experimentalShowInitialSuggestions = false + } = _ref; + let { + showSuggestions + } = _ref2; + let shouldShowSuggestions = showSuggestions; + const hasValue = value && value.length; + + if (!__experimentalShowInitialSuggestions && !hasValue) { + shouldShowSuggestions = false; + } + + if (disableSuggestions === true) { + shouldShowSuggestions = false; + } + + return { + showSuggestions: shouldShowSuggestions, + suggestionsListboxId: `block-editor-url-input-suggestions-${instanceId}`, + suggestionOptionIdPrefix: `block-editor-url-input-suggestion-${instanceId}` + }; + } + + render() { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, this.renderControl(), this.renderSuggestions()); + } + + renderControl() { + const { + label, + className, + isFullWidth, + instanceId, + placeholder = (0,external_wp_i18n_namespaceObject.__)('Paste URL or type to search'), + __experimentalRenderControl: renderControl, + value = '' + } = this.props; + const { + loading, + showSuggestions, + selectedSuggestion, + suggestionsListboxId, + suggestionOptionIdPrefix + } = this.state; + const controlProps = { + id: `url-input-control-${instanceId}`, + label, + className: classnames_default()('block-editor-url-input', className, { + 'is-full-width': isFullWidth + }) + }; + const inputProps = { + value, + required: true, + className: 'block-editor-url-input__input', + type: 'text', + onChange: this.onChange, + onFocus: this.onFocus, + placeholder, + onKeyDown: this.onKeyDown, + role: 'combobox', + 'aria-label': (0,external_wp_i18n_namespaceObject.__)('URL'), + 'aria-expanded': showSuggestions, + 'aria-autocomplete': 'list', + 'aria-owns': suggestionsListboxId, + 'aria-activedescendant': selectedSuggestion !== null ? `${suggestionOptionIdPrefix}-${selectedSuggestion}` : undefined, + ref: this.inputRef + }; + + if (renderControl) { + return renderControl(controlProps, inputProps, loading); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, controlProps, (0,external_wp_element_namespaceObject.createElement)("input", inputProps), loading && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)); + } + + renderSuggestions() { + const { + className, + __experimentalRenderSuggestions: renderSuggestions, + value = '', + __experimentalShowInitialSuggestions = false + } = this.props; + const { + showSuggestions, + suggestions, + selectedSuggestion, + suggestionsListboxId, + suggestionOptionIdPrefix, + loading + } = this.state; + const suggestionsListProps = { + id: suggestionsListboxId, + ref: this.autocompleteRef, + role: 'listbox' + }; + + const buildSuggestionItemProps = (suggestion, index) => { + return { + role: 'option', + tabIndex: '-1', + id: `${suggestionOptionIdPrefix}-${index}`, + ref: this.bindSuggestionNode(index), + 'aria-selected': index === selectedSuggestion + }; + }; + + if ((0,external_lodash_namespaceObject.isFunction)(renderSuggestions) && showSuggestions && !!suggestions.length) { + return renderSuggestions({ + suggestions, + selectedSuggestion, + suggestionsListProps, + buildSuggestionItemProps, + isLoading: loading, + handleSuggestionClick: this.handleOnClick, + isInitialSuggestions: __experimentalShowInitialSuggestions && !(value && value.length) + }); + } + + if (!(0,external_lodash_namespaceObject.isFunction)(renderSuggestions) && showSuggestions && !!suggestions.length) { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { + position: "bottom", + noArrow: true, + focusOnMount: false + }, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, suggestionsListProps, { + className: classnames_default()('block-editor-url-input__suggestions', `${className}__suggestions`) + }), suggestions.map((suggestion, index) => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, buildSuggestionItemProps(suggestion, index), { + key: suggestion.id, + className: classnames_default()('block-editor-url-input__suggestion', { + 'is-selected': index === selectedSuggestion + }), + onClick: () => this.handleOnClick(suggestion) + }), suggestion.title)))); + } + + return null; + } + +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md + */ + + +/* harmony default export */ var url_input = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.withSafeTimeout, external_wp_components_namespaceObject.withSpokenMessages, external_wp_compose_namespaceObject.withInstanceId, (0,external_wp_data_namespaceObject.withSelect)((select, props) => { + // If a link suggestions handler is already provided then + // bail + if ((0,external_lodash_namespaceObject.isFunction)(props.__experimentalFetchLinkSuggestions)) { + return; + } + + const { + getSettings + } = select(store); + return { + __experimentalFetchLinkSuggestions: getSettings().__experimentalFetchLinkSuggestions + }; +}))(URLInput)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-create-button.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + +const LinkControlSearchCreate = _ref => { + let { + searchTerm, + onClick, + itemProps, + isSelected, + buttonText + } = _ref; + + if (!searchTerm) { + return null; + } + + let text; + + if (buttonText) { + text = (0,external_lodash_namespaceObject.isFunction)(buttonText) ? buttonText(searchTerm) : buttonText; + } else { + text = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: search term. */ + (0,external_wp_i18n_namespaceObject.__)('Create: %s'), searchTerm), { + mark: (0,external_wp_element_namespaceObject.createElement)("mark", null) + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, itemProps, { + className: classnames_default()('block-editor-link-control__search-create block-editor-link-control__search-item', { + 'is-selected': isSelected + }), + onClick: onClick + }), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + className: "block-editor-link-control__search-item-icon", + icon: library_plus + }), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-header" + }, (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-title" + }, text))); +}; +/* harmony default export */ var search_create_button = (LinkControlSearchCreate); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/globe.js + + +/** + * WordPress dependencies + */ + +const globe = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var library_globe = (globe); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-item.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +const LinkControlSearchItem = _ref => { + let { + itemProps, + suggestion, + isSelected = false, + onClick, + isURL = false, + searchTerm = '', + shouldShowType = false + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, itemProps, { + onClick: onClick, + className: classnames_default()('block-editor-link-control__search-item', { + 'is-selected': isSelected, + 'is-url': isURL, + 'is-entity': !isURL + }) + }), isURL && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + className: "block-editor-link-control__search-item-icon", + icon: library_globe + }), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-header" + }, (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-title" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextHighlight, { + text: suggestion.title, + highlight: searchTerm + })), (0,external_wp_element_namespaceObject.createElement)("span", { + "aria-hidden": !isURL, + className: "block-editor-link-control__search-item-info" + }, !isURL && ((0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(suggestion.url)) || ''), isURL && (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link'))), shouldShowType && suggestion.type && (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-type" + }, suggestion.type === 'post_tag' ? 'tag' : suggestion.type)); +}; +/* harmony default export */ var search_item = (LinkControlSearchItem); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/constants.js +/** + * WordPress dependencies + */ + // Used as a unique identifier for the "Create" option within search results. +// Used to help distinguish the "Create" suggestion within the search results in +// order to handle it as a unique case. + +const CREATE_TYPE = '__CREATE__'; +const DEFAULT_LINK_SETTINGS = [{ + id: 'opensInNewTab', + title: (0,external_wp_i18n_namespaceObject.__)('Open in new tab') +}]; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-results.js + + +/** + * WordPress dependencies + */ + + +/** + * External dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function LinkControlSearchResults(_ref) { + let { + instanceId, + withCreateSuggestion, + currentInputValue, + handleSuggestionClick, + suggestionsListProps, + buildSuggestionItemProps, + suggestions, + selectedSuggestion, + isLoading, + isInitialSuggestions, + createSuggestionButtonText, + suggestionsQuery + } = _ref; + const resultsListClasses = classnames_default()('block-editor-link-control__search-results', { + 'is-loading': isLoading + }); + const directLinkEntryTypes = ['url', 'mailto', 'tel', 'internal']; + const isSingleDirectEntryResult = suggestions.length === 1 && directLinkEntryTypes.includes(suggestions[0].type.toLowerCase()); + const shouldShowCreateSuggestion = withCreateSuggestion && !isSingleDirectEntryResult && !isInitialSuggestions; // If the query has a specified type, then we can skip showing them in the result. See #24839. + + const shouldShowSuggestionsTypes = !(suggestionsQuery !== null && suggestionsQuery !== void 0 && suggestionsQuery.type); // According to guidelines aria-label should be added if the label + // itself is not visible. + // See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role + + const searchResultsLabelId = `block-editor-link-control-search-results-label-${instanceId}`; + const labelText = isInitialSuggestions ? (0,external_wp_i18n_namespaceObject.__)('Recently updated') : (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: search term. */ + (0,external_wp_i18n_namespaceObject.__)('Search results for "%s"'), currentInputValue); // VisuallyHidden rightly doesn't accept custom classNames + // so we conditionally render it as a wrapper to visually hide the label + // when that is required. + + const searchResultsLabel = (0,external_wp_element_namespaceObject.createElement)(isInitialSuggestions ? external_wp_element_namespaceObject.Fragment : external_wp_components_namespaceObject.VisuallyHidden, {}, // empty props + (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-results-label", + id: searchResultsLabelId + }, labelText)); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-link-control__search-results-wrapper" + }, searchResultsLabel, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, suggestionsListProps, { + className: resultsListClasses, + "aria-labelledby": searchResultsLabelId + }), suggestions.map((suggestion, index) => { + if (shouldShowCreateSuggestion && CREATE_TYPE === suggestion.type) { + return (0,external_wp_element_namespaceObject.createElement)(search_create_button, { + searchTerm: currentInputValue, + buttonText: createSuggestionButtonText, + onClick: () => handleSuggestionClick(suggestion) // Intentionally only using `type` here as + // the constant is enough to uniquely + // identify the single "CREATE" suggestion. + , + key: suggestion.type, + itemProps: buildSuggestionItemProps(suggestion, index), + isSelected: index === selectedSuggestion + }); + } // If we're not handling "Create" suggestions above then + // we don't want them in the main results so exit early + + + if (CREATE_TYPE === suggestion.type) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(search_item, { + key: `${suggestion.id}-${suggestion.type}`, + itemProps: buildSuggestionItemProps(suggestion, index), + suggestion: suggestion, + index: index, + onClick: () => { + handleSuggestionClick(suggestion); + }, + isSelected: index === selectedSuggestion, + isURL: directLinkEntryTypes.includes(suggestion.type.toLowerCase()), + searchTerm: currentInputValue, + shouldShowType: shouldShowSuggestionsTypes + }); + }))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/is-url-like.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Determines whether a given value could be a URL. Note this does not + * guarantee the value is a URL only that it looks like it might be one. For + * example, just because a string has `www.` in it doesn't make it a URL, + * but it does make it highly likely that it will be so in the context of + * creating a link it makes sense to treat it like one. + * + * @param {string} val the candidate for being URL-like (or not). + * + * @return {boolean} whether or not the value is potentially a URL. + */ + +function isURLLike(val) { + const isInternal = (0,external_lodash_namespaceObject.startsWith)(val, '#'); + return (0,external_wp_url_namespaceObject.isURL)(val) || val && val.includes('www.') || isInternal; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-search-handler.js +/** + * WordPress dependencies + */ + + + +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const handleNoop = () => Promise.resolve([]); +const handleDirectEntry = val => { + let type = 'URL'; + const protocol = (0,external_wp_url_namespaceObject.getProtocol)(val) || ''; + + if (protocol.includes('mailto')) { + type = 'mailto'; + } + + if (protocol.includes('tel')) { + type = 'tel'; + } + + if ((0,external_lodash_namespaceObject.startsWith)(val, '#')) { + type = 'internal'; + } + + return Promise.resolve([{ + id: val, + title: val, + url: type === 'URL' ? (0,external_wp_url_namespaceObject.prependHTTP)(val) : val, + type + }]); +}; + +const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion) => { + const { + isInitialSuggestions + } = suggestionsQuery; + let results = await Promise.all([fetchSearchSuggestions(val, suggestionsQuery), directEntryHandler(val)]); + const couldBeURL = !val.includes(' '); // If it's potentially a URL search then concat on a URL search suggestion + // just for good measure. That way once the actual results run out we always + // have a URL option to fallback on. + + if (couldBeURL && withURLSuggestion && !isInitialSuggestions) { + results = results[0].concat(results[1]); + } else { + results = results[0]; + } // If displaying initial suggestions just return plain results. + + + if (isInitialSuggestions) { + return results; + } // Here we append a faux suggestion to represent a "CREATE" option. This + // is detected in the rendering of the search results and handled as a + // special case. This is currently necessary because the suggestions + // dropdown will only appear if there are valid suggestions and + // therefore unless the create option is a suggestion it will not + // display in scenarios where there are no results returned from the + // API. In addition promoting CREATE to a first class suggestion affords + // the a11y benefits afforded by `URLInput` to all suggestions (eg: + // keyboard handling, ARIA roles...etc). + // + // Note also that the value of the `title` and `url` properties must correspond + // to the text value of the ``. This is because `title` is used + // when creating the suggestion. Similarly `url` is used when using keyboard to select + // the suggestion (the `onSubmit` handler falls-back to `url`). + + + return isURLLike(val) || !withCreateSuggestion ? results : results.concat({ + // the `id` prop is intentionally ommitted here because it + // is never exposed as part of the component's public API. + // see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316. + title: val, + // must match the existing ``s text value + url: val, + // must match the existing ``s text value + type: CREATE_TYPE + }); +}; + +function useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion, withURLSuggestion) { + const { + fetchSearchSuggestions + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = select(store); + return { + fetchSearchSuggestions: getSettings().__experimentalFetchLinkSuggestions + }; + }, []); + const directEntryHandler = allowDirectEntry ? handleDirectEntry : handleNoop; + return (0,external_wp_element_namespaceObject.useCallback)((val, _ref) => { + let { + isInitialSuggestions + } = _ref; + return isURLLike(val) ? directEntryHandler(val, { + isInitialSuggestions + }) : handleEntitySearch(val, { ...suggestionsQuery, + isInitialSuggestions + }, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion); + }, [directEntryHandler, fetchSearchSuggestions, withCreateSuggestion]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-input.js + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + // Must be a function as otherwise URLInput will default +// to the fetchLinkSuggestions passed in block editor settings +// which will cause an unintended http request. + +const noopSearchHandler = () => Promise.resolve([]); + +const LinkControlSearchInput = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => { + let { + value, + children, + currentLink = {}, + className = null, + placeholder = null, + withCreateSuggestion = false, + onCreateSuggestion = external_lodash_namespaceObject.noop, + onChange = external_lodash_namespaceObject.noop, + onSelect = external_lodash_namespaceObject.noop, + showSuggestions = true, + renderSuggestions = props => (0,external_wp_element_namespaceObject.createElement)(LinkControlSearchResults, props), + fetchSuggestions = null, + allowDirectEntry = true, + showInitialSuggestions = false, + suggestionsQuery = {}, + withURLSuggestion = true, + createSuggestionButtonText, + useLabel = false + } = _ref; + const genericSearchHandler = useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion, withURLSuggestion); + const searchHandler = showSuggestions ? fetchSuggestions || genericSearchHandler : noopSearchHandler; + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkControlSearchInput); + const [focusedSuggestion, setFocusedSuggestion] = (0,external_wp_element_namespaceObject.useState)(); + /** + * Handles the user moving between different suggestions. Does not handle + * choosing an individual item. + * + * @param {string} selection the url of the selected suggestion. + * @param {Object} suggestion the suggestion object. + */ + + const onInputChange = (selection, suggestion) => { + onChange(selection); + setFocusedSuggestion(suggestion); + }; + + const handleRenderSuggestions = props => renderSuggestions({ ...props, + instanceId, + withCreateSuggestion, + currentInputValue: value, + createSuggestionButtonText, + suggestionsQuery, + handleSuggestionClick: suggestion => { + if (props.handleSuggestionClick) { + props.handleSuggestionClick(suggestion); + } + + onSuggestionSelected(suggestion); + } + }); + + const onSuggestionSelected = async selectedSuggestion => { + let suggestion = selectedSuggestion; + + if (CREATE_TYPE === selectedSuggestion.type) { + // Create a new page and call onSelect with the output from the onCreateSuggestion callback + try { + var _suggestion; + + suggestion = await onCreateSuggestion(selectedSuggestion.title); + + if ((_suggestion = suggestion) !== null && _suggestion !== void 0 && _suggestion.url) { + onSelect(suggestion); + } + } catch (e) {} + + return; + } + + if (allowDirectEntry || suggestion && Object.keys(suggestion).length >= 1) { + onSelect( // Some direct entries don't have types or IDs, and we still need to clear the previous ones. + { ...(0,external_lodash_namespaceObject.omit)(currentLink, 'id', 'url'), + ...suggestion + }, suggestion); + } + }; + + const inputClasses = classnames_default()(className, { + 'has-no-label': !useLabel + }); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-link-control__search-input-container" + }, (0,external_wp_element_namespaceObject.createElement)(url_input, { + label: useLabel ? 'URL' : undefined, + className: inputClasses, + value: value, + onChange: onInputChange, + placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : (0,external_wp_i18n_namespaceObject.__)('Search or type url'), + __experimentalRenderSuggestions: showSuggestions ? handleRenderSuggestions : null, + __experimentalFetchLinkSuggestions: searchHandler, + __experimentalHandleURLSuggestions: true, + __experimentalShowInitialSuggestions: showInitialSuggestions, + onSubmit: (suggestion, event) => { + var _value$trim; + + const hasSuggestion = suggestion || focusedSuggestion; // If there is no suggestion and the value (ie: any manually entered URL) is empty + // then don't allow submission otherwise we get empty links. + + if (!hasSuggestion && !(value !== null && value !== void 0 && (_value$trim = value.trim()) !== null && _value$trim !== void 0 && _value$trim.length)) { + event.preventDefault(); + } else { + onSuggestionSelected(hasSuggestion || { + url: value + }); + } + }, + ref: ref + }), children); +}); +/* harmony default export */ var search_input = (LinkControlSearchInput); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/info.js + + +/** + * WordPress dependencies + */ + +const info = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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" +})); +/* harmony default export */ var library_info = (info); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js + + +/** + * WordPress dependencies + */ + +const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z" +})); +/* harmony default export */ var library_pencil = (pencil); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js +/** + * Internal dependencies + */ + +/* harmony default export */ var library_edit = (library_pencil); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/viewer-slot.js +/** + * WordPress dependencies + */ + +const { + Slot: ViewerSlot, + Fill: ViewerFill +} = (0,external_wp_components_namespaceObject.createSlotFill)('BlockEditorLinkControlViewer'); + +/* harmony default export */ var viewer_slot = ((/* unused pure expression or super */ null && (ViewerSlot))); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-rich-url-data.js +/** + * Internal dependencies + */ + +/** + * WordPress dependencies + */ + + + + +function use_rich_url_data_reducer(state, action) { + switch (action.type) { + case 'RESOLVED': + return { ...state, + isFetching: false, + richData: action.richData + }; + + case 'ERROR': + return { ...state, + isFetching: false, + richData: null + }; + + case 'LOADING': + return { ...state, + isFetching: true + }; + + default: + throw new Error(`Unexpected action type ${action.type}`); + } } -module.exports = scrollIntoView; +function useRemoteUrlData(url) { + const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(use_rich_url_data_reducer, { + richData: null, + isFetching: false + }); + const { + fetchRichUrlData + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = select(store); + return { + fetchRichUrlData: getSettings().__experimentalFetchRichUrlData + }; + }, []); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // Only make the request if we have an actual URL + // and the fetching util is available. In some editors + // there may not be such a util. + if (url !== null && url !== void 0 && url.length && fetchRichUrlData && typeof AbortController !== 'undefined') { + dispatch({ + type: 'LOADING' + }); + const controller = new window.AbortController(); + const signal = controller.signal; + fetchRichUrlData(url, { + signal + }).then(urlData => { + dispatch({ + type: 'RESOLVED', + richData: urlData + }); + }).catch(() => { + // Avoid setting state on unmounted component + if (!signal.aborted) { + dispatch({ + type: 'ERROR' + }); + } + }); // Cleanup: when the URL changes the abort the current request -/***/ }) + return () => { + controller.abort(); + }; + } + }, [url]); + return state; +} -/******/ }); \ No newline at end of file +/* harmony default export */ var use_rich_url_data = (useRemoteUrlData); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/link-preview.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +function LinkPreview(_ref) { + var _value$url; + + let { + value, + onEditClick, + hasRichPreviews = false, + hasUnlinkControl = false, + onRemove + } = _ref; + // Avoid fetching if rich previews are not desired. + const showRichPreviews = hasRichPreviews ? value === null || value === void 0 ? void 0 : value.url : null; + const { + richData, + isFetching + } = use_rich_url_data(showRichPreviews); // Rich data may be an empty object so test for that. + + const hasRichData = richData && Object.keys(richData).length; + const displayURL = value && (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(value.url), 16) || ''; + const displayTitle = (richData === null || richData === void 0 ? void 0 : richData.title) || (value === null || value === void 0 ? void 0 : value.title) || displayURL; // url can be undefined if the href attribute is unset + + const isEmptyURL = !(value !== null && value !== void 0 && (_value$url = value.url) !== null && _value$url !== void 0 && _value$url.length); + let icon; + + if (richData !== null && richData !== void 0 && richData.icon) { + icon = (0,external_wp_element_namespaceObject.createElement)("img", { + src: richData === null || richData === void 0 ? void 0 : richData.icon, + alt: "" + }); + } else if (isEmptyURL) { + icon = (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: library_info, + size: 32 + }); + } else { + icon = (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: library_globe + }); + } + + return (0,external_wp_element_namespaceObject.createElement)("div", { + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Currently selected'), + "aria-selected": "true", + className: classnames_default()('block-editor-link-control__search-item', { + 'is-current': true, + 'is-rich': hasRichData, + 'is-fetching': !!isFetching, + 'is-preview': true, + 'is-error': isEmptyURL + }) + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-link-control__search-item-top" + }, (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-header" + }, (0,external_wp_element_namespaceObject.createElement)("span", { + className: classnames_default()('block-editor-link-control__search-item-icon', { + 'is-image': richData === null || richData === void 0 ? void 0 : richData.icon + }) + }, icon), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-details" + }, !isEmptyURL ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { + className: "block-editor-link-control__search-item-title", + href: value.url + }, (0,external_wp_dom_namespaceObject.__unstableStripHTML)(displayTitle)), (value === null || value === void 0 ? void 0 : value.url) && (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-info" + }, displayURL)) : (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-link-control__search-item-error-notice" + }, "Link is empty"))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: library_edit, + label: (0,external_wp_i18n_namespaceObject.__)('Edit'), + className: "block-editor-link-control__search-item-action", + onClick: onEditClick, + iconSize: 24 + }), hasUnlinkControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: link_off, + label: (0,external_wp_i18n_namespaceObject.__)('Unlink'), + className: "block-editor-link-control__search-item-action block-editor-link-control__unlink", + onClick: onRemove, + iconSize: 24 + }), (0,external_wp_element_namespaceObject.createElement)(ViewerSlot, { + fillProps: value + })), (hasRichData && ((richData === null || richData === void 0 ? void 0 : richData.image) || (richData === null || richData === void 0 ? void 0 : richData.description)) || isFetching) && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-link-control__search-item-bottom" + }, ((richData === null || richData === void 0 ? void 0 : richData.image) || isFetching) && (0,external_wp_element_namespaceObject.createElement)("div", { + "aria-hidden": !(richData !== null && richData !== void 0 && richData.image), + className: classnames_default()('block-editor-link-control__search-item-image', { + 'is-placeholder': !(richData !== null && richData !== void 0 && richData.image) + }) + }, (richData === null || richData === void 0 ? void 0 : richData.image) && (0,external_wp_element_namespaceObject.createElement)("img", { + src: richData === null || richData === void 0 ? void 0 : richData.image, + alt: "" + })), ((richData === null || richData === void 0 ? void 0 : richData.description) || isFetching) && (0,external_wp_element_namespaceObject.createElement)("div", { + "aria-hidden": !(richData !== null && richData !== void 0 && richData.description), + className: classnames_default()('block-editor-link-control__search-item-description', { + 'is-placeholder': !(richData !== null && richData !== void 0 && richData.description) + }) + }, (richData === null || richData === void 0 ? void 0 : richData.description) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, { + truncate: true, + numberOfLines: "2" + }, richData.description)))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-create-page.js +/** + * WordPress dependencies + */ + + +function useCreatePage(handleCreatePage) { + const cancelableCreateSuggestion = (0,external_wp_element_namespaceObject.useRef)(); + const [isCreatingPage, setIsCreatingPage] = (0,external_wp_element_namespaceObject.useState)(false); + const [errorMessage, setErrorMessage] = (0,external_wp_element_namespaceObject.useState)(null); + + const createPage = async function (suggestionTitle) { + setIsCreatingPage(true); + setErrorMessage(null); + + try { + // Make cancellable in order that we can avoid setting State + // if the component unmounts during the call to `createSuggestion` + cancelableCreateSuggestion.current = makeCancelable( // Using Promise.resolve to allow createSuggestion to return a + // non-Promise based value. + Promise.resolve(handleCreatePage(suggestionTitle))); + return await cancelableCreateSuggestion.current.promise; + } catch (error) { + if (error && error.isCanceled) { + return; // bail if canceled to avoid setting state + } + + setErrorMessage(error.message || (0,external_wp_i18n_namespaceObject.__)('An unknown error occurred during creation. Please try again.')); + throw error; + } finally { + setIsCreatingPage(false); + } + }; + /** + * Handles cancelling any pending Promises that have been made cancelable. + */ + + + (0,external_wp_element_namespaceObject.useEffect)(() => { + return () => { + // componentDidUnmount + if (cancelableCreateSuggestion.current) { + cancelableCreateSuggestion.current.cancel(); + } + }; + }, []); + return { + createPage, + isCreatingPage, + errorMessage + }; +} +/** + * Creates a wrapper around a promise which allows it to be programmatically + * cancelled. + * See: https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html + * + * @param {Promise} promise the Promise to make cancelable + */ + +const makeCancelable = promise => { + let hasCanceled_ = false; + const wrappedPromise = new Promise((resolve, reject) => { + promise.then(val => hasCanceled_ ? reject({ + isCanceled: true + }) : resolve(val), error => hasCanceled_ ? reject({ + isCanceled: true + }) : reject(error)); + }); + return { + promise: wrappedPromise, + + cancel() { + hasCanceled_ = true; + } + + }; +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/index.js + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + + +/** + * Default properties associated with a link control value. + * + * @typedef WPLinkControlDefaultValue + * + * @property {string} url Link URL. + * @property {string=} title Link title. + * @property {boolean=} opensInNewTab Whether link should open in a new browser + * tab. This value is only assigned if not + * providing a custom `settings` prop. + */ + +/* eslint-disable jsdoc/valid-types */ + +/** + * Custom settings values associated with a link. + * + * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue + */ + +/* eslint-enable */ + +/** + * Custom settings values associated with a link. + * + * @typedef WPLinkControlSetting + * + * @property {string} id Identifier to use as property for setting value. + * @property {string} title Human-readable label to show in user interface. + */ + +/** + * Properties associated with a link control value, composed as a union of the + * default properties and any custom settings values. + * + * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue + */ + +/** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */ + +/** + * Properties associated with a search suggestion used within the LinkControl. + * + * @typedef WPLinkControlSuggestion + * + * @property {string} id Identifier to use to uniquely identify the suggestion. + * @property {string} type Identifies the type of the suggestion (eg: `post`, + * `page`, `url`...etc) + * @property {string} title Human-readable label to show in user interface. + * @property {string} url A URL for the suggestion. + */ + +/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */ + +/** + * @typedef WPLinkControlProps + * + * @property {(WPLinkControlSetting[])=} settings An array of settings objects. Each object will used to + * render a `ToggleControl` for that setting. + * @property {boolean=} forceIsEditingLink If passed as either `true` or `false`, controls the + * internal editing state of the component to respective + * show or not show the URL input field. + * @property {WPLinkControlValue=} value Current link value. + * @property {WPLinkControlOnChangeProp=} onChange Value change handler, called with the updated value if + * the user selects a new link or updates settings. + * @property {boolean=} noDirectEntry Whether to allow turning a URL-like search query directly into a link. + * @property {boolean=} showSuggestions Whether to present suggestions when typing the URL. + * @property {boolean=} showInitialSuggestions Whether to present initial suggestions immediately. + * @property {boolean=} withCreateSuggestion Whether to allow creation of link value from suggestion. + * @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions. + * @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL. + * @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion. + * @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component. + */ + +/** + * Renders a link control. A link control is a controlled input which maintains + * a value associated with a link (HTML anchor element) and relevant settings + * for how that link is expected to behave. + * + * @param {WPLinkControlProps} props Component props. + */ + +function LinkControl(_ref) { + var _currentInputValue$tr, _value$url, _value$url$trim; + + let { + searchInputPlaceholder, + value, + settings = DEFAULT_LINK_SETTINGS, + onChange = external_lodash_namespaceObject.noop, + onRemove, + noDirectEntry = false, + showSuggestions = true, + showInitialSuggestions, + forceIsEditingLink, + createSuggestion, + withCreateSuggestion, + inputValue: propInputValue = '', + suggestionsQuery = {}, + noURLSuggestion = false, + createSuggestionButtonText, + hasRichPreviews = false, + hasTextControl = false, + renderControlBottom = null + } = _ref; + + if (withCreateSuggestion === undefined && createSuggestion) { + withCreateSuggestion = true; + } + + const isMounting = (0,external_wp_element_namespaceObject.useRef)(true); + const wrapperNode = (0,external_wp_element_namespaceObject.useRef)(); + const textInputRef = (0,external_wp_element_namespaceObject.useRef)(); + const [internalInputValue, setInternalInputValue] = (0,external_wp_element_namespaceObject.useState)((value === null || value === void 0 ? void 0 : value.url) || ''); + const [internalTextValue, setInternalTextValue] = (0,external_wp_element_namespaceObject.useState)((value === null || value === void 0 ? void 0 : value.title) || ''); + const currentInputValue = propInputValue || internalInputValue; + const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(forceIsEditingLink !== undefined ? forceIsEditingLink : !value || !value.url); + const isEndingEditWithFocus = (0,external_wp_element_namespaceObject.useRef)(false); + const currentInputIsEmpty = !(currentInputValue !== null && currentInputValue !== void 0 && (_currentInputValue$tr = currentInputValue.trim()) !== null && _currentInputValue$tr !== void 0 && _currentInputValue$tr.length); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (forceIsEditingLink !== undefined && forceIsEditingLink !== isEditingLink) { + setIsEditingLink(forceIsEditingLink); + } + }, [forceIsEditingLink]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // We don't auto focus into the Link UI on mount + // because otherwise using the keyboard to select text + // *within* the link format is not possible. + if (isMounting.current) { + isMounting.current = false; + return; + } // Unless we are mounting, we always want to focus either: + // - the URL input + // - the first focusable element in the Link UI. + // But in editing mode if there is a text input present then + // the URL input is at index 1. If not then it is at index 0. + + + const whichFocusTargetIndex = textInputRef !== null && textInputRef !== void 0 && textInputRef.current ? 1 : 0; // Scenario - when: + // - switching between editable and non editable LinkControl + // - clicking on a link + // ...then move focus to the *first* element to avoid focus loss + // and to ensure focus is *within* the Link UI. + + const nextFocusTarget = external_wp_dom_namespaceObject.focus.focusable.find(wrapperNode.current)[whichFocusTargetIndex] || wrapperNode.current; + nextFocusTarget.focus(); + isEndingEditWithFocus.current = false; + }, [isEditingLink]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + /** + * If the value's `text` property changes then sync this + * back up with state. + */ + if (value !== null && value !== void 0 && value.title && value.title !== internalTextValue) { + setInternalTextValue(value.title); + } + /** + * Update the state value internalInputValue if the url value changes + * for example when clicking on another anchor + */ + + + if (value !== null && value !== void 0 && value.url) { + setInternalInputValue(value.url); + } + }, [value]); + /** + * Cancels editing state and marks that focus may need to be restored after + * the next render, if focus was within the wrapper when editing finished. + */ + + function stopEditing() { + var _wrapperNode$current; + + isEndingEditWithFocus.current = !!((_wrapperNode$current = wrapperNode.current) !== null && _wrapperNode$current !== void 0 && _wrapperNode$current.contains(wrapperNode.current.ownerDocument.activeElement)); + setIsEditingLink(false); + } + + const { + createPage, + isCreatingPage, + errorMessage + } = useCreatePage(createSuggestion); + + const handleSelectSuggestion = updatedValue => { + onChange({ ...updatedValue, + title: internalTextValue || (updatedValue === null || updatedValue === void 0 ? void 0 : updatedValue.title) + }); + stopEditing(); + }; + + const handleSubmit = () => { + if (currentInputValue !== (value === null || value === void 0 ? void 0 : value.url) || internalTextValue !== (value === null || value === void 0 ? void 0 : value.title)) { + onChange({ + url: currentInputValue, + title: internalTextValue + }); + } + + stopEditing(); + }; + + const handleSubmitWithEnter = event => { + const { + keyCode + } = event; + + if (keyCode === external_wp_keycodes_namespaceObject.ENTER && !currentInputIsEmpty // disallow submitting empty values. + ) { + event.preventDefault(); + handleSubmit(); + } + }; + + const shownUnlinkControl = onRemove && value && !isEditingLink && !isCreatingPage; + const showSettingsDrawer = !!(settings !== null && settings !== void 0 && settings.length); // Only show text control once a URL value has been committed + // and it isn't just empty whitespace. + // See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927. + + const showTextControl = (value === null || value === void 0 ? void 0 : (_value$url = value.url) === null || _value$url === void 0 ? void 0 : (_value$url$trim = _value$url.trim()) === null || _value$url$trim === void 0 ? void 0 : _value$url$trim.length) > 0 && hasTextControl; + return (0,external_wp_element_namespaceObject.createElement)("div", { + tabIndex: -1, + ref: wrapperNode, + className: "block-editor-link-control" + }, isCreatingPage && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-link-control__loading" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), " ", (0,external_wp_i18n_namespaceObject.__)('Creating'), "\u2026"), (isEditingLink || !value) && !isCreatingPage && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", { + className: classnames_default()({ + 'block-editor-link-control__search-input-wrapper': true, + 'has-text-control': showTextControl + }) + }, showTextControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + ref: textInputRef, + className: "block-editor-link-control__field block-editor-link-control__text-content", + label: "Text", + value: internalTextValue, + onChange: setInternalTextValue, + onKeyDown: handleSubmitWithEnter + }), (0,external_wp_element_namespaceObject.createElement)(search_input, { + currentLink: value, + className: "block-editor-link-control__field block-editor-link-control__search-input", + placeholder: searchInputPlaceholder, + value: currentInputValue, + withCreateSuggestion: withCreateSuggestion, + onCreateSuggestion: createPage, + onChange: setInternalInputValue, + onSelect: handleSelectSuggestion, + showInitialSuggestions: showInitialSuggestions, + allowDirectEntry: !noDirectEntry, + showSuggestions: showSuggestions, + suggestionsQuery: suggestionsQuery, + withURLSuggestion: !noURLSuggestion, + createSuggestionButtonText: createSuggestionButtonText, + useLabel: showTextControl + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-link-control__search-actions" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + onClick: handleSubmit, + label: (0,external_wp_i18n_namespaceObject.__)('Submit'), + icon: keyboard_return, + className: "block-editor-link-control__search-submit", + disabled: currentInputIsEmpty // disallow submitting empty values. + + })))), errorMessage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { + className: "block-editor-link-control__search-error", + status: "error", + isDismissible: false + }, errorMessage)), value && !isEditingLink && !isCreatingPage && (0,external_wp_element_namespaceObject.createElement)(LinkPreview, { + key: value === null || value === void 0 ? void 0 : value.url // force remount when URL changes to avoid race conditions for rich previews + , + value: value, + onEditClick: () => setIsEditingLink(true), + hasRichPreviews: hasRichPreviews, + hasUnlinkControl: shownUnlinkControl, + onRemove: onRemove + }), showSettingsDrawer && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-link-control__tools" + }, (0,external_wp_element_namespaceObject.createElement)(settings_drawer, { + value: value, + settings: settings, + onChange: onChange + })), renderControlBottom && renderControlBottom()); +} + +LinkControl.ViewerFill = ViewerFill; +/* harmony default export */ var link_control = (LinkControl); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js + + +/** + * WordPress dependencies + */ + +const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" +})); +/* harmony default export */ var library_media = (media); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js + + +/** + * WordPress dependencies + */ + +const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var library_upload = (upload); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-upload/index.js +/** + * WordPress dependencies + */ + +/** + * This is a placeholder for the media upload component necessary to make it possible to provide + * an integration with the core blocks that handle media files. By default it renders nothing but + * it provides a way to have it overridden with the `editor.MediaUpload` filter. + * + * @return {WPComponent} The component to be rendered. + */ + +const MediaUpload = () => null; +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md + */ + + +/* harmony default export */ var media_upload = ((0,external_wp_components_namespaceObject.withFilters)('editor.MediaUpload')(MediaUpload)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-upload/check.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +function MediaUploadCheck(_ref) { + let { + fallback = null, + children + } = _ref; + const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = select(store); + return !!getSettings().mediaUpload; + }, []); + return hasUploadPermissions ? children : fallback; +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md + */ + +/* harmony default export */ var media_upload_check = (MediaUploadCheck); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-replace-flow/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const MediaReplaceFlow = _ref => { + let { + mediaURL, + mediaId, + allowedTypes, + accept, + onSelect, + onSelectURL, + onFilesUpload = external_lodash_namespaceObject.noop, + name = (0,external_wp_i18n_namespaceObject.__)('Replace'), + createNotice, + removeNotice, + children + } = _ref; + const [mediaURLValue, setMediaURLValue] = (0,external_wp_element_namespaceObject.useState)(mediaURL); + const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(store).getSettings().mediaUpload; + }, []); + const editMediaButtonRef = (0,external_wp_element_namespaceObject.createRef)(); + const errorNoticeID = (0,external_lodash_namespaceObject.uniqueId)('block-editor/media-replace-flow/error-notice/'); + + const onError = message => { + const errorElement = document.createElement('div'); + errorElement.innerHTML = (0,external_wp_element_namespaceObject.renderToString)(message); // The default error contains some HTML that, + // for example, makes the filename bold. + // The notice, by default, accepts strings only and so + // we need to remove the html from the error. + + const renderMsg = errorElement.textContent || errorElement.innerText || ''; // We need to set a timeout for showing the notice + // so that VoiceOver and possibly other screen readers + // can announce the error afer the toolbar button + // regains focus once the upload dialog closes. + // Otherwise VO simply skips over the notice and announces + // the focused element and the open menu. + + setTimeout(() => { + createNotice('error', renderMsg, { + speak: true, + id: errorNoticeID, + isDismissible: true + }); + }, 1000); + }; + + const selectMedia = media => { + setMediaURLValue(media.url); // Calling `onSelect` after the state update since it might unmount the component. + + onSelect(media); + (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced')); + removeNotice(errorNoticeID); + }; + + const selectURL = newURL => { + onSelectURL(newURL); + }; + + const uploadFiles = event => { + const files = event.target.files; + onFilesUpload(files); + + const setMedia = _ref2 => { + let [media] = _ref2; + selectMedia(media); + }; + + mediaUpload({ + allowedTypes, + filesList: files, + onFileChange: setMedia, + onError + }); + }; + + const openOnArrowDown = event => { + if (event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { + event.preventDefault(); + event.target.click(); + } + }; + + const POPOVER_PROPS = { + isAlternate: true + }; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + popoverProps: POPOVER_PROPS, + contentClassName: "block-editor-media-replace-flow__options", + renderToggle: _ref3 => { + let { + isOpen, + onToggle + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + ref: editMediaButtonRef, + "aria-expanded": isOpen, + "aria-haspopup": "true", + onClick: onToggle, + onKeyDown: openOnArrowDown + }, name); + }, + renderContent: _ref4 => { + let { + onClose + } = _ref4; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, { + className: "block-editor-media-replace-flow__media-upload-menu" + }, (0,external_wp_element_namespaceObject.createElement)(media_upload, { + value: mediaId, + onSelect: media => selectMedia(media), + allowedTypes: allowedTypes, + render: _ref5 => { + let { + open + } = _ref5; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + icon: library_media, + onClick: open + }, (0,external_wp_i18n_namespaceObject.__)('Open Media Library')); + } + }), (0,external_wp_element_namespaceObject.createElement)(media_upload_check, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, { + onChange: event => { + uploadFiles(event, onClose); + }, + accept: accept, + render: _ref6 => { + let { + openFileDialog + } = _ref6; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + icon: library_upload, + onClick: () => { + openFileDialog(); + } + }, (0,external_wp_i18n_namespaceObject.__)('Upload')); + } + })), children), onSelectURL && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions + (0,external_wp_element_namespaceObject.createElement)("form", { + className: "block-editor-media-flow__url-input" + }, (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-media-replace-flow__image-url-label" + }, (0,external_wp_i18n_namespaceObject.__)('Current media URL:')), (0,external_wp_element_namespaceObject.createElement)(link_control, { + value: { + url: mediaURLValue + }, + settings: [], + showSuggestions: false, + onChange: _ref7 => { + let { + url + } = _ref7; + setMediaURLValue(url); + selectURL(url); + editMediaButtonRef.current.focus(); + } + }))); + } + }); +}; + +/* harmony default export */ var media_replace_flow = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withDispatch)(dispatch => { + const { + createNotice, + removeNotice + } = dispatch(external_wp_notices_namespaceObject.store); + return { + createNotice, + removeNotice + }; +}), (0,external_wp_components_namespaceObject.withFilters)('editor.MediaReplaceFlow')])(MediaReplaceFlow)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer-url.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +function LinkViewerURL(_ref) { + let { + url, + urlLabel, + className + } = _ref; + const linkClassName = classnames_default()(className, 'block-editor-url-popover__link-viewer-url'); + + if (!url) { + return (0,external_wp_element_namespaceObject.createElement)("span", { + className: linkClassName + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { + className: linkClassName, + href: url + }, urlLabel || (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(url))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +function LinkViewer(_ref) { + let { + className, + linkClassName, + onEditLinkClick, + url, + urlLabel, + ...props + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", _extends({ + className: classnames_default()('block-editor-url-popover__link-viewer', className) + }, props), (0,external_wp_element_namespaceObject.createElement)(LinkViewerURL, { + url: url, + urlLabel: urlLabel, + className: linkClassName + }), onEditLinkClick && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: library_edit, + label: (0,external_wp_i18n_namespaceObject.__)('Edit'), + onClick: onEditLinkClick + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-editor.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +function LinkEditor(_ref) { + let { + autocompleteRef, + className, + onChangeInputValue, + value, + ...props + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("form", _extends({ + className: classnames_default()('block-editor-url-popover__link-editor', className) + }, props), (0,external_wp_element_namespaceObject.createElement)(url_input, { + value: value, + onChange: onChangeInputValue, + autocompleteRef: autocompleteRef + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: keyboard_return, + label: (0,external_wp_i18n_namespaceObject.__)('Apply'), + type: "submit" + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/index.js + + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +function URLPopover(_ref) { + let { + additionalControls, + children, + renderSettings, + position = 'bottom center', + focusOnMount = 'firstElement', + ...popoverProps + } = _ref; + const [isSettingsExpanded, setIsSettingsExpanded] = (0,external_wp_element_namespaceObject.useState)(false); + const showSettings = !!renderSettings && isSettingsExpanded; + + const toggleSettingsVisibility = () => { + setIsSettingsExpanded(!isSettingsExpanded); + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({ + className: "block-editor-url-popover", + focusOnMount: focusOnMount, + position: position + }, popoverProps), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-url-popover__input-container" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-url-popover__row" + }, children, !!renderSettings && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-url-popover__settings-toggle", + icon: chevron_down, + label: (0,external_wp_i18n_namespaceObject.__)('Link settings'), + onClick: toggleSettingsVisibility, + "aria-expanded": isSettingsExpanded + })), showSettings && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-url-popover__row block-editor-url-popover__settings" + }, renderSettings())), additionalControls && !showSettings && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-url-popover__additional-controls" + }, additionalControls)); +} + +URLPopover.LinkEditor = LinkEditor; +URLPopover.LinkViewer = LinkViewer; +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-popover/README.md + */ + +/* harmony default export */ var url_popover = (URLPopover); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-placeholder/index.js + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const InsertFromURLPopover = _ref => { + let { + src, + onChange, + onSubmit, + onClose + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(url_popover, { + onClose: onClose + }, (0,external_wp_element_namespaceObject.createElement)("form", { + className: "block-editor-media-placeholder__url-input-form", + onSubmit: onSubmit + }, (0,external_wp_element_namespaceObject.createElement)("input", { + className: "block-editor-media-placeholder__url-input-field", + type: "text", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('URL'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Paste or type URL'), + onChange: onChange, + value: src + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-media-placeholder__url-input-submit-button", + icon: keyboard_return, + label: (0,external_wp_i18n_namespaceObject.__)('Apply'), + type: "submit" + }))); +}; + +function MediaPlaceholder(_ref2) { + let { + value = {}, + allowedTypes, + className, + icon, + labels = {}, + mediaPreview, + notices, + isAppender, + accept, + addToGallery, + multiple = false, + handleUpload = true, + dropZoneUIOnly, + disableDropZone, + disableMediaButtons, + onError, + onSelect, + onCancel, + onSelectURL, + onDoubleClick, + onFilesPreUpload = external_lodash_namespaceObject.noop, + onHTMLDrop = external_lodash_namespaceObject.noop, + children, + mediaLibraryButton, + placeholder, + style + } = _ref2; + const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = select(store); + return getSettings().mediaUpload; + }, []); + const [src, setSrc] = (0,external_wp_element_namespaceObject.useState)(''); + const [isURLInputVisible, setIsURLInputVisible] = (0,external_wp_element_namespaceObject.useState)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { + var _value$src; + + setSrc((_value$src = value === null || value === void 0 ? void 0 : value.src) !== null && _value$src !== void 0 ? _value$src : ''); + }, [value === null || value === void 0 ? void 0 : value.src]); + + const onlyAllowsImages = () => { + if (!allowedTypes || allowedTypes.length === 0) { + return false; + } + + return allowedTypes.every(allowedType => allowedType === 'image' || allowedType.startsWith('image/')); + }; + + const onChangeSrc = event => { + setSrc(event.target.value); + }; + + const openURLInput = () => { + setIsURLInputVisible(true); + }; + + const closeURLInput = () => { + setIsURLInputVisible(false); + }; + + const onSubmitSrc = event => { + event.preventDefault(); + + if (src && onSelectURL) { + onSelectURL(src); + closeURLInput(); + } + }; + + const onFilesUpload = files => { + if (!handleUpload) { + return onSelect(files); + } + + onFilesPreUpload(files); + let setMedia; + + if (multiple) { + if (addToGallery) { + // Since the setMedia function runs multiple times per upload group + // and is passed newMedia containing every item in its group each time, we must + // filter out whatever this upload group had previously returned to the + // gallery before adding and returning the image array with replacement newMedia + // values. + // Define an array to store urls from newMedia between subsequent function calls. + let lastMediaPassed = []; + + setMedia = newMedia => { + // Remove any images this upload group is responsible for (lastMediaPassed). + // Their replacements are contained in newMedia. + const filteredMedia = (value !== null && value !== void 0 ? value : []).filter(item => { + // If Item has id, only remove it if lastMediaPassed has an item with that id. + if (item.id) { + return !lastMediaPassed.some( // Be sure to convert to number for comparison. + _ref3 => { + let { + id + } = _ref3; + return Number(id) === Number(item.id); + }); + } // Compare transient images via .includes since gallery may append extra info onto the url. + + + return !lastMediaPassed.some(_ref4 => { + let { + urlSlug + } = _ref4; + return item.url.includes(urlSlug); + }); + }); // Return the filtered media array along with newMedia. + + onSelect(filteredMedia.concat(newMedia)); // Reset lastMediaPassed and set it with ids and urls from newMedia. + + lastMediaPassed = newMedia.map(media => { + // Add everything up to '.fileType' to compare via .includes. + const cutOffIndex = media.url.lastIndexOf('.'); + const urlSlug = media.url.slice(0, cutOffIndex); + return { + id: media.id, + urlSlug + }; + }); + }; + } else { + setMedia = onSelect; + } + } else { + setMedia = _ref5 => { + let [media] = _ref5; + return onSelect(media); + }; + } + + mediaUpload({ + allowedTypes, + filesList: files, + onFileChange: setMedia, + onError + }); + }; + + const onUpload = event => { + onFilesUpload(event.target.files); + }; + + const defaultRenderPlaceholder = content => { + let { + instructions, + title + } = labels; + + if (!mediaUpload && !onSelectURL) { + instructions = (0,external_wp_i18n_namespaceObject.__)('To edit this block, you need permission to upload media.'); + } + + if (instructions === undefined || title === undefined) { + const typesAllowed = allowedTypes !== null && allowedTypes !== void 0 ? allowedTypes : []; + const [firstAllowedType] = typesAllowed; + const isOneType = 1 === typesAllowed.length; + const isAudio = isOneType && 'audio' === firstAllowedType; + const isImage = isOneType && 'image' === firstAllowedType; + const isVideo = isOneType && 'video' === firstAllowedType; + + if (instructions === undefined && mediaUpload) { + instructions = (0,external_wp_i18n_namespaceObject.__)('Upload a media file or pick one from your media library.'); + + if (isAudio) { + instructions = (0,external_wp_i18n_namespaceObject.__)('Upload an audio file, pick one from your media library, or add one with a URL.'); + } else if (isImage) { + instructions = (0,external_wp_i18n_namespaceObject.__)('Upload an image file, pick one from your media library, or add one with a URL.'); + } else if (isVideo) { + instructions = (0,external_wp_i18n_namespaceObject.__)('Upload a video file, pick one from your media library, or add one with a URL.'); + } + } + + if (title === undefined) { + title = (0,external_wp_i18n_namespaceObject.__)('Media'); + + if (isAudio) { + title = (0,external_wp_i18n_namespaceObject.__)('Audio'); + } else if (isImage) { + title = (0,external_wp_i18n_namespaceObject.__)('Image'); + } else if (isVideo) { + title = (0,external_wp_i18n_namespaceObject.__)('Video'); + } + } + } + + const placeholderClassName = classnames_default()('block-editor-media-placeholder', className, { + 'is-appender': isAppender + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { + icon: icon, + label: title, + instructions: instructions, + className: placeholderClassName, + notices: notices, + onDoubleClick: onDoubleClick, + preview: mediaPreview, + style: style + }, content, children); + }; + + const renderPlaceholder = placeholder !== null && placeholder !== void 0 ? placeholder : defaultRenderPlaceholder; + + const renderDropZone = () => { + if (disableDropZone) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropZone, { + onFilesDrop: onFilesUpload, + onHTMLDrop: onHTMLDrop + }); + }; + + const renderCancelLink = () => { + return onCancel && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-media-placeholder__cancel-button", + title: (0,external_wp_i18n_namespaceObject.__)('Cancel'), + variant: "link", + onClick: onCancel + }, (0,external_wp_i18n_namespaceObject.__)('Cancel')); + }; + + const renderUrlSelectionUI = () => { + return onSelectURL && (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-media-placeholder__url-input-container" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-media-placeholder__button", + onClick: openURLInput, + isPressed: isURLInputVisible, + variant: "tertiary" + }, (0,external_wp_i18n_namespaceObject.__)('Insert from URL')), isURLInputVisible && (0,external_wp_element_namespaceObject.createElement)(InsertFromURLPopover, { + src: src, + onChange: onChangeSrc, + onSubmit: onSubmitSrc, + onClose: closeURLInput + })); + }; + + const renderMediaUploadChecked = () => { + const defaultButton = _ref6 => { + let { + open + } = _ref6; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "tertiary", + onClick: () => { + open(); + } + }, (0,external_wp_i18n_namespaceObject.__)('Media Library')); + }; + + const libraryButton = mediaLibraryButton !== null && mediaLibraryButton !== void 0 ? mediaLibraryButton : defaultButton; + const uploadMediaLibraryButton = (0,external_wp_element_namespaceObject.createElement)(media_upload, { + addToGallery: addToGallery, + gallery: multiple && onlyAllowsImages(), + multiple: multiple, + onSelect: onSelect, + allowedTypes: allowedTypes, + value: Array.isArray(value) ? value.map(_ref7 => { + let { + id + } = _ref7; + return id; + }) : value.id, + render: libraryButton + }); + + if (mediaUpload && isAppender) { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, renderDropZone(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, { + onChange: onUpload, + accept: accept, + multiple: multiple, + render: _ref8 => { + let { + openFileDialog + } = _ref8; + const content = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "primary", + className: classnames_default()('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'), + onClick: openFileDialog + }, (0,external_wp_i18n_namespaceObject.__)('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderCancelLink()); + return renderPlaceholder(content); + } + })); + } + + if (mediaUpload) { + const content = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, renderDropZone(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, { + variant: "primary", + className: classnames_default()('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'), + onChange: onUpload, + accept: accept, + multiple: multiple + }, (0,external_wp_i18n_namespaceObject.__)('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderCancelLink()); + return renderPlaceholder(content); + } + + return renderPlaceholder(uploadMediaLibraryButton); + }; + + if (dropZoneUIOnly || disableMediaButtons) { + if (dropZoneUIOnly) { + external_wp_deprecated_default()('wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop', { + since: '5.4', + alternative: 'disableMediaButtons' + }); + } + + return (0,external_wp_element_namespaceObject.createElement)(media_upload_check, null, renderDropZone()); + } + + return (0,external_wp_element_namespaceObject.createElement)(media_upload_check, { + fallback: renderPlaceholder(renderUrlSelectionUI()) + }, renderMediaUploadChecked()); +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-placeholder/README.md + */ + +/* harmony default export */ var media_placeholder = ((0,external_wp_components_namespaceObject.withFilters)('editor.MediaPlaceholder')(MediaPlaceholder)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/panel-color-settings/index.js + + + +/** + * Internal dependencies + */ + + +const PanelColorSettings = _ref => { + let { + colorSettings, + ...props + } = _ref; + const settings = colorSettings.map(_ref2 => { + let { + value, + onChange, + ...otherSettings + } = _ref2; + return { ...otherSettings, + colorValue: value, + onColorChange: onChange + }; + }); + return (0,external_wp_element_namespaceObject.createElement)(panel_color_gradient_settings, _extends({ + settings: settings, + gradients: [], + disableCustomGradients: true + }, props)); +}; + +/* harmony default export */ var panel_color_settings = (PanelColorSettings); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar/index.js + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + +const format_toolbar_POPOVER_PROPS = { + position: 'bottom right', + isAlternate: true +}; + +const FormatToolbar = () => { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, ['bold', 'italic', 'link'].map(format => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, { + name: `RichText.ToolbarControls.${format}`, + key: format + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, { + name: "RichText.ToolbarControls" + }, fills => { + if (!fills.length) { + return null; + } + + const allProps = fills.map(_ref => { + let [{ + props + }] = _ref; + return props; + }); + const hasActive = allProps.some(_ref2 => { + let { + isActive + } = _ref2; + return isActive; + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, toggleProps => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { + icon: chevron_down + /* translators: button label text should, if possible, be under 16 characters. */ + , + label: (0,external_wp_i18n_namespaceObject.__)('More'), + toggleProps: { ...toggleProps, + className: classnames_default()(toggleProps.className, { + 'is-pressed': hasActive + }), + describedBy: (0,external_wp_i18n_namespaceObject.__)('Displays more block tools') + }, + controls: (0,external_lodash_namespaceObject.orderBy)(fills.map(_ref3 => { + let [{ + props + }] = _ref3; + return props; + }), 'title'), + popoverProps: format_toolbar_POPOVER_PROPS + })); + })); +}; + +/* harmony default export */ var format_toolbar = (FormatToolbar); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar-container.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + +const FormatToolbarContainer = _ref => { + let { + inline, + anchorRef + } = _ref; + + if (inline) { + // Render in popover + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { + noArrow: true, + position: "top center", + focusOnMount: false, + anchorRef: anchorRef, + className: "block-editor-rich-text__inline-format-toolbar", + __unstableSlotName: "block-toolbar" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-rich-text__inline-format-toolbar-group" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(format_toolbar, null)))); + } // Render regular toolbar + + + return (0,external_wp_element_namespaceObject.createElement)(block_controls, { + group: "inline" + }, (0,external_wp_element_namespaceObject.createElement)(format_toolbar, null)); +}; + +/* harmony default export */ var format_toolbar_container = (FormatToolbarContainer); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-undo-automatic-change.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function useUndoAutomaticChange() { + const { + didAutomaticChange, + getSettings + } = (0,external_wp_data_namespaceObject.useSelect)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + function onKeyDown(event) { + const { + keyCode + } = event; + + if (event.defaultPrevented) { + return; + } + + if (keyCode !== external_wp_keycodes_namespaceObject.DELETE && keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.ESCAPE) { + return; + } + + if (!didAutomaticChange()) { + return; + } + + event.preventDefault(); + + getSettings().__experimentalUndo(); + } + + element.addEventListener('keydown', onKeyDown); + return () => { + element.removeEventListener('keydown', onKeyDown); + }; + }, []); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-caret-in-format.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function useCaretInFormat(_ref) { + let { + value + } = _ref; + const hasActiveFormats = value.activeFormats && !!value.activeFormats.length; + const { + isCaretWithinFormattedText + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + enterFormattedText, + exitFormattedText + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (hasActiveFormats) { + if (!isCaretWithinFormattedText()) { + enterFormattedText(); + } + } else if (isCaretWithinFormattedText()) { + exitFormattedText(); + } + }, [hasActiveFormats]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-mark-persistent.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function useMarkPersistent(_ref) { + let { + html, + value + } = _ref; + const previousText = (0,external_wp_element_namespaceObject.useRef)(); + const hasActiveFormats = value.activeFormats && !!value.activeFormats.length; + const { + __unstableMarkLastChangeAsPersistent + } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Must be set synchronously to make sure it applies to the last change. + + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + // Ignore mount. + if (!previousText.current) { + previousText.current = value.text; + return; + } // Text input, so don't create an undo level for every character. + // Create an undo level after 1 second of no input. + + + if (previousText.current !== value.text) { + const timeout = window.setTimeout(() => { + __unstableMarkLastChangeAsPersistent(); + }, 1000); + previousText.current = value.text; + return () => { + window.clearTimeout(timeout); + }; + } + + __unstableMarkLastChangeAsPersistent(); + }, [html, hasActiveFormats]); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/file-paste-handler.js +/** + * WordPress dependencies + */ + +function filePasteHandler(files) { + return files.filter(_ref => { + let { + type + } = _ref; + return /^image\/(?:jpe?g|png|gif)$/.test(type); + }).map(file => ``).join(''); +} + +;// CONCATENATED MODULE: external ["wp","shortcode"] +var external_wp_shortcode_namespaceObject = window["wp"]["shortcode"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/utils.js + + +/** + * WordPress dependencies + */ + + + + +function addActiveFormats(value, activeFormats) { + if (activeFormats !== null && activeFormats !== void 0 && activeFormats.length) { + let index = value.formats.length; + + while (index--) { + value.formats[index] = [...activeFormats, ...(value.formats[index] || [])]; + } + } +} +/** + * Get the multiline tag based on the multiline prop. + * + * @param {?(string|boolean)} multiline The multiline prop. + * + * @return {?string} The multiline tag. + */ + +function getMultilineTag(multiline) { + if (multiline !== true && multiline !== 'p' && multiline !== 'li') { + return; + } + + return multiline === true ? 'p' : multiline; +} +function getAllowedFormats(_ref) { + let { + allowedFormats, + formattingControls, + disableFormats + } = _ref; + + if (disableFormats) { + return getAllowedFormats.EMPTY_ARRAY; + } + + if (!allowedFormats && !formattingControls) { + return; + } + + if (allowedFormats) { + return allowedFormats; + } + + external_wp_deprecated_default()('wp.blockEditor.RichText formattingControls prop', { + since: '5.4', + alternative: 'allowedFormats' + }); + return formattingControls.map(name => `core/${name}`); +} +getAllowedFormats.EMPTY_ARRAY = []; +const isShortcode = text => (0,external_wp_shortcode_namespaceObject.regexp)('.*').test(text); +/** + * Creates a link from pasted URL. + * Creates a paragraph block containing a link to the URL, and calls `onReplace`. + * + * @param {string} url The URL that could not be embedded. + * @param {Function} onReplace Function to call with the created fallback block. + */ + +function createLinkInParagraph(url, onReplace) { + const link = createElement("a", { + href: url + }, url); + onReplace(createBlock('core/paragraph', { + content: renderToString(link) + })); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/split-value.js +/** + * WordPress dependencies + */ + +/* + * Signals to the RichText owner that the block can be replaced with two blocks + * as a result of splitting the block by pressing enter, or with blocks as a + * result of splitting the block by pasting block content in the instance. + */ + +function splitValue(_ref) { + let { + value, + pastedBlocks = [], + onReplace, + onSplit, + onSplitMiddle, + multilineTag + } = _ref; + + if (!onReplace || !onSplit) { + return; + } + + const blocks = []; + const [before, after] = (0,external_wp_richText_namespaceObject.split)(value); + const hasPastedBlocks = pastedBlocks.length > 0; + let lastPastedBlockIndex = -1; // Consider the after value to be the original it is not empty and the + // before value *is* empty. + + const isAfterOriginal = (0,external_wp_richText_namespaceObject.isEmpty)(before) && !(0,external_wp_richText_namespaceObject.isEmpty)(after); // Create a block with the content before the caret if there's no pasted + // blocks, or if there are pasted blocks and the value is not empty. We do + // not want a leading empty block on paste, but we do if split with e.g. the + // enter key. + + if (!hasPastedBlocks || !(0,external_wp_richText_namespaceObject.isEmpty)(before)) { + blocks.push(onSplit((0,external_wp_richText_namespaceObject.toHTMLString)({ + value: before, + multilineTag + }), !isAfterOriginal)); + lastPastedBlockIndex += 1; + } + + if (hasPastedBlocks) { + blocks.push(...pastedBlocks); + lastPastedBlockIndex += pastedBlocks.length; + } else if (onSplitMiddle) { + blocks.push(onSplitMiddle()); + } // If there's pasted blocks, append a block with non empty content / after + // the caret. Otherwise, do append an empty block if there is no + // `onSplitMiddle` prop, but if there is and the content is empty, the + // middle block is enough to set focus in. + + + if (hasPastedBlocks ? !(0,external_wp_richText_namespaceObject.isEmpty)(after) : !onSplitMiddle || !(0,external_wp_richText_namespaceObject.isEmpty)(after)) { + blocks.push(onSplit((0,external_wp_richText_namespaceObject.toHTMLString)({ + value: after, + multilineTag + }), isAfterOriginal)); + } // If there are pasted blocks, set the selection to the last one. Otherwise, + // set the selection to the second block. + + + const indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1; // If there are pasted blocks, move the caret to the end of the selected + // block Otherwise, retain the default value. + + const initialPosition = hasPastedBlocks ? -1 : 0; + onReplace(blocks, indexToSelect, initialPosition); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-paste-handler.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +/** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */ + +/** + * Replaces line separators with line breaks if not multiline. + * Replaces line breaks with line separators if multiline. + * + * @param {RichTextValue} value Value to adjust. + * @param {boolean} isMultiline Whether to adjust to multiline or not. + * + * @return {RichTextValue} Adjusted value. + */ + +function adjustLines(value, isMultiline) { + if (isMultiline) { + return (0,external_wp_richText_namespaceObject.replace)(value, /\n+/g, external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR); + } + + return (0,external_wp_richText_namespaceObject.replace)(value, new RegExp(external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR, 'g'), '\n'); +} + +function usePasteHandler(props) { + const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); + propsRef.current = props; + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + function _onPaste(event) { + const { + isSelected, + disableFormats, + onChange, + value, + formatTypes, + tagName, + onReplace, + onSplit, + onSplitMiddle, + __unstableEmbedURLOnPaste, + multilineTag, + preserveWhiteSpace, + pastePlainText + } = propsRef.current; + + if (!isSelected) { + event.preventDefault(); + return; + } + + const { + clipboardData + } = event; + let plainText = ''; + let html = ''; // IE11 only supports `Text` as an argument for `getData` and will + // otherwise throw an invalid argument error, so we try the standard + // arguments first, then fallback to `Text` if they fail. + + try { + plainText = clipboardData.getData('text/plain'); + html = clipboardData.getData('text/html'); + } catch (error1) { + try { + html = clipboardData.getData('Text'); + } catch (error2) { + // Some browsers like UC Browser paste plain text by default and + // don't support clipboardData at all, so allow default + // behaviour. + return; + } + } // Remove Windows-specific metadata appended within copied HTML text. + + + html = removeWindowsFragments(html); // Strip meta tag. + + html = removeCharsetMetaTag(html); + event.preventDefault(); // Allows us to ask for this information when we get a report. + + window.console.log('Received HTML:\n\n', html); + window.console.log('Received plain text:\n\n', plainText); + + if (disableFormats) { + onChange((0,external_wp_richText_namespaceObject.insert)(value, plainText)); + return; + } + + const transformed = formatTypes.reduce((accumlator, _ref) => { + let { + __unstablePasteRule + } = _ref; + + // Only allow one transform. + if (__unstablePasteRule && accumlator === value) { + accumlator = __unstablePasteRule(value, { + html, + plainText + }); + } + + return accumlator; + }, value); + + if (transformed !== value) { + onChange(transformed); + return; + } + + const files = [...(0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(clipboardData)]; + const isInternal = clipboardData.getData('rich-text') === 'true'; // If the data comes from a rich text instance, we can directly use it + // without filtering the data. The filters are only meant for externally + // pasted content and remove inline styles. + + if (isInternal) { + const pastedMultilineTag = clipboardData.getData('rich-text-multi-line-tag') || undefined; + let pastedValue = (0,external_wp_richText_namespaceObject.create)({ + html, + multilineTag: pastedMultilineTag, + multilineWrapperTags: pastedMultilineTag === 'li' ? ['ul', 'ol'] : undefined, + preserveWhiteSpace + }); + pastedValue = adjustLines(pastedValue, !!multilineTag); + addActiveFormats(pastedValue, value.activeFormats); + onChange((0,external_wp_richText_namespaceObject.insert)(value, pastedValue)); + return; + } + + if (pastePlainText) { + onChange((0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.create)({ + text: plainText + }))); + return; + } // Only process file if no HTML is present. + // Note: a pasted file may have the URL as plain text. + + + if (files && files.length && !html) { + const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({ + HTML: filePasteHandler(files), + mode: 'BLOCKS', + tagName, + preserveWhiteSpace + }); // Allows us to ask for this information when we get a report. + // eslint-disable-next-line no-console + + window.console.log('Received items:\n\n', files); + + if (onReplace && (0,external_wp_richText_namespaceObject.isEmpty)(value)) { + onReplace(content); + } else { + splitValue({ + value, + pastedBlocks: content, + onReplace, + onSplit, + onSplitMiddle, + multilineTag + }); + } + + return; + } + + let mode = onReplace && onSplit ? 'AUTO' : 'INLINE'; // Force the blocks mode when the user is pasting + // on a new line & the content resembles a shortcode. + // Otherwise it's going to be detected as inline + // and the shortcode won't be replaced. + + if (mode === 'AUTO' && (0,external_wp_richText_namespaceObject.isEmpty)(value) && isShortcode(plainText)) { + mode = 'BLOCKS'; + } + + if (__unstableEmbedURLOnPaste && (0,external_wp_richText_namespaceObject.isEmpty)(value) && (0,external_wp_url_namespaceObject.isURL)(plainText.trim())) { + mode = 'BLOCKS'; + } + + const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({ + HTML: html, + plainText, + mode, + tagName, + preserveWhiteSpace + }); + + if (typeof content === 'string') { + let valueToInsert = (0,external_wp_richText_namespaceObject.create)({ + html: content + }); // If the content should be multiline, we should process text + // separated by a line break as separate lines. + + valueToInsert = adjustLines(valueToInsert, !!multilineTag); + addActiveFormats(valueToInsert, value.activeFormats); + onChange((0,external_wp_richText_namespaceObject.insert)(value, valueToInsert)); + } else if (content.length > 0) { + if (onReplace && (0,external_wp_richText_namespaceObject.isEmpty)(value)) { + onReplace(content, content.length - 1, -1); + } else { + splitValue({ + value, + pastedBlocks: content, + onReplace, + onSplit, + onSplitMiddle, + multilineTag + }); + } + } + } + + element.addEventListener('paste', _onPaste); + return () => { + element.removeEventListener('paste', _onPaste); + }; + }, []); +} +/** + * Normalizes a given string of HTML to remove the Windows specific "Fragment" comments + * and any preceeding and trailing whitespace. + * + * @param {string} html the html to be normalized + * @return {string} the normalized html + */ + +function removeWindowsFragments(html) { + const startReg = /.*/s; + const endReg = /.*/s; + return html.replace(startReg, '').replace(endReg, ''); +} +/** + * Removes the charset meta tag inserted by Chromium. + * See: + * - https://github.com/WordPress/gutenberg/issues/33585 + * - https://bugs.chromium.org/p/chromium/issues/detail?id=1264616#c4 + * + * @param {string} html the html to be stripped of the meta tag. + * @return {string} the cleaned html + */ + + +function removeCharsetMetaTag(html) { + const metaTag = ``; + + if (html.startsWith(metaTag)) { + return html.slice(metaTag.length); + } + + return html; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-input-rules.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +function useInputRules(props) { + const { + __unstableMarkLastChangeAsPersistent, + __unstableMarkAutomaticChange + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); + propsRef.current = props; + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + function inputRule() { + const { + value, + onReplace + } = propsRef.current; + + if (!onReplace) { + return; + } + + const { + start, + text + } = value; + const characterBefore = text.slice(start - 1, start); // The character right before the caret must be a plain space. + + if (characterBefore !== ' ') { + return; + } + + const trimmedTextBefore = text.slice(0, start).trim(); + const prefixTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)('from').filter(_ref => { + let { + type + } = _ref; + return type === 'prefix'; + }); + const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(prefixTransforms, _ref2 => { + let { + prefix + } = _ref2; + return trimmedTextBefore === prefix; + }); + + if (!transformation) { + return; + } + + const content = (0,external_wp_richText_namespaceObject.toHTMLString)({ + value: (0,external_wp_richText_namespaceObject.slice)(value, start, text.length) + }); + const block = transformation.transform(content); + onReplace([block]); + + __unstableMarkAutomaticChange(); + } + + function onInput(event) { + const { + inputType, + type + } = event; + const { + value, + onChange, + __unstableAllowPrefixTransformations, + formatTypes + } = propsRef.current; // Only run input rules when inserting text. + + if (inputType !== 'insertText' && type !== 'compositionend') { + return; + } + + if (__unstableAllowPrefixTransformations && inputRule) { + inputRule(); + } + + const transformed = formatTypes.reduce((accumlator, _ref3) => { + let { + __unstableInputRule + } = _ref3; + + if (__unstableInputRule) { + accumlator = __unstableInputRule(accumlator); + } + + return accumlator; + }, value); + + if (transformed !== value) { + __unstableMarkLastChangeAsPersistent(); + + onChange({ ...transformed, + activeFormats: value.activeFormats + }); + + __unstableMarkAutomaticChange(); + } + } + + element.addEventListener('input', onInput); + element.addEventListener('compositionend', onInput); + return () => { + element.removeEventListener('input', onInput); + element.removeEventListener('compositionend', onInput); + }; + }, []); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-enter.js +/** + * WordPress dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +function useEnter(props) { + const { + __unstableMarkAutomaticChange + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); + propsRef.current = props; + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + function onKeyDown(event) { + if (event.defaultPrevented) { + return; + } + + const { + removeEditorOnlyFormats, + value, + onReplace, + onSplit, + onSplitMiddle, + multilineTag, + onChange, + disableLineBreaks, + onSplitAtEnd + } = propsRef.current; + + if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { + return; + } + + event.preventDefault(); + const _value = { ...value + }; + _value.formats = removeEditorOnlyFormats(value); + const canSplit = onReplace && onSplit; + + if (onReplace) { + const transforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)('from').filter(_ref => { + let { + type + } = _ref; + return type === 'enter'; + }); + const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(transforms, item => { + return item.regExp.test(_value.text); + }); + + if (transformation) { + onReplace([transformation.transform({ + content: _value.text + })]); + + __unstableMarkAutomaticChange(); + } + } + + if (multilineTag) { + if (event.shiftKey) { + if (!disableLineBreaks) { + onChange((0,external_wp_richText_namespaceObject.insert)(_value, '\n')); + } + } else if (canSplit && (0,external_wp_richText_namespaceObject.__unstableIsEmptyLine)(_value)) { + splitValue({ + value: _value, + onReplace, + onSplit, + onSplitMiddle, + multilineTag + }); + } else { + onChange((0,external_wp_richText_namespaceObject.__unstableInsertLineSeparator)(_value)); + } + } else { + const { + text, + start, + end + } = _value; + const canSplitAtEnd = onSplitAtEnd && start === end && end === text.length; + + if (event.shiftKey || !canSplit && !canSplitAtEnd) { + if (!disableLineBreaks) { + onChange((0,external_wp_richText_namespaceObject.insert)(_value, '\n')); + } + } else if (!canSplit && canSplitAtEnd) { + onSplitAtEnd(); + } else if (canSplit) { + splitValue({ + value: _value, + onReplace, + onSplit, + onSplitMiddle, + multilineTag + }); + } + } + } + + element.addEventListener('keydown', onKeyDown); + return () => { + element.removeEventListener('keydown', onKeyDown); + }; + }, []); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-format-types.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function formatTypesSelector(select) { + return select(external_wp_richText_namespaceObject.store).getFormatTypes(); +} +/** + * Set of all interactive content tags. + * + * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content + */ + + +const interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']); +/** + * This hook provides RichText with the `formatTypes` and its derived props from + * experimental format type settings. + * + * @param {Object} $0 Options + * @param {string} $0.clientId Block client ID. + * @param {string} $0.identifier Block attribute. + * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not. + * @param {Array} $0.allowedFormats Allowed formats + */ + +function useFormatTypes(_ref) { + let { + clientId, + identifier, + withoutInteractiveFormatting, + allowedFormats + } = _ref; + const allFormatTypes = (0,external_wp_data_namespaceObject.useSelect)(formatTypesSelector, []); + const formatTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { + return allFormatTypes.filter(_ref2 => { + let { + name, + tagName + } = _ref2; + + if (allowedFormats && !allowedFormats.includes(name)) { + return false; + } + + if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) { + return false; + } + + return true; + }); + }, [allFormatTypes, allowedFormats, interactiveContentTags]); + const keyedSelected = (0,external_wp_data_namespaceObject.useSelect)(select => formatTypes.reduce((accumulator, type) => { + if (type.__experimentalGetPropsForEditableTreePreparation) { + accumulator[type.name] = type.__experimentalGetPropsForEditableTreePreparation(select, { + richTextIdentifier: identifier, + blockClientId: clientId + }); + } + + return accumulator; + }, {}), [formatTypes, clientId, identifier]); + const dispatch = (0,external_wp_data_namespaceObject.useDispatch)(); + const prepareHandlers = []; + const valueHandlers = []; + const changeHandlers = []; + const dependencies = []; + formatTypes.forEach(type => { + if (type.__experimentalCreatePrepareEditableTree) { + const selected = keyedSelected[type.name]; + + const handler = type.__experimentalCreatePrepareEditableTree(selected, { + richTextIdentifier: identifier, + blockClientId: clientId + }); + + if (type.__experimentalCreateOnChangeEditableValue) { + valueHandlers.push(handler); + } else { + prepareHandlers.push(handler); + } + + for (const key in selected) { + dependencies.push(selected[key]); + } + } + + if (type.__experimentalCreateOnChangeEditableValue) { + let dispatchers = {}; + + if (type.__experimentalGetPropsForEditableTreeChangeHandler) { + dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler(dispatch, { + richTextIdentifier: identifier, + blockClientId: clientId + }); + } + + changeHandlers.push(type.__experimentalCreateOnChangeEditableValue({ ...(keyedSelected[type.name] || {}), + ...dispatchers + }, { + richTextIdentifier: identifier, + blockClientId: clientId + })); + } + }); + return { + formatTypes, + prepareHandlers, + valueHandlers, + changeHandlers, + dependencies + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-remove-browser-shortcuts.js +/** + * WordPress dependencies + */ + + +/** + * Hook to prevent default behaviors for key combinations otherwise handled + * internally by RichText. + * + * @return {import('react').RefObject} The component to be rendered. + */ + +function useRemoveBrowserShortcuts() { + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function onKeydown(event) { + if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z') || external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'y') || external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'z')) { + event.preventDefault(); + } + } + + node.addEventListener('keydown', onKeydown); + return () => { + node.addEventListener('keydown', onKeydown); + }; + }, []); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-shortcuts.js +/** + * WordPress dependencies + */ + +function useShortcuts(keyboardShortcuts) { + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + function onKeyDown(event) { + for (const keyboardShortcut of keyboardShortcuts.current) { + keyboardShortcut(event); + } + } + + element.addEventListener('keydown', onKeyDown); + return () => { + element.removeEventListener('keydown', onKeyDown); + }; + }, []); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-input-events.js +/** + * WordPress dependencies + */ + +function useInputEvents(inputEvents) { + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + function onInput(event) { + for (const keyboardShortcut of inputEvents.current) { + keyboardShortcut(event); + } + } + + element.addEventListener('input', onInput); + return () => { + element.removeEventListener('input', onInput); + }; + }, []); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-edit.js + + +/** + * WordPress dependencies + */ + +/** + * External dependencies + */ + + +function FormatEdit(_ref) { + let { + formatTypes, + onChange, + onFocus, + value, + forwardedRef + } = _ref; + return formatTypes.map(settings => { + const { + name, + edit: Edit + } = settings; + + if (!Edit) { + return null; + } + + const activeFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name); + let isActive = activeFormat !== undefined; + const activeObject = (0,external_wp_richText_namespaceObject.getActiveObject)(value); + const isObjectActive = activeObject !== undefined && activeObject.type === name; // Edge case: un-collapsed link formats. + // If there is a missing link format at either end of the selection + // then we shouldn't show the Edit UI because the selection has exceeded + // the bounds of the link format. + // Also if the format objects don't match then we're dealing with two separate + // links so we should not allow the link to be modified over the top. + + if (name === 'core/link' && !(0,external_wp_richText_namespaceObject.isCollapsed)(value)) { + const formats = value.formats; + const linkFormatAtStart = (0,external_lodash_namespaceObject.find)(formats[value.start], { + type: 'core/link' + }); + const linkFormatAtEnd = (0,external_lodash_namespaceObject.find)(formats[value.end - 1], { + type: 'core/link' + }); + + if (!linkFormatAtStart || !linkFormatAtEnd || linkFormatAtStart !== linkFormatAtEnd) { + isActive = false; + } + } + + return (0,external_wp_element_namespaceObject.createElement)(Edit, { + key: name, + isActive: isActive, + activeAttributes: isActive ? activeFormat.attributes || {} : {}, + isObjectActive: isObjectActive, + activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {}, + value: value, + onChange: onChange, + onFocus: onFocus, + contentRef: forwardedRef + }); + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/index.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + + + + + + + + + + +const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)(); +const inputEventContext = (0,external_wp_element_namespaceObject.createContext)(); +/** + * Removes props used for the native version of RichText so that they are not + * passed to the DOM element and log warnings. + * + * @param {Object} props Props to filter. + * + * @return {Object} Filtered props. + */ + +function removeNativeProps(props) { + return (0,external_lodash_namespaceObject.omit)(props, ['__unstableMobileNoFocusOnMount', 'deleteEnter', 'placeholderTextColor', 'textAlign', 'selectionColor', 'tagsToEliminate', 'rootTagsToEliminate', 'disableEditingMenu', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'minWidth', 'maxWidth', 'setRef']); +} + +function RichTextWrapper(_ref, forwardedRef) { + let { + children, + tagName = 'div', + value: originalValue = '', + onChange: originalOnChange, + isSelected: originalIsSelected, + multiline, + inlineToolbar, + wrapperClassName, + autocompleters, + onReplace, + placeholder, + allowedFormats, + formattingControls, + withoutInteractiveFormatting, + onRemove, + onMerge, + onSplit, + __unstableOnSplitAtEnd: onSplitAtEnd, + __unstableOnSplitMiddle: onSplitMiddle, + identifier, + preserveWhiteSpace, + __unstablePastePlainText: pastePlainText, + __unstableEmbedURLOnPaste, + __unstableDisableFormats: disableFormats, + disableLineBreaks, + unstableOnFocus, + __unstableAllowPrefixTransformations, + ...props + } = _ref; + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(RichTextWrapper); + identifier = identifier || instanceId; + props = removeNativeProps(props); + const anchorRef = (0,external_wp_element_namespaceObject.useRef)(); + const { + clientId + } = useBlockEditContext(); + + const selector = select => { + const { + getSelectionStart, + getSelectionEnd, + isMultiSelecting, + hasMultiSelection + } = select(store); + const selectionStart = getSelectionStart(); + const selectionEnd = getSelectionEnd(); + let isSelected; + + if (originalIsSelected === undefined) { + isSelected = selectionStart.clientId === clientId && selectionStart.attributeKey === identifier; + } else if (originalIsSelected) { + isSelected = selectionStart.clientId === clientId; + } + + return { + selectionStart: isSelected ? selectionStart.offset : undefined, + selectionEnd: isSelected ? selectionEnd.offset : undefined, + isSelected, + disabled: isMultiSelecting() || hasMultiSelection() + }; + }; // This selector must run on every render so the right selection state is + // retreived from the store on merge. + // To do: fix this somehow. + + + const { + selectionStart, + selectionEnd, + isSelected, + disabled + } = (0,external_wp_data_namespaceObject.useSelect)(selector); + const { + selectionChange + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const multilineTag = getMultilineTag(multiline); + const adjustedAllowedFormats = getAllowedFormats({ + allowedFormats, + formattingControls, + disableFormats + }); + const hasFormats = !adjustedAllowedFormats || adjustedAllowedFormats.length > 0; + let adjustedValue = originalValue; + let adjustedOnChange = originalOnChange; // Handle deprecated format. + + if (Array.isArray(originalValue)) { + adjustedValue = external_wp_blocks_namespaceObject.children.toHTML(originalValue); + + adjustedOnChange = newValue => originalOnChange(external_wp_blocks_namespaceObject.children.fromDOM((0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, newValue).childNodes)); + } + + const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)((start, end) => { + selectionChange(clientId, identifier, start, end); + }, [clientId, identifier]); + const { + formatTypes, + prepareHandlers, + valueHandlers, + changeHandlers, + dependencies + } = useFormatTypes({ + clientId, + identifier, + withoutInteractiveFormatting, + allowedFormats: adjustedAllowedFormats + }); + + function addEditorOnlyFormats(value) { + return valueHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats); + } + + function removeEditorOnlyFormats(value) { + formatTypes.forEach(formatType => { + // Remove formats created by prepareEditableTree, because they are editor only. + if (formatType.__experimentalCreatePrepareEditableTree) { + value = (0,external_wp_richText_namespaceObject.removeFormat)(value, formatType.name, 0, value.text.length); + } + }); + return value.formats; + } + + function addInvisibleFormats(value) { + return prepareHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats); + } + + const { + value, + onChange, + ref: richTextRef + } = (0,external_wp_richText_namespaceObject.__unstableUseRichText)({ + value: adjustedValue, + + onChange(html, _ref2) { + let { + __unstableFormats, + __unstableText + } = _ref2; + adjustedOnChange(html); + Object.values(changeHandlers).forEach(changeHandler => { + changeHandler(__unstableFormats, __unstableText); + }); + }, + + selectionStart, + selectionEnd, + onSelectionChange, + placeholder, + __unstableIsSelected: isSelected, + __unstableMultilineTag: multilineTag, + __unstableDisableFormats: disableFormats, + preserveWhiteSpace, + __unstableDependencies: [...dependencies, tagName], + __unstableAfterParse: addEditorOnlyFormats, + __unstableBeforeSerialize: removeEditorOnlyFormats, + __unstableAddInvisibleFormats: addInvisibleFormats + }); + const autocompleteProps = useBlockEditorAutocompleteProps({ + onReplace, + completers: autocompleters, + record: value, + onChange + }); + useCaretInFormat({ + value + }); + useMarkPersistent({ + html: adjustedValue, + value + }); + const keyboardShortcuts = (0,external_wp_element_namespaceObject.useRef)(new Set()); + const inputEvents = (0,external_wp_element_namespaceObject.useRef)(new Set()); + + function onKeyDown(event) { + const { + keyCode + } = event; + + if (event.defaultPrevented) { + return; + } + + if (keyCode === external_wp_keycodes_namespaceObject.DELETE || keyCode === external_wp_keycodes_namespaceObject.BACKSPACE) { + const { + start, + end, + text + } = value; + const isReverse = keyCode === external_wp_keycodes_namespaceObject.BACKSPACE; + const hasActiveFormats = value.activeFormats && !!value.activeFormats.length; // Only process delete if the key press occurs at an uncollapsed edge. + + if (!(0,external_wp_richText_namespaceObject.isCollapsed)(value) || hasActiveFormats || isReverse && start !== 0 || !isReverse && end !== text.length) { + return; + } + + if (onMerge) { + onMerge(!isReverse); + } // Only handle remove on Backspace. This serves dual-purpose of being + // an intentional user interaction distinguishing between Backspace and + // Delete to remove the empty field, but also to avoid merge & remove + // causing destruction of two fields (merge, then removed merged). + + + if (onRemove && (0,external_wp_richText_namespaceObject.isEmpty)(value) && isReverse) { + onRemove(!isReverse); + } + + event.preventDefault(); + } + } + + function onFocus() { + anchorRef.current.focus(); + } + + const TagName = tagName; + const content = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isSelected && (0,external_wp_element_namespaceObject.createElement)(keyboardShortcutContext.Provider, { + value: keyboardShortcuts + }, (0,external_wp_element_namespaceObject.createElement)(inputEventContext.Provider, { + value: inputEvents + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.__unstableSlotNameProvider, { + value: "__unstable-block-tools-after" + }, children && children({ + value, + onChange, + onFocus + }), (0,external_wp_element_namespaceObject.createElement)(FormatEdit, { + value: value, + onChange: onChange, + onFocus: onFocus, + formatTypes: formatTypes, + forwardedRef: anchorRef + })))), isSelected && hasFormats && (0,external_wp_element_namespaceObject.createElement)(format_toolbar_container, { + inline: inlineToolbar, + anchorRef: anchorRef.current + }), (0,external_wp_element_namespaceObject.createElement)(TagName // Overridable props. + , _extends({ + role: "textbox", + "aria-multiline": true, + "aria-label": placeholder + }, props, autocompleteProps, { + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([autocompleteProps.ref, props.ref, richTextRef, useInputRules({ + value, + onChange, + __unstableAllowPrefixTransformations, + formatTypes, + onReplace + }), useRemoveBrowserShortcuts(), useShortcuts(keyboardShortcuts), useInputEvents(inputEvents), useUndoAutomaticChange(), usePasteHandler({ + isSelected, + disableFormats, + onChange, + value, + formatTypes, + tagName, + onReplace, + onSplit, + onSplitMiddle, + __unstableEmbedURLOnPaste, + multilineTag, + preserveWhiteSpace, + pastePlainText + }), useEnter({ + removeEditorOnlyFormats, + value, + onReplace, + onSplit, + onSplitMiddle, + multilineTag, + onChange, + disableLineBreaks, + onSplitAtEnd + }), anchorRef, forwardedRef]) // Do not set the attribute if disabled. + , + contentEditable: disabled ? undefined : true, + suppressContentEditableWarning: !disabled, + className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text'), + onFocus: unstableOnFocus, + onKeyDown: onKeyDown + }))); + + if (!wrapperClassName) { + return content; + } + + external_wp_deprecated_default()('wp.blockEditor.RichText wrapperClassName prop', { + since: '5.4', + alternative: 'className prop or create your own wrapper div' + }); + const className = classnames_default()('block-editor-rich-text', wrapperClassName); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: className + }, content); +} + +const ForwardedRichTextContainer = (0,external_wp_element_namespaceObject.forwardRef)(RichTextWrapper); + +ForwardedRichTextContainer.Content = _ref3 => { + let { + value, + tagName: Tag, + multiline, + ...props + } = _ref3; + + // Handle deprecated `children` and `node` sources. + if (Array.isArray(value)) { + value = external_wp_blocks_namespaceObject.children.toHTML(value); + } + + const MultilineTag = getMultilineTag(multiline); + + if (!value && MultilineTag) { + value = `<${MultilineTag}>`; + } + + const content = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, value); + + if (Tag) { + return (0,external_wp_element_namespaceObject.createElement)(Tag, (0,external_lodash_namespaceObject.omit)(props, ['format']), content); + } + + return content; +}; + +ForwardedRichTextContainer.isEmpty = value => { + return !value || value.length === 0; +}; +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md + */ + + +/* harmony default export */ var rich_text = (ForwardedRichTextContainer); + + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editable-text/index.js + + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const EditableText = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { + return (0,external_wp_element_namespaceObject.createElement)(rich_text, _extends({ + ref: ref + }, props, { + __unstableDisableFormats: true, + preserveWhiteSpace: true + })); +}); + +EditableText.Content = _ref => { + let { + value = '', + tagName: Tag = 'div', + ...props + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(Tag, props, value); +}; +/** + * Renders an editable text input in which text formatting is not allowed. + */ + + +/* harmony default export */ var editable_text = (EditableText); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/plain-text/index.js + + + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md + */ + +const PlainText = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => { + let { + __experimentalVersion, + ...props + } = _ref; + + if (__experimentalVersion === 2) { + return (0,external_wp_element_namespaceObject.createElement)(editable_text, _extends({ + ref: ref + }, props)); + } + + const { + className, + onChange, + ...remainingProps + } = props; + return (0,external_wp_element_namespaceObject.createElement)(lib/* default */.Z, _extends({ + ref: ref, + className: classnames_default()('block-editor-plain-text', className), + onChange: event => onChange(event.target.value) + }, remainingProps)); +}); +/* harmony default export */ var plain_text = (PlainText); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/label.js + + +/** + * WordPress dependencies + */ + + + + +function ResponsiveBlockControlLabel(_ref) { + let { + property, + viewport, + desc + } = _ref; + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ResponsiveBlockControlLabel); + const accessibleLabel = desc || (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: 1: property name. 2: viewport name. */ + (0,external_wp_i18n_namespaceObject._x)('Controls the %1$s property for %2$s viewports.', 'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'), property, viewport.label); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", { + "aria-describedby": `rbc-desc-${instanceId}` + }, viewport.label), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "span", + id: `rbc-desc-${instanceId}` + }, accessibleLabel)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +function ResponsiveBlockControl(props) { + const { + title, + property, + toggleLabel, + onIsResponsiveChange, + renderDefaultControl, + renderResponsiveControls, + isResponsive = false, + defaultLabel = { + id: 'all', + + /* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */ + label: (0,external_wp_i18n_namespaceObject.__)('All') + }, + viewports = [{ + id: 'small', + label: (0,external_wp_i18n_namespaceObject.__)('Small screens') + }, { + id: 'medium', + label: (0,external_wp_i18n_namespaceObject.__)('Medium screens') + }, { + id: 'large', + label: (0,external_wp_i18n_namespaceObject.__)('Large screens') + }] + } = props; + + if (!title || !property || !renderDefaultControl) { + return null; + } + + const toggleControlLabel = toggleLabel || (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */ + (0,external_wp_i18n_namespaceObject.__)('Use the same %s on all screensizes.'), property); + /* translators: 'Help text for the responsive mode toggle control.' */ + + const toggleHelpText = (0,external_wp_i18n_namespaceObject.__)('Toggle between using the same value for all screen sizes or using a unique value per screen size.'); + + const defaultControl = renderDefaultControl((0,external_wp_element_namespaceObject.createElement)(ResponsiveBlockControlLabel, { + property: property, + viewport: defaultLabel + }), defaultLabel); + + const defaultResponsiveControls = () => { + return viewports.map(viewport => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, { + key: viewport.id + }, renderDefaultControl((0,external_wp_element_namespaceObject.createElement)(ResponsiveBlockControlLabel, { + property: property, + viewport: viewport + }), viewport))); + }; + + return (0,external_wp_element_namespaceObject.createElement)("fieldset", { + className: "block-editor-responsive-block-control" + }, (0,external_wp_element_namespaceObject.createElement)("legend", { + className: "block-editor-responsive-block-control__title" + }, title), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-responsive-block-control__inner" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + className: "block-editor-responsive-block-control__toggle", + label: toggleControlLabel, + checked: !isResponsive, + onChange: onIsResponsiveChange, + help: toggleHelpText + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: classnames_default()('block-editor-responsive-block-control__group', { + 'is-responsive': isResponsive + }) + }, !isResponsive && defaultControl, isResponsive && (renderResponsiveControls ? renderResponsiveControls(viewports) : defaultResponsiveControls())))); +} + +/* harmony default export */ var responsive_block_control = (ResponsiveBlockControl); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/shortcut.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function RichTextShortcut(_ref) { + let { + character, + type, + onUse + } = _ref; + const keyboardShortcuts = (0,external_wp_element_namespaceObject.useContext)(keyboardShortcutContext); + const onUseRef = (0,external_wp_element_namespaceObject.useRef)(); + onUseRef.current = onUse; + (0,external_wp_element_namespaceObject.useEffect)(() => { + function callback(event) { + if (external_wp_keycodes_namespaceObject.isKeyboardEvent[type](event, character)) { + onUseRef.current(); + event.preventDefault(); + } + } + + keyboardShortcuts.current.add(callback); + return () => { + keyboardShortcuts.current.delete(callback); + }; + }, [character, type]); + return null; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/toolbar-button.js + + + +/** + * WordPress dependencies + */ + + +function RichTextToolbarButton(_ref) { + let { + name, + shortcutType, + shortcutCharacter, + ...props + } = _ref; + let shortcut; + let fillName = 'RichText.ToolbarControls'; + + if (name) { + fillName += `.${name}`; + } + + if (shortcutType && shortcutCharacter) { + shortcut = external_wp_keycodes_namespaceObject.displayShortcut[shortcutType](shortcutCharacter); + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, { + name: fillName + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, _extends({}, props, { + shortcut: shortcut + }))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/input-event.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +function __unstableRichTextInputEvent(_ref) { + let { + inputType, + onInput + } = _ref; + const callbacks = (0,external_wp_element_namespaceObject.useContext)(inputEventContext); + const onInputRef = (0,external_wp_element_namespaceObject.useRef)(); + onInputRef.current = onInput; + (0,external_wp_element_namespaceObject.useEffect)(() => { + function callback(event) { + if (event.inputType === inputType) { + onInputRef.current(); + event.preventDefault(); + } + } + + callbacks.current.add(callback); + return () => { + callbacks.current.delete(callback); + }; + }, [inputType]); + return null; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/tool-selector/index.js + + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const selectIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z" +})); + +function ToolSelector(props, ref) { + const isNavigationTool = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isNavigationMode(), []); + const { + setNavigationMode + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + + const onSwitchMode = mode => { + setNavigationMode(mode === 'edit' ? false : true); + }; + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { + renderToggle: _ref => { + let { + isOpen, + onToggle + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, props, { + ref: ref, + icon: isNavigationTool ? selectIcon : library_edit, + "aria-expanded": isOpen, + "aria-haspopup": "true", + onClick: onToggle + /* translators: button label text should, if possible, be under 16 characters. */ + , + label: (0,external_wp_i18n_namespaceObject.__)('Tools') + })); + }, + position: "bottom right", + renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, { + role: "menu", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Tools') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, { + value: isNavigationTool ? 'select' : 'edit', + onSelect: onSwitchMode, + choices: [{ + value: 'edit', + label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + icon: library_edit + }), (0,external_wp_i18n_namespaceObject.__)('Edit')) + }, { + value: 'select', + label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, selectIcon, (0,external_wp_i18n_namespaceObject.__)('Select')) + }] + })), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-tool-selector__help" + }, (0,external_wp_i18n_namespaceObject.__)('Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.'))) + }); +} + +/* harmony default export */ var tool_selector = ((0,external_wp_element_namespaceObject.forwardRef)(ToolSelector)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/unit-control/index.js + + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +function UnitControl(_ref) { + let { + units: unitsProp, + ...props + } = _ref; + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'], + units: unitsProp + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({ + units: units + }, props)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js + + +/** + * WordPress dependencies + */ + +const arrowLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z" +})); +/* harmony default export */ var arrow_left = (arrowLeft); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-input/button.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +class URLInputButton extends external_wp_element_namespaceObject.Component { + constructor() { + super(...arguments); + this.toggle = this.toggle.bind(this); + this.submitLink = this.submitLink.bind(this); + this.state = { + expanded: false + }; + } + + toggle() { + this.setState({ + expanded: !this.state.expanded + }); + } + + submitLink(event) { + event.preventDefault(); + this.toggle(); + } + + render() { + const { + url, + onChange + } = this.props; + const { + expanded + } = this.state; + const buttonLabel = url ? (0,external_wp_i18n_namespaceObject.__)('Edit link') : (0,external_wp_i18n_namespaceObject.__)('Insert link'); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-url-input__button" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: library_link, + label: buttonLabel, + onClick: this.toggle, + className: "components-toolbar__control", + isPressed: !!url + }), expanded && (0,external_wp_element_namespaceObject.createElement)("form", { + className: "block-editor-url-input__button-modal", + onSubmit: this.submitLink + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-url-input__button-modal-line" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: "block-editor-url-input__back", + icon: arrow_left, + label: (0,external_wp_i18n_namespaceObject.__)('Close'), + onClick: this.toggle + }), (0,external_wp_element_namespaceObject.createElement)(url_input, { + value: url || '', + onChange: onChange + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: keyboard_return, + label: (0,external_wp_i18n_namespaceObject.__)('Submit'), + type: "submit" + })))); + } + +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md + */ + + +/* harmony default export */ var url_input_button = (URLInputButton); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js + + +/** + * WordPress dependencies + */ + +const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" +})); +/* harmony default export */ var library_close = (close_close); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/image-url-input-ui.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const LINK_DESTINATION_NONE = 'none'; +const LINK_DESTINATION_CUSTOM = 'custom'; +const LINK_DESTINATION_MEDIA = 'media'; +const LINK_DESTINATION_ATTACHMENT = 'attachment'; +const NEW_TAB_REL = ['noreferrer', 'noopener']; +const icon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M0,0h24v24H0V0z", + fill: "none" +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z" +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z" +})); + +const ImageURLInputUI = _ref => { + let { + linkDestination, + onChangeUrl, + url, + mediaType = 'image', + mediaUrl, + mediaLink, + linkTarget, + linkClass, + rel + } = _ref; + const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const openLinkUI = (0,external_wp_element_namespaceObject.useCallback)(() => { + setIsOpen(true); + }); + const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(false); + const [urlInput, setUrlInput] = (0,external_wp_element_namespaceObject.useState)(null); + const autocompleteRef = (0,external_wp_element_namespaceObject.useRef)(null); + const startEditLink = (0,external_wp_element_namespaceObject.useCallback)(() => { + if (linkDestination === LINK_DESTINATION_MEDIA || linkDestination === LINK_DESTINATION_ATTACHMENT) { + setUrlInput(''); + } + + setIsEditingLink(true); + }); + const stopEditLink = (0,external_wp_element_namespaceObject.useCallback)(() => { + setIsEditingLink(false); + }); + const closeLinkUI = (0,external_wp_element_namespaceObject.useCallback)(() => { + setUrlInput(null); + stopEditLink(); + setIsOpen(false); + }); + + const removeNewTabRel = currentRel => { + let newRel = currentRel; + + if (currentRel !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(newRel)) { + if (!(0,external_lodash_namespaceObject.isEmpty)(newRel)) { + (0,external_lodash_namespaceObject.each)(NEW_TAB_REL, relVal => { + const regExp = new RegExp('\\b' + relVal + '\\b', 'gi'); + newRel = newRel.replace(regExp, ''); + }); // Only trim if NEW_TAB_REL values was replaced. + + if (newRel !== currentRel) { + newRel = newRel.trim(); + } + + if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) { + newRel = undefined; + } + } + } + + return newRel; + }; + + const getUpdatedLinkTargetSettings = value => { + const newLinkTarget = value ? '_blank' : undefined; + let updatedRel; + + if (!newLinkTarget && !rel) { + updatedRel = undefined; + } else { + updatedRel = removeNewTabRel(rel); + } + + return { + linkTarget: newLinkTarget, + rel: updatedRel + }; + }; + + const onFocusOutside = (0,external_wp_element_namespaceObject.useCallback)(() => { + return event => { + // The autocomplete suggestions list renders in a separate popover (in a portal), + // so onFocusOutside fails to detect that a click on a suggestion occurred in the + // LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and + // return to avoid the popover being closed. + const autocompleteElement = autocompleteRef.current; + + if (autocompleteElement && autocompleteElement.contains(event.target)) { + return; + } + + setIsOpen(false); + setUrlInput(null); + stopEditLink(); + }; + }); + const onSubmitLinkChange = (0,external_wp_element_namespaceObject.useCallback)(() => { + return event => { + if (urlInput) { + var _getLinkDestinations$; + + // It is possible the entered URL actually matches a named link destination. + // This check will ensure our link destination is correct. + const selectedDestination = ((_getLinkDestinations$ = getLinkDestinations().find(destination => destination.url === urlInput)) === null || _getLinkDestinations$ === void 0 ? void 0 : _getLinkDestinations$.linkDestination) || LINK_DESTINATION_CUSTOM; + onChangeUrl({ + href: urlInput, + linkDestination: selectedDestination + }); + } + + stopEditLink(); + setUrlInput(null); + event.preventDefault(); + }; + }); + const onLinkRemove = (0,external_wp_element_namespaceObject.useCallback)(() => { + onChangeUrl({ + linkDestination: LINK_DESTINATION_NONE, + href: '' + }); + }); + + const getLinkDestinations = () => { + const linkDestinations = [{ + linkDestination: LINK_DESTINATION_MEDIA, + title: (0,external_wp_i18n_namespaceObject.__)('Media File'), + url: mediaType === 'image' ? mediaUrl : undefined, + icon + }]; + + if (mediaType === 'image' && mediaLink) { + linkDestinations.push({ + linkDestination: LINK_DESTINATION_ATTACHMENT, + title: (0,external_wp_i18n_namespaceObject.__)('Attachment Page'), + url: mediaType === 'image' ? mediaLink : undefined, + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M0 0h24v24H0V0z", + fill: "none" + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { + d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z" + })) + }); + } + + return linkDestinations; + }; + + const onSetHref = value => { + const linkDestinations = getLinkDestinations(); + let linkDestinationInput; + + if (!value) { + linkDestinationInput = LINK_DESTINATION_NONE; + } else { + linkDestinationInput = ((0,external_lodash_namespaceObject.find)(linkDestinations, destination => { + return destination.url === value; + }) || { + linkDestination: LINK_DESTINATION_CUSTOM + }).linkDestination; + } + + onChangeUrl({ + linkDestination: linkDestinationInput, + href: value + }); + }; + + const onSetNewTab = value => { + const updatedLinkTarget = getUpdatedLinkTargetSettings(value); + onChangeUrl(updatedLinkTarget); + }; + + const onSetLinkRel = value => { + onChangeUrl({ + rel: value + }); + }; + + const onSetLinkClass = value => { + onChangeUrl({ + linkClass: value + }); + }; + + const advancedOptions = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), + onChange: onSetNewTab, + checked: linkTarget === '_blank' + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Link Rel'), + value: removeNewTabRel(rel) || '', + onChange: onSetLinkRel + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Link CSS Class'), + value: linkClass || '', + onChange: onSetLinkClass + })); + const linkEditorValue = urlInput !== null ? urlInput : url; + const urlLabel = ((0,external_lodash_namespaceObject.find)(getLinkDestinations(), ['linkDestination', linkDestination]) || {}).title; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + icon: library_link, + className: "components-toolbar__control", + label: url ? (0,external_wp_i18n_namespaceObject.__)('Edit link') : (0,external_wp_i18n_namespaceObject.__)('Insert link'), + "aria-expanded": isOpen, + onClick: openLinkUI + }), isOpen && (0,external_wp_element_namespaceObject.createElement)(url_popover, { + onFocusOutside: onFocusOutside(), + onClose: closeLinkUI, + renderSettings: () => advancedOptions, + additionalControls: !linkEditorValue && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_lodash_namespaceObject.map)(getLinkDestinations(), link => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + key: link.linkDestination, + icon: link.icon, + onClick: () => { + setUrlInput(null); + onSetHref(link.url); + stopEditLink(); + } + }, link.title))) + }, (!url || isEditingLink) && (0,external_wp_element_namespaceObject.createElement)(url_popover.LinkEditor, { + className: "block-editor-format-toolbar__link-container-content", + value: linkEditorValue, + onChangeInputValue: setUrlInput, + onSubmit: onSubmitLinkChange(), + autocompleteRef: autocompleteRef + }), url && !isEditingLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(url_popover.LinkViewer, { + className: "block-editor-format-toolbar__link-container-content", + url: url, + onEditLinkClick: startEditLink, + urlLabel: urlLabel + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: library_close, + label: (0,external_wp_i18n_namespaceObject.__)('Remove link'), + onClick: onLinkRemove + })))); +}; + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/preview-options/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +function PreviewOptions(_ref) { + let { + children, + className, + isEnabled = true, + deviceType, + setDeviceType + } = _ref; + const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); + if (isMobile) return null; + const popoverProps = { + className: classnames_default()(className, 'block-editor-post-preview__dropdown-content'), + position: 'bottom left' + }; + const toggleProps = { + variant: 'tertiary', + className: 'block-editor-post-preview__button-toggle', + disabled: !isEnabled, + + /* translators: button label text should, if possible, be under 16 characters. */ + children: (0,external_wp_i18n_namespaceObject.__)('Preview') + }; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { + className: "block-editor-post-preview__dropdown", + popoverProps: popoverProps, + toggleProps: toggleProps, + icon: null + }, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + className: "block-editor-post-preview__button-resize", + onClick: () => setDeviceType('Desktop'), + icon: deviceType === 'Desktop' && library_check + }, (0,external_wp_i18n_namespaceObject.__)('Desktop')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + className: "block-editor-post-preview__button-resize", + onClick: () => setDeviceType('Tablet'), + icon: deviceType === 'Tablet' && library_check + }, (0,external_wp_i18n_namespaceObject.__)('Tablet')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { + className: "block-editor-post-preview__button-resize", + onClick: () => setDeviceType('Mobile'), + icon: deviceType === 'Mobile' && library_check + }, (0,external_wp_i18n_namespaceObject.__)('Mobile'))), children)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-resize-canvas/index.js +/** + * WordPress dependencies + */ + +/** + * Function to resize the editor window. + * + * @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile) + * + * @return {Object} Inline styles to be added to resizable container. + */ + +function useResizeCanvas(deviceType) { + const [actualWidth, updateActualWidth] = (0,external_wp_element_namespaceObject.useState)(window.innerWidth); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (deviceType === 'Desktop') { + return; + } + + const resizeListener = () => updateActualWidth(window.innerWidth); + + window.addEventListener('resize', resizeListener); + return () => { + window.removeEventListener('resize', resizeListener); + }; + }, [deviceType]); + + const getCanvasWidth = device => { + let deviceWidth; + + switch (device) { + case 'Tablet': + deviceWidth = 780; + break; + + case 'Mobile': + deviceWidth = 360; + break; + + default: + return null; + } + + return deviceWidth < actualWidth ? deviceWidth : actualWidth; + }; + + const marginValue = () => window.innerHeight < 800 ? 36 : 72; + + const contentInlineStyles = device => { + const height = device === 'Mobile' ? '768px' : '1024px'; + + switch (device) { + case 'Tablet': + case 'Mobile': + return { + width: getCanvasWidth(device), + margin: marginValue() + 'px auto', + height, + borderRadius: '2px 2px 2px 2px', + border: '1px solid #ddd', + overflowY: 'auto' + }; + + default: + return null; + } + }; + + return contentInlineStyles(deviceType); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/skip-to-selected-block/index.js + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const SkipToSelectedBlock = _ref => { + let { + selectedBlockClientId + } = _ref; + const ref = useBlockRef(selectedBlockClientId); + + const onClick = () => { + ref.current.focus(); + }; + + return selectedBlockClientId ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "secondary", + className: "block-editor-skip-to-selected-block", + onClick: onClick + }, (0,external_wp_i18n_namespaceObject.__)('Skip to the selected block')) : null; +}; + +/* harmony default export */ var skip_to_selected_block = ((0,external_wp_data_namespaceObject.withSelect)(select => { + return { + selectedBlockClientId: select(store).getBlockSelectionStart() + }; +})(SkipToSelectedBlock)); + +;// CONCATENATED MODULE: external ["wp","wordcount"] +var external_wp_wordcount_namespaceObject = window["wp"]["wordcount"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/multi-selection-inspector/index.js + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +function MultiSelectionInspector(_ref) { + let { + blocks + } = _ref; + const words = (0,external_wp_wordcount_namespaceObject.count)((0,external_wp_blocks_namespaceObject.serialize)(blocks), 'words'); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-multi-selection-inspector__card" + }, (0,external_wp_element_namespaceObject.createElement)(block_icon, { + icon: library_stack, + showColors: true + }), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-multi-selection-inspector__card-content" + }, (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-multi-selection-inspector__card-title" + }, (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %d: number of blocks */ + (0,external_wp_i18n_namespaceObject._n)('%d block', '%d blocks', blocks.length), blocks.length)), (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-multi-selection-inspector__card-description" + }, (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %d: number of words */ + (0,external_wp_i18n_namespaceObject._n)('%d word', '%d words', words), words)))); +} + +/* harmony default export */ var multi_selection_inspector = ((0,external_wp_data_namespaceObject.withSelect)(select => { + const { + getMultiSelectedBlocks + } = select(store); + return { + blocks: getMultiSelectedBlocks() + }; +})(MultiSelectionInspector)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-style-picker/index.js + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +function DefaultStylePicker(_ref) { + let { + blockName + } = _ref; + const { + preferredStyle, + onUpdatePreferredStyleVariations, + styles + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _preferredStyleVariat, _preferredStyleVariat2; + + const settings = select(store).getSettings(); + const preferredStyleVariations = settings.__experimentalPreferredStyleVariations; + return { + preferredStyle: preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[blockName], + onUpdatePreferredStyleVariations: (_preferredStyleVariat2 = preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : preferredStyleVariations.onChange) !== null && _preferredStyleVariat2 !== void 0 ? _preferredStyleVariat2 : null, + styles: select(external_wp_blocks_namespaceObject.store).getBlockStyles(blockName) + }; + }, [blockName]); + const selectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => [{ + label: (0,external_wp_i18n_namespaceObject.__)('Not set'), + value: '' + }, ...styles.map(_ref2 => { + let { + label, + name + } = _ref2; + return { + label, + value: name + }; + })], [styles]); + const selectOnChange = (0,external_wp_element_namespaceObject.useCallback)(blockStyle => { + onUpdatePreferredStyleVariations(blockName, blockStyle); + }, [blockName, onUpdatePreferredStyleVariations]); + return onUpdatePreferredStyleVariations && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + options: selectOptions, + value: preferredStyle || '', + label: (0,external_wp_i18n_namespaceObject.__)('Default Style'), + onChange: selectOnChange + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + + + + + + + +const BlockInspector = _ref => { + let { + showNoBlockSelectedMessage = true, + bubblesVirtually = true + } = _ref; + const { + count, + hasBlockStyles, + selectedBlockName, + selectedBlockClientId, + blockType + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSelectedBlockClientId, + getSelectedBlockCount, + getBlockName + } = select(store); + const { + getBlockStyles + } = select(external_wp_blocks_namespaceObject.store); + + const _selectedBlockClientId = getSelectedBlockClientId(); + + const _selectedBlockName = _selectedBlockClientId && getBlockName(_selectedBlockClientId); + + const _blockType = _selectedBlockName && (0,external_wp_blocks_namespaceObject.getBlockType)(_selectedBlockName); + + const blockStyles = _selectedBlockName && getBlockStyles(_selectedBlockName); + + return { + count: getSelectedBlockCount(), + selectedBlockClientId: _selectedBlockClientId, + selectedBlockName: _selectedBlockName, + blockType: _blockType, + hasBlockStyles: blockStyles && blockStyles.length > 0 + }; + }, []); + + if (count > 1) { + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-inspector" + }, (0,external_wp_element_namespaceObject.createElement)(multi_selection_inspector, null), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, null), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + __experimentalGroup: "typography", + label: (0,external_wp_i18n_namespaceObject.__)('Typography') + }), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + __experimentalGroup: "dimensions", + label: (0,external_wp_i18n_namespaceObject.__)('Dimensions') + }), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + __experimentalGroup: "border", + label: (0,external_wp_i18n_namespaceObject.__)('Border') + })); + } + + const isSelectedBlockUnregistered = selectedBlockName === (0,external_wp_blocks_namespaceObject.getUnregisteredTypeHandlerName)(); + /* + * If the selected block is of an unregistered type, avoid showing it as an actual selection + * because we want the user to focus on the unregistered block warning, not block settings. + */ + + if (!blockType || !selectedBlockClientId || isSelectedBlockUnregistered) { + if (showNoBlockSelectedMessage) { + return (0,external_wp_element_namespaceObject.createElement)("span", { + className: "block-editor-block-inspector__no-blocks" + }, (0,external_wp_i18n_namespaceObject.__)('No block selected.')); + } + + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(BlockInspectorSingleBlock, { + clientId: selectedBlockClientId, + blockName: blockType.name, + hasBlockStyles: hasBlockStyles, + bubblesVirtually: bubblesVirtually + }); +}; + +const BlockInspectorSingleBlock = _ref2 => { + let { + clientId, + blockName, + hasBlockStyles, + bubblesVirtually + } = _ref2; + const blockInformation = useBlockDisplayInformation(clientId); + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "block-editor-block-inspector" + }, (0,external_wp_element_namespaceObject.createElement)(block_card, blockInformation), (0,external_wp_element_namespaceObject.createElement)(block_variation_transforms, { + blockClientId: clientId + }), hasBlockStyles && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Styles') + }, (0,external_wp_element_namespaceObject.createElement)(block_styles, { + clientId: clientId + }), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'defaultStylePicker', true) && (0,external_wp_element_namespaceObject.createElement)(DefaultStylePicker, { + blockName: blockName + }))), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + bubblesVirtually: bubblesVirtually + }), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + __experimentalGroup: "typography", + bubblesVirtually: bubblesVirtually, + label: (0,external_wp_i18n_namespaceObject.__)('Typography') + }), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + __experimentalGroup: "dimensions", + bubblesVirtually: bubblesVirtually, + label: (0,external_wp_i18n_namespaceObject.__)('Dimensions') + }), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + __experimentalGroup: "border", + label: (0,external_wp_i18n_namespaceObject.__)('Border') + }), (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(AdvancedControls, { + bubblesVirtually: bubblesVirtually + })), (0,external_wp_element_namespaceObject.createElement)(skip_to_selected_block, { + key: "back" + })); +}; + +const AdvancedControls = _ref3 => { + let { + bubblesVirtually + } = _ref3; + const slot = (0,external_wp_components_namespaceObject.__experimentalUseSlot)(InspectorAdvancedControls.slotName); + const hasFills = Boolean(slot.fills && slot.fills.length); + + if (!hasFills) { + return null; + } + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + className: "block-editor-block-inspector__advanced", + title: (0,external_wp_i18n_namespaceObject.__)('Advanced'), + initialOpen: false + }, (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, { + __experimentalGroup: "advanced", + bubblesVirtually: bubblesVirtually + })); +}; + +/* harmony default export */ var block_inspector = (BlockInspector); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/index.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + +/** + * Renders block tools (the block toolbar, select/navigation mode toolbar, the + * insertion point and a slot for the inline rich text toolbar). Must be wrapped + * around the block content and editor styles wrapper or iframe. + * + * @param {Object} $0 Props. + * @param {Object} $0.children The block content and style container. + * @param {Object} $0.__unstableContentRef Ref holding the content scroll container. + */ + +function BlockTools(_ref) { + let { + children, + __unstableContentRef, + ...props + } = _ref; + const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); + const hasFixedToolbar = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().hasFixedToolbar, []); + const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)(); + const { + getSelectedBlockClientIds, + getBlockRootClientId + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + duplicateBlocks, + removeBlocks, + insertAfterBlock, + insertBeforeBlock, + clearSelectedBlock, + moveBlocksUp, + moveBlocksDown + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + + function onKeyDown(event) { + if (isMatch('core/block-editor/move-up', event)) { + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length) { + event.preventDefault(); + const rootClientId = getBlockRootClientId((0,external_lodash_namespaceObject.first)(clientIds)); + moveBlocksUp(clientIds, rootClientId); + } + } else if (isMatch('core/block-editor/move-down', event)) { + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length) { + event.preventDefault(); + const rootClientId = getBlockRootClientId((0,external_lodash_namespaceObject.first)(clientIds)); + moveBlocksDown(clientIds, rootClientId); + } + } else if (isMatch('core/block-editor/duplicate', event)) { + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length) { + event.preventDefault(); + duplicateBlocks(clientIds); + } + } else if (isMatch('core/block-editor/remove', event)) { + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length) { + event.preventDefault(); + removeBlocks(clientIds); + } + } else if (isMatch('core/block-editor/insert-after', event)) { + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length) { + event.preventDefault(); + insertAfterBlock((0,external_lodash_namespaceObject.last)(clientIds)); + } + } else if (isMatch('core/block-editor/insert-before', event)) { + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length) { + event.preventDefault(); + insertBeforeBlock((0,external_lodash_namespaceObject.first)(clientIds)); + } + } else if (isMatch('core/block-editor/delete-multi-selection', event)) { + /** + * Check if the target element is a text area, input or + * event.defaultPrevented and return early. In all these + * cases backspace could be handled elsewhere. + */ + if (['INPUT', 'TEXTAREA'].includes(event.target.nodeName) || event.defaultPrevented) { + return; + } + + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length > 1) { + event.preventDefault(); + removeBlocks(clientIds); + } + } else if (isMatch('core/block-editor/unselect', event)) { + const clientIds = getSelectedBlockClientIds(); + + if (clientIds.length > 1) { + event.preventDefault(); + clearSelectedBlock(); + event.target.ownerDocument.defaultView.getSelection().removeAllRanges(); + } + } + } + + return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions + (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, props, { + onKeyDown: onKeyDown + }), (0,external_wp_element_namespaceObject.createElement)(InsertionPoint, { + __unstableContentRef: __unstableContentRef + }, (hasFixedToolbar || !isLargeViewport) && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar, { + isFixed: true + }), (0,external_wp_element_namespaceObject.createElement)(WrappedBlockPopover, { + __unstableContentRef: __unstableContentRef + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, { + name: "block-toolbar", + ref: usePopoverScroll(__unstableContentRef) + }), children, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, { + name: "__unstable-block-tools-after", + ref: usePopoverScroll(__unstableContentRef) + }))) + ); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/library.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +function InserterLibrary(_ref) { + let { + rootClientId, + clientId, + isAppender, + showInserterHelpPanel, + showMostUsedBlocks = false, + __experimentalInsertionIndex, + __experimentalFilterValue, + onSelect = external_lodash_namespaceObject.noop, + shouldFocusBlock = false + } = _ref; + const destinationRootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockRootClientId + } = select(store); + return rootClientId || getBlockRootClientId(clientId) || undefined; + }, [clientId, rootClientId]); + return (0,external_wp_element_namespaceObject.createElement)(menu, { + onSelect: onSelect, + rootClientId: destinationRootClientId, + clientId: clientId, + isAppender: isAppender, + showInserterHelpPanel: showInserterHelpPanel, + showMostUsedBlocks: showMostUsedBlocks, + __experimentalInsertionIndex: __experimentalInsertionIndex, + __experimentalFilterValue: __experimentalFilterValue, + shouldFocusBlock: shouldFocusBlock + }); +} + +/* harmony default export */ var library = (InserterLibrary); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/keyboard-shortcuts/index.js +/** + * WordPress dependencies + */ + + + + + +function KeyboardShortcuts() { + return null; +} + +function KeyboardShortcutsRegister() { + // Registering the shortcuts + const { + registerShortcut + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + registerShortcut({ + name: 'core/block-editor/duplicate', + category: 'block', + description: (0,external_wp_i18n_namespaceObject.__)('Duplicate the selected block(s).'), + keyCombination: { + modifier: 'primaryShift', + character: 'd' + } + }); + registerShortcut({ + name: 'core/block-editor/remove', + category: 'block', + description: (0,external_wp_i18n_namespaceObject.__)('Remove the selected block(s).'), + keyCombination: { + modifier: 'access', + character: 'z' + } + }); + registerShortcut({ + name: 'core/block-editor/insert-before', + category: 'block', + description: (0,external_wp_i18n_namespaceObject.__)('Insert a new block before the selected block(s).'), + keyCombination: { + modifier: 'primaryAlt', + character: 't' + } + }); + registerShortcut({ + name: 'core/block-editor/insert-after', + category: 'block', + description: (0,external_wp_i18n_namespaceObject.__)('Insert a new block after the selected block(s).'), + keyCombination: { + modifier: 'primaryAlt', + character: 'y' + } + }); + registerShortcut({ + name: 'core/block-editor/delete-multi-selection', + category: 'block', + description: (0,external_wp_i18n_namespaceObject.__)('Remove multiple selected blocks.'), + keyCombination: { + character: 'del' + }, + aliases: [{ + character: 'backspace' + }] + }); + registerShortcut({ + name: 'core/block-editor/select-all', + category: 'selection', + description: (0,external_wp_i18n_namespaceObject.__)('Select all text when typing. Press again to select all blocks.'), + keyCombination: { + modifier: 'primary', + character: 'a' + } + }); + registerShortcut({ + name: 'core/block-editor/unselect', + category: 'selection', + description: (0,external_wp_i18n_namespaceObject.__)('Clear selection.'), + keyCombination: { + character: 'escape' + } + }); + registerShortcut({ + name: 'core/block-editor/focus-toolbar', + category: 'global', + description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the nearest toolbar.'), + keyCombination: { + modifier: 'alt', + character: 'F10' + } + }); + registerShortcut({ + name: 'core/block-editor/move-up', + category: 'block', + description: (0,external_wp_i18n_namespaceObject.__)('Move the selected block(s) up.'), + keyCombination: { + modifier: 'secondary', + character: 't' + } + }); + registerShortcut({ + name: 'core/block-editor/move-down', + category: 'block', + description: (0,external_wp_i18n_namespaceObject.__)('Move the selected block(s) down.'), + keyCombination: { + modifier: 'secondary', + character: 'y' + } + }); + }, [registerShortcut]); + return null; +} + +KeyboardShortcuts.Register = KeyboardShortcutsRegister; +/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/selection-scroll-into-view/index.js +/** + * WordPress dependencies + */ + +/** + * Scrolls the multi block selection end into view if not in view already. This + * is important to do after selection by keyboard. + * + * @deprecated + */ + +function MultiSelectScrollIntoView() { + external_wp_deprecated_default()('wp.blockEditor.MultiSelectScrollIntoView', { + hint: 'This behaviour is now built-in.' + }); + return null; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/observe-typing/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * Set of key codes upon which typing is to be initiated on a keydown event. + * + * @type {Set} + */ + +const KEY_DOWN_ELIGIBLE_KEY_CODES = new Set([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.RIGHT, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.ENTER, external_wp_keycodes_namespaceObject.BACKSPACE]); +/** + * Returns true if a given keydown event can be inferred as intent to start + * typing, or false otherwise. A keydown is considered eligible if it is a + * text navigation without shift active. + * + * @param {KeyboardEvent} event Keydown event to test. + * + * @return {boolean} Whether event is eligible to start typing. + */ + +function isKeyDownEligibleForStartTyping(event) { + const { + keyCode, + shiftKey + } = event; + return !shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has(keyCode); +} +/** + * Removes the `isTyping` flag when the mouse moves in the document of the given + * element. + */ + + +function useMouseMoveTypingReset() { + const isTyping = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isTyping(), []); + const { + stopTyping + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + if (!isTyping) { + return; + } + + const { + ownerDocument + } = node; + let lastClientX; + let lastClientY; + /** + * On mouse move, unset typing flag if user has moved cursor. + * + * @param {MouseEvent} event Mousemove event. + */ + + function stopTypingOnMouseMove(event) { + const { + clientX, + clientY + } = event; // We need to check that the mouse really moved because Safari + // triggers mousemove events when shift or ctrl are pressed. + + if (lastClientX && lastClientY && (lastClientX !== clientX || lastClientY !== clientY)) { + stopTyping(); + } + + lastClientX = clientX; + lastClientY = clientY; + } + + ownerDocument.addEventListener('mousemove', stopTypingOnMouseMove); + return () => { + ownerDocument.removeEventListener('mousemove', stopTypingOnMouseMove); + }; + }, [isTyping, stopTyping]); +} +/** + * Sets and removes the `isTyping` flag based on user actions: + * + * - Sets the flag if the user types within the given element. + * - Removes the flag when the user selects some text, focusses a non-text + * field, presses ESC or TAB, or moves the mouse in the document. + */ + +function useTypingObserver() { + const isTyping = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isTyping()); + const { + startTyping, + stopTyping + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const ref1 = useMouseMoveTypingReset(); + const ref2 = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + const { + ownerDocument + } = node; + const { + defaultView + } = ownerDocument; // Listeners to stop typing should only be added when typing. + // Listeners to start typing should only be added when not typing. + + if (isTyping) { + let timerId; + /** + * Stops typing when focus transitions to a non-text field element. + * + * @param {FocusEvent} event Focus event. + */ + + function stopTypingOnNonTextField(event) { + const { + target + } = event; // Since focus to a non-text field via arrow key will trigger + // before the keydown event, wait until after current stack + // before evaluating whether typing is to be stopped. Otherwise, + // typing will re-start. + + timerId = defaultView.setTimeout(() => { + if (!(0,external_wp_dom_namespaceObject.isTextField)(target)) { + stopTyping(); + } + }); + } + /** + * Unsets typing flag if user presses Escape while typing flag is + * active. + * + * @param {KeyboardEvent} event Keypress or keydown event to + * interpret. + */ + + + function stopTypingOnEscapeKey(event) { + const { + keyCode + } = event; + + if (keyCode === external_wp_keycodes_namespaceObject.ESCAPE || keyCode === external_wp_keycodes_namespaceObject.TAB) { + stopTyping(); + } + } + /** + * On selection change, unset typing flag if user has made an + * uncollapsed (shift) selection. + */ + + + function stopTypingOnSelectionUncollapse() { + const selection = defaultView.getSelection(); + const isCollapsed = selection.rangeCount > 0 && selection.getRangeAt(0).collapsed; + + if (!isCollapsed) { + stopTyping(); + } + } + + node.addEventListener('focus', stopTypingOnNonTextField); + node.addEventListener('keydown', stopTypingOnEscapeKey); + ownerDocument.addEventListener('selectionchange', stopTypingOnSelectionUncollapse); + return () => { + defaultView.clearTimeout(timerId); + node.removeEventListener('focus', stopTypingOnNonTextField); + node.removeEventListener('keydown', stopTypingOnEscapeKey); + ownerDocument.removeEventListener('selectionchange', stopTypingOnSelectionUncollapse); + }; + } + /** + * Handles a keypress or keydown event to infer intention to start + * typing. + * + * @param {KeyboardEvent} event Keypress or keydown event to interpret. + */ + + + function startTypingInTextField(event) { + const { + type, + target + } = event; // Abort early if already typing, or key press is incurred outside a + // text field (e.g. arrow-ing through toolbar buttons). + // Ignore typing if outside the current DOM container + + if (!(0,external_wp_dom_namespaceObject.isTextField)(target) || !node.contains(target)) { + return; + } // Special-case keydown because certain keys do not emit a keypress + // event. Conversely avoid keydown as the canonical event since + // there are many keydown which are explicitly not targeted for + // typing. + + + if (type === 'keydown' && !isKeyDownEligibleForStartTyping(event)) { + return; + } + + startTyping(); + } + + node.addEventListener('keypress', startTypingInTextField); + node.addEventListener('keydown', startTypingInTextField); + return () => { + node.removeEventListener('keypress', startTypingInTextField); + node.removeEventListener('keydown', startTypingInTextField); + }; + }, [isTyping, startTyping, stopTyping]); + return (0,external_wp_compose_namespaceObject.useMergeRefs)([ref1, ref2]); +} + +function ObserveTyping(_ref) { + let { + children + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { + ref: useTypingObserver() + }, children); +} +/** + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md + */ + + +/* harmony default export */ var observe_typing = (ObserveTyping); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/preserve-scroll-in-reorder/index.js +/** + * WordPress dependencies + */ + +function PreserveScrollInReorder() { + external_wp_deprecated_default()('PreserveScrollInReorder component', { + since: '5.4', + hint: 'This behavior is now built-in the block list' + }); + return null; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/typewriter/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +const isIE = window.navigator.userAgent.indexOf('Trident') !== -1; +const arrowKeyCodes = new Set([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT]); +const initialTriggerPercentage = 0.75; +function useTypewriter() { + const hasSelectedBlock = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasSelectedBlock(), []); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + if (!hasSelectedBlock) { + return; + } + + const { + ownerDocument + } = node; + const { + defaultView + } = ownerDocument; + let scrollResizeRafId; + let onKeyDownRafId; + let caretRect; + + function onScrollResize() { + if (scrollResizeRafId) { + return; + } + + scrollResizeRafId = defaultView.requestAnimationFrame(() => { + computeCaretRectangle(); + scrollResizeRafId = null; + }); + } + + function onKeyDown(event) { + // Ensure the any remaining request is cancelled. + if (onKeyDownRafId) { + defaultView.cancelAnimationFrame(onKeyDownRafId); + } // Use an animation frame for a smooth result. + + + onKeyDownRafId = defaultView.requestAnimationFrame(() => { + maintainCaretPosition(event); + onKeyDownRafId = null; + }); + } + /** + * Maintains the scroll position after a selection change caused by a + * keyboard event. + * + * @param {KeyboardEvent} event Keyboard event. + */ + + + function maintainCaretPosition(_ref) { + let { + keyCode + } = _ref; + + if (!isSelectionEligibleForScroll()) { + return; + } + + const currentCaretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView); + + if (!currentCaretRect) { + return; + } // If for some reason there is no position set to be scrolled to, let + // this be the position to be scrolled to in the future. + + + if (!caretRect) { + caretRect = currentCaretRect; + return; + } // Even though enabling the typewriter effect for arrow keys results in + // a pleasant experience, it may not be the case for everyone, so, for + // now, let's disable it. + + + if (arrowKeyCodes.has(keyCode)) { + // Reset the caret position to maintain. + caretRect = currentCaretRect; + return; + } + + const diff = currentCaretRect.top - caretRect.top; + + if (diff === 0) { + return; + } + + const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(node); // The page must be scrollable. + + if (!scrollContainer) { + return; + } + + const windowScroll = scrollContainer === ownerDocument.body; + const scrollY = windowScroll ? defaultView.scrollY : scrollContainer.scrollTop; + const scrollContainerY = windowScroll ? 0 : scrollContainer.getBoundingClientRect().top; + const relativeScrollPosition = windowScroll ? caretRect.top / defaultView.innerHeight : (caretRect.top - scrollContainerY) / (defaultView.innerHeight - scrollContainerY); // If the scroll position is at the start, the active editable element + // is the last one, and the caret is positioned within the initial + // trigger percentage of the page, do not scroll the page. + // The typewriter effect should not kick in until an empty page has been + // filled with the initial trigger percentage or the user scrolls + // intentionally down. + + if (scrollY === 0 && relativeScrollPosition < initialTriggerPercentage && isLastEditableNode()) { + // Reset the caret position to maintain. + caretRect = currentCaretRect; + return; + } + + const scrollContainerHeight = windowScroll ? defaultView.innerHeight : scrollContainer.clientHeight; // Abort if the target scroll position would scroll the caret out of + // view. + + if ( // The caret is under the lower fold. + caretRect.top + caretRect.height > scrollContainerY + scrollContainerHeight || // The caret is above the upper fold. + caretRect.top < scrollContainerY) { + // Reset the caret position to maintain. + caretRect = currentCaretRect; + return; + } + + if (windowScroll) { + defaultView.scrollBy(0, diff); + } else { + scrollContainer.scrollTop += diff; + } + } + /** + * Adds a `selectionchange` listener to reset the scroll position to be + * maintained. + */ + + + function addSelectionChangeListener() { + ownerDocument.addEventListener('selectionchange', computeCaretRectOnSelectionChange); + } + /** + * Resets the scroll position to be maintained during a `selectionchange` + * event. Also removes the listener, so it acts as a one-time listener. + */ + + + function computeCaretRectOnSelectionChange() { + ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange); + computeCaretRectangle(); + } + /** + * Resets the scroll position to be maintained. + */ + + + function computeCaretRectangle() { + if (isSelectionEligibleForScroll()) { + caretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView); + } + } + /** + * Checks if the current situation is elegible for scroll: + * - There should be one and only one block selected. + * - The component must contain the selection. + * - The active element must be contenteditable. + */ + + + function isSelectionEligibleForScroll() { + return node.contains(ownerDocument.activeElement) && ownerDocument.activeElement.isContentEditable; + } + + function isLastEditableNode() { + const editableNodes = node.querySelectorAll('[contenteditable="true"]'); + const lastEditableNode = editableNodes[editableNodes.length - 1]; + return lastEditableNode === ownerDocument.activeElement; + } // When the user scrolls or resizes, the scroll position should be + // reset. + + + defaultView.addEventListener('scroll', onScrollResize, true); + defaultView.addEventListener('resize', onScrollResize, true); + node.addEventListener('keydown', onKeyDown); + node.addEventListener('keyup', maintainCaretPosition); + node.addEventListener('mousedown', addSelectionChangeListener); + node.addEventListener('touchstart', addSelectionChangeListener); + return () => { + defaultView.removeEventListener('scroll', onScrollResize, true); + defaultView.removeEventListener('resize', onScrollResize, true); + node.removeEventListener('keydown', onKeyDown); + node.removeEventListener('keyup', maintainCaretPosition); + node.removeEventListener('mousedown', addSelectionChangeListener); + node.removeEventListener('touchstart', addSelectionChangeListener); + ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange); + defaultView.cancelAnimationFrame(scrollResizeRafId); + defaultView.cancelAnimationFrame(onKeyDownRafId); + }; + }, [hasSelectedBlock]); +} + +function Typewriter(_ref2) { + let { + children + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)("div", { + ref: useTypewriter(), + className: "block-editor__typewriter" + }, children); +} +/** + * The exported component. The implementation of Typewriter faced technical + * challenges in Internet Explorer, and is simply skipped, rendering the given + * props children instead. + * + * @type {WPComponent} + */ + + +const TypewriterOrIEBypass = isIE ? props => props.children : Typewriter; +/** + * Ensures that the text selection keeps the same vertical distance from the + * viewport during keyboard events within this component. The vertical distance + * can vary. It is the last clicked or scrolled to position. + */ + +/* harmony default export */ var typewriter = (TypewriterOrIEBypass); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-canvas-click-redirect/index.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Given an element, returns true if the element is a tabbable text field, or + * false otherwise. + * + * @param {Element} element Element to test. + * + * @return {boolean} Whether element is a tabbable text field. + */ + +const isTabbableTextField = (0,external_lodash_namespaceObject.overEvery)([external_wp_dom_namespaceObject.isTextField, external_wp_dom_namespaceObject.focus.tabbable.isTabbableIndex]); +function useCanvasClickRedirect() { + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function onMouseDown(event) { + // Only handle clicks on the canvas, not the content. + if (event.target !== node) { + return; + } + + const focusableNodes = external_wp_dom_namespaceObject.focus.focusable.find(node); + const target = (0,external_lodash_namespaceObject.findLast)(focusableNodes, isTabbableTextField); + + if (!target) { + return; + } + + const { + bottom + } = target.getBoundingClientRect(); // Ensure the click is below the last block. + + if (event.clientY < bottom) { + return; + } + + (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, true); + event.preventDefault(); + } + + node.addEventListener('mousedown', onMouseDown); + return () => { + node.addEventListener('mousedown', onMouseDown); + }; + }, []); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-no-recursive-renders/index.js + + +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const RenderedRefsContext = (0,external_wp_element_namespaceObject.createContext)({}); +/** + * Immutably adds an unique identifier to a set scoped for a given block type. + * + * @param {Object} renderedBlocks Rendered blocks grouped by block name + * @param {string} blockName Name of the block. + * @param {*} uniqueId Any value that acts as a unique identifier for a block instance. + * + * @return {Object} The list of rendered blocks grouped by block name. + */ + +function addToBlockType(renderedBlocks, blockName, uniqueId) { + const result = { ...renderedBlocks, + [blockName]: renderedBlocks[blockName] ? new Set(renderedBlocks[blockName]) : new Set() + }; + result[blockName].add(uniqueId); + return result; +} +/** + * A React hook for keeping track of blocks previously rendered up in the block + * tree. Blocks susceptible to recursion can use this hook in their `Edit` + * function to prevent said recursion. + * + * @param {*} uniqueId Any value that acts as a unique identifier for a block instance. + * @param {string} blockName Optional block name. + * + * @return {[boolean, Function]} A tuple of: + * - a boolean describing whether the provided id + * has already been rendered; + * - a React context provider to be used to wrap + * other elements. + */ + + +function useNoRecursiveRenders(uniqueId) { + var _previouslyRenderedBl; + + let blockName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + const previouslyRenderedBlocks = (0,external_wp_element_namespaceObject.useContext)(RenderedRefsContext); + const { + name + } = useBlockEditContext(); + blockName = blockName || name; + const hasAlreadyRendered = Boolean((_previouslyRenderedBl = previouslyRenderedBlocks[blockName]) === null || _previouslyRenderedBl === void 0 ? void 0 : _previouslyRenderedBl.has(uniqueId)); + const newRenderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => addToBlockType(previouslyRenderedBlocks, blockName, uniqueId), [previouslyRenderedBlocks, blockName, uniqueId]); + const Provider = (0,external_wp_element_namespaceObject.useCallback)(_ref => { + let { + children + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(RenderedRefsContext.Provider, { + value: newRenderedBlocks + }, children); + }, [newRenderedBlocks]); + return [hasAlreadyRendered, Provider]; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/index.js +/* + * Block Creation Components + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* + * Content Related Components + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* + * State Related Components + */ + + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/theme.js +/** + * Internal dependencies + */ + +/** + * Given an array of theme colors checks colors for validity + * + * @param {Array} colors The array of theme colors + * + * @return {Array} The array of valid theme colors or the default colors + */ + +function validateThemeColors(colors) { + if (colors === undefined) { + colors = SETTINGS_DEFAULTS.colors; + } else { + const validColors = colors.filter(c => c.color); + + if (validColors.length === 0) { + colors = SETTINGS_DEFAULTS.colors; + } else if (validColors.length < colors.length) { + // Filter out invalid colors + colors = validColors; + } + } + + return colors; +} +/** + * Given an array of theme gradients checks gradients for validity + * + * @param {Array} gradients The array of theme gradients + * + * @return {Array} The array of valid theme gradients or the default gradients + */ + +function validateThemeGradients(gradients) { + if (gradients === undefined) { + gradients = SETTINGS_DEFAULTS.gradients; + } else { + const validGradients = gradients.filter(c => c.gradient); + + if (validGradients.length === 0) { + gradients = SETTINGS_DEFAULTS.gradients; + } else if (validGradients.length < gradients.length) { + // Filter out invalid gradients + gradients = validGradients; + } + } + + return gradients; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/parse-css-unit-to-px.js +/** + * Converts string to object { value, unit }. + * + * @param {string} cssUnit + * @return {Object} parsedUnit + */ +function parseUnit(cssUnit) { + const match = cssUnit === null || cssUnit === void 0 ? void 0 : cssUnit.trim().match(/^(0?[-.]?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/); + + if (!isNaN(cssUnit) && !isNaN(parseFloat(cssUnit))) { + return { + value: parseFloat(cssUnit), + unit: 'px' + }; + } + + return match ? { + value: parseFloat(match[1]) || match[1], + unit: match[2] + } : { + value: cssUnit, + unit: undefined + }; +} +/** + * Evaluate a math expression. + * + * @param {string} expression + * @return {number} evaluated expression. + */ + + +function calculate(expression) { + return Function(`'use strict'; return (${expression})`)(); +} +/** + * Calculates the css function value for the supported css functions such as max, min, clamp and calc. + * + * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops. + * @param {Object} options + * @return {string} unit containing the unit in PX. + */ + + +function getFunctionUnitValue(functionUnitValue, options) { + const functionUnit = functionUnitValue.split(/[(),]/g).filter(Boolean); + const units = functionUnit.slice(1).map(unit => parseUnit(getPxFromCssUnit(unit, options)).value).filter(Boolean); + + switch (functionUnit[0]) { + case 'min': + return Math.min(...units) + 'px'; + + case 'max': + return Math.max(...units) + 'px'; + + case 'clamp': + if (units.length !== 3) { + return null; + } + + if (units[1] < units[0]) { + return units[0] + 'px'; + } + + if (units[1] > units[2]) { + return units[2] + 'px'; + } + + return units[1] + 'px'; + + case 'calc': + return units[0] + 'px'; + } +} +/** + * Take a css function such as min, max, calc, clamp and returns parsedUnit + * + * How this works for the nested function is that it first replaces the inner function call. + * Then it tackles the outer onces. + * So for example: min( max(25px, 35px), 40px ) + * in the first pass we would replace max(25px, 35px) with 35px. + * then we would try to evaluate min( 35px, 40px ) + * and then finally return 35px. + * + * @param {string} cssUnit + * @return {Object} parsedUnit object. + */ + + +function parseUnitFunction(cssUnit) { + while (true) { + const currentCssUnit = cssUnit; + const regExp = /(max|min|calc|clamp)\(([^()]*)\)/g; + const matches = regExp.exec(cssUnit) || []; + + if (matches[0]) { + const functionUnitValue = getFunctionUnitValue(matches[0]); + cssUnit = cssUnit.replace(matches[0], functionUnitValue); + } // if the unit hasn't been modified or we have a single value break free. + + + if (cssUnit === currentCssUnit || parseFloat(cssUnit)) { + break; + } + } + + return parseUnit(cssUnit); +} +/** + * Return true if we think this is a math expression. + * + * @param {string} cssUnit the cssUnit value being evaluted. + * @return {boolean} Whether the cssUnit is a math expression. + */ + + +function isMathExpression(cssUnit) { + for (let i = 0; i < cssUnit.length; i++) { + if (['+', '-', '/', '*'].includes(cssUnit[i])) { + return true; + } + } + + return false; +} +/** + * Evaluates the math expression and return a px value. + * + * @param {string} cssUnit the cssUnit value being evaluted. + * @return {string} return a converfted value to px. + */ + + +function evalMathExpression(cssUnit) { + let errorFound = false; // Convert every part of the expression to px values. + + const cssUnitsBits = cssUnit.split(/[+-/*/]/g).filter(Boolean); + + for (const unit of cssUnitsBits) { + // Standardize the unit to px and extract the value. + const parsedUnit = parseUnit(getPxFromCssUnit(unit)); + + if (!parseFloat(parsedUnit.value)) { + errorFound = true; // end early since we are dealing with a null value. + + break; + } + + cssUnit = cssUnit.replace(unit, parsedUnit.value); + } + + return errorFound ? null : calculate(cssUnit).toFixed(0) + 'px'; +} +/** + * Convert a parsedUnit object to px value. + * + * @param {Object} parsedUnit + * @param {Object} options + * @return {string} or {null} returns the converted with in a px value format. + */ + + +function convertParsedUnitToPx(parsedUnit, options) { + const PIXELS_PER_INCH = 96; + const ONE_PERCENT = 0.01; + const defaultProperties = { + fontSize: 16, + lineHeight: 16, + width: 375, + height: 812, + type: 'font' + }; + const setOptions = Object.assign({}, defaultProperties, options); + const relativeUnits = { + em: setOptions.fontSize, + rem: setOptions.fontSize, + vh: setOptions.height * ONE_PERCENT, + vw: setOptions.width * ONE_PERCENT, + vmin: (setOptions.width < setOptions.height ? setOptions.width : setOptions.height) * ONE_PERCENT, + vmax: (setOptions.width > setOptions.height ? setOptions.width : setOptions.height) * ONE_PERCENT, + '%': (setOptions.type === 'font' ? setOptions.fontSize : setOptions.width) * ONE_PERCENT, + ch: 8, + // The advance measure (width) of the glyph "0" of the element's font. Approximate + ex: 7.15625, + // x-height of the element's font. Approximate + lh: setOptions.lineHeight + }; + const absoluteUnits = { + in: PIXELS_PER_INCH, + cm: PIXELS_PER_INCH / 2.54, + mm: PIXELS_PER_INCH / 25.4, + pt: PIXELS_PER_INCH / 72, + pc: PIXELS_PER_INCH / 6, + px: 1, + Q: PIXELS_PER_INCH / 2.54 / 40 + }; + + if (relativeUnits[parsedUnit.unit]) { + return (relativeUnits[parsedUnit.unit] * parsedUnit.value).toFixed(0) + 'px'; + } + + if (absoluteUnits[parsedUnit.unit]) { + return (absoluteUnits[parsedUnit.unit] * parsedUnit.value).toFixed(0) + 'px'; + } + + return null; +} +/** + * Returns the px value of a cssUnit. + * + * @param {string} cssUnit + * @param {Object} options + * @return {string} returns the cssUnit value in a simple px format. + */ + + +function getPxFromCssUnit(cssUnit) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (Number.isFinite(cssUnit)) { + return cssUnit.toFixed(0) + 'px'; + } + + if (cssUnit === undefined) { + return null; + } + + let parsedUnit = parseUnit(cssUnit); + + if (!parsedUnit.unit) { + parsedUnit = parseUnitFunction(cssUnit, options); + } + + if (isMathExpression(cssUnit) && !parsedUnit.unit) { + return evalMathExpression(cssUnit); + } + + return convertParsedUnitToPx(parsedUnit, options); +} // Use simple cache. + +const cache = {}; +/** + * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit; + * + * @param {string} cssUnit + * @param {Object} options + * @return {string} returns the cssUnit value in a simple px format. + */ + +function memoizedGetPxFromCssUnit(cssUnit) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const hash = cssUnit + hashOptions(options); + + if (!cache[hash]) { + cache[hash] = getPxFromCssUnit(cssUnit, options); + } + + return cache[hash]; +} + +function hashOptions(options) { + let hash = ''; + + if (options.hasOwnProperty('fontSize')) { + hash = ':' + options.width; + } + + if (options.hasOwnProperty('lineHeight')) { + hash = ':' + options.lineHeight; + } + + if (options.hasOwnProperty('width')) { + hash = ':' + options.width; + } + + if (options.hasOwnProperty('height')) { + hash = ':' + options.height; + } + + if (options.hasOwnProperty('type')) { + hash = ':' + options.type; + } + + return hash; +} + +/* harmony default export */ var parse_css_unit_to_px = (memoizedGetPxFromCssUnit); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/index.js + + + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/index.js +/** + * Internal dependencies + */ + + + + + + + +}(); +(window.wp = window.wp || {}).blockEditor = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/wp-includes/js/dist/block-editor.min.js b/wp-includes/js/dist/block-editor.min.js index 4fea7dbcb3..c076095879 100644 --- a/wp-includes/js/dist/block-editor.min.js +++ b/wp-includes/js/dist/block-editor.min.js @@ -1,15 +1,15 @@ /*! This file is auto-generated */ -this.wp=this.wp||{},this.wp.blockEditor=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="tr0p")}({"+0ps":function(e,t,n){"use strict";n.d(t,"c",(function(){return b})),n.d(t,"b",(function(){return p}));var o=n("GRId"),r=n("HSyU"),c=n("1CF3"),l=n("1ZqX"),i=n("l3Sj"),a=n("onLe"),s=n("K9lf"),u=n("xTGt");var d=n("BhPs");function b(){const{getBlockName:e}=Object(l.useSelect)(d.a),{getBlockType:t}=Object(l.useSelect)(r.store),{createSuccessNotice:n}=Object(l.useDispatch)(a.store);return Object(o.useCallback)((o,r)=>{let c="";if(1===r.length){var l;const n=r[0],a=null===(l=t(e(n)))||void 0===l?void 0:l.title;c="copy"===o?Object(i.sprintf)(Object(i.__)('Copied "%s" to clipboard.'),a):Object(i.sprintf)(Object(i.__)('Moved "%s" to clipboard.'),a)}else c="copy"===o?Object(i.sprintf)(Object(i._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):Object(i.sprintf)(Object(i._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(c,{type:"snackbar"})},[])}function p(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=Object(l.useSelect)(d.a),{flashBlock:i,removeBlocks:a,replaceBlocks:p}=Object(l.useDispatch)(d.a),m=b();return Object(s.useRefEffect)(l=>{function s(s){const d=t();if(0===d.length)return;if(!n()){const{target:e}=s,{ownerDocument:t}=e;if("copy"===s.type||"cut"===s.type?Object(c.documentHasUncollapsedSelection)(t):Object(c.documentHasSelection)(t))return}if(!l.contains(s.target.ownerDocument.activeElement))return;const b=s.defaultPrevented;if(s.preventDefault(),"copy"===s.type||"cut"===s.type){1===d.length&&i(d[0]),m(s.type,d);const t=e(d),n=Object(r.serialize)(t);s.clipboardData.setData("text/plain",n),s.clipboardData.setData("text/html",n)}if("cut"===s.type)a(d);else if("paste"===s.type){if(b)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=Object(c.getFilesFromDataTransfer)(t).filter(e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif)$/.test(t)});return r.length&&!o&&(o=r.map(e=>``).join(""),n=""),{html:o,plainText:n}}(s),l=Object(r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(d,l,l.length-1,-1)}}return l.ownerDocument.addEventListener("copy",s),l.ownerDocument.addEventListener("cut",s),l.ownerDocument.addEventListener("paste",s),()=>{l.ownerDocument.removeEventListener("copy",s),l.ownerDocument.removeEventListener("cut",s),l.ownerDocument.removeEventListener("paste",s)}},[])}t.a=function(e){let{children:t}=e;return Object(o.createElement)("div",{ref:p()},t)}},"+6d5":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("TSYQ"),r=n.n(o),c=n("1ZqX"),l=n("BhPs");function i(e){return Object(c.useSelect)(t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:c,getBlockRootClientId:i,isBlockSelected:a}=t(l.a);if(!a(e))return;const s=n();return s?r()("is-block-moving-mode",{"can-insert-moving-block":o(c(s),i(e))}):void 0},[e])}},"+DUQ":function(e,t,n){"use strict";n.d(t,"animated",(function(){return y}));var o=n("kmrn");n.o(o,"useSpring")&&n.d(t,"useSpring",(function(){return o.useSpring}));var r=n("faye"),c=n("nEW0"),l=n("dfZa");function i(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const a=["style","children","scrollTop","scrollLeft"],s=/^--/;function u(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||s.test(e)||b.hasOwnProperty(e)&&b[e]?(""+t).trim():t+"px"}const d={};let b={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};const p=["Webkit","Ms","Moz","O"];b=Object.keys(b).reduce((e,t)=>(p.forEach(n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t]),e),b);const m=["x","y","z"],f=/^(matrix|translate|scale|rotate|skew)/,h=/^(translate)/,g=/^(rotate|skew)/,O=(e,t)=>c.s.num(e)&&0!==e?e+t:e,v=(e,t)=>c.s.arr(e)?e.every(e=>v(e,t)):c.s.num(e)?e===t:parseFloat(e)===t;class j extends l.a{constructor(e){let{x:t,y:n,z:o}=e,r=i(e,m);const l=[],a=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),a.push(e=>[`translate3d(${e.map(e=>O(e,"px")).join(",")})`,v(e,0)])),Object(c.l)(r,(e,t)=>{if("transform"===t)l.push([e||""]),a.push(e=>[e,""===e]);else if(f.test(t)){if(delete r[t],c.s.und(e))return;const n=h.test(t)?"px":g.test(t)?"deg":"";l.push(Object(c.y)(e)),a.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${O(r,n)})`,v(r,0)]:e=>[`${t}(${e.map(e=>O(e,n)).join(",")})`,v(e,t.startsWith("scale")?1:0)])}}),l.length&&(r.transform=new k(l,a)),super(r)}}class k extends c.a{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Object(c.k)(this.inputs,(n,o)=>{const r=Object(c.q)(n[0]),[l,i]=this.transforms[o](c.s.arr(r)?r:n.map(c.q));e+=" "+l,t=t&&i}),t?"none":e}observerAdded(e){1==e&&Object(c.k)(this.inputs,e=>Object(c.k)(e,e=>Object(c.r)(e)&&Object(c.c)(e,this)))}observerRemoved(e){0==e&&Object(c.k)(this.inputs,e=>Object(c.k)(e,e=>Object(c.r)(e)&&Object(c.x)(e,this)))}eventObserved(e){"change"==e.type&&(this._value=null),Object(c.d)(this,e)}}const _=["scrollTop","scrollLeft"];o.Globals.assign({batchedUpdates:r.unstable_batchedUpdates,createStringInterpolator:c.g,colors:c.e});const y=Object(l.d)(["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;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:c,scrollTop:l,scrollLeft:b}=o,p=i(o,a),m=Object.values(p),f=Object.keys(p).map(t=>n||e.hasAttribute(t)?t:d[t]||(d[t]=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase())));void 0!==c&&(e.textContent=c);for(let t in r)if(r.hasOwnProperty(t)){const n=u(t,r[t]);s.test(t)?e.style.setProperty(t,n):e.style[t]=n}f.forEach((t,n)=>{e.setAttribute(t,m[n])}),void 0!==l&&(e.scrollTop=l),void 0!==b&&(e.scrollLeft=b)},createAnimatedStyle:e=>new j(e),getComponentProps:e=>i(e,_)}).animated},"+G0a":function(e,t,n){"use strict";var o=n("HSyU"),r=n("1ZqX"),c=n("GRId"),l=n("BhPs");t.a=(e,t)=>{const{categories:n,collections:i,items:a}=Object(r.useSelect)(t=>{const{getInserterItems:n}=t(l.a),{getCategories:r,getCollections:c}=t(o.store);return{categories:r(),collections:c(),items:n(e)}},[e]);return[a,n,i,Object(c.useCallback)((e,n)=>{let{name:r,initialAttributes:c,innerBlocks:l}=e;const i=Object(o.createBlock)(r,c,Object(o.createBlocksFromInnerBlocksTemplate)(l));t(i,void 0,n)},[t])]}},"+WrK":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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.a=c},"+gtr":function(e,t,n){"use strict";n.d(t,"a",(function(){return V}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("1ZqX"),a=n("K9lf"),s=n("HSyU"),u=n("tI+e"),d=n("JygI"),b=n("l3Sj"),p=n("wC17"),m=n("7SSY"),f=n("YLtl");const{clearTimeout:h,setTimeout:g}=window,O=200;function v(e){let{ref:t,isFocused:n,debounceTimeout:o=O,onChange:c=f.noop}=e;const[l,i]=Object(r.useState)(!1),a=Object(r.useRef)(),s=e=>{null!=t&&t.current&&i(e),c(e)},u=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=a.current;e&&h&&h(e)};return Object(r.useEffect)(()=>()=>d(),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=g(()=>{u()&&s(!1)},o)}}}function j(e){let{ref:t,debounceTimeout:n=O,onChange:o=f.noop}=e;const[c,l]=Object(r.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:s}=v({ref:t,debounceTimeout:n,isFocused:c,onChange:o}),u=Object(r.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return Object(r.useEffect)(()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),s())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}},[t,u,l,a,s]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:s}}}var k=n("BhPs");function _(){const{selectBlock:e,toggleBlockHighlight:t}=Object(i.useDispatch)(k.a),{firstParentClientId:n,shouldHide:c,hasReducedUI:l}=Object(i.useSelect)(e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(k.a),{hasBlockSupport:c}=e(s.store),l=n(o()),i=l[l.length-1],a=t(i),u=Object(s.getBlockType)(a),d=r();return{firstParentClientId:i,shouldHide:!c(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}},[]),a=Object(p.a)(n),d=Object(r.useRef)(),{gestures:f}=j({ref:d,onChange(e){e&&l||t(n,e)}});return c||void 0===n?null:Object(r.createElement)("div",Object(o.a)({className:"block-editor-block-parent-selector",key:n,ref:d},f),Object(r.createElement)(u.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:Object(b.sprintf)(Object(b.__)("Select %s"),a.title),showTooltip:!0,icon:Object(r.createElement)(m.a,{icon:a.icon})}))}var y=n("wzfx"),E=n("f8JO"),C=n("REKd");function S(e){let{blocks:t}=e;return Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},Object(r.createElement)(u.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview"},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview-title"},Object(b.__)("Preview")),Object(r.createElement)(C.a,{viewportWidth:500,blocks:t})))))}var w=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:c}=e;const[l,i]=Object(r.useState)();return Object(r.createElement)(u.MenuGroup,{label:Object(b.__)("Transform to"),className:t},l&&Object(r.createElement)(S,{blocks:Object(s.switchToBlockType)(c,l)}),n.map(e=>{const{name:t,icon:n,title:c,isDisabled:l}=e;return Object(r.createElement)(u.MenuItem,{key:t,className:Object(s.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:l,onMouseLeave:()=>i(null),onMouseEnter:()=>i(t)},Object(r.createElement)(m.a,{icon:n,showColors:!0}),c)}))},I=n("7NR9");function x(e){let{hoveredBlock:t,onSwitch:n}=e;const{name:o,clientId:c}=t,[l,a]=Object(r.useState)(),d=Object(i.useSelect)(e=>e(s.store).getBlockType(o),[o]);return Object(r.createElement)(u.MenuGroup,{label:Object(b.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},l&&Object(r.createElement)(S,{blocks:d&&d.example?Object(s.getBlockFromExample)(d.name,{attributes:{...d.example.attributes,className:l},innerBlocks:d.example.innerBlocks}):Object(s.cloneBlock)(t,{className:l})}),Object(r.createElement)(I.a,{clientId:c,onSwitch:n,onHoverClassName:a,itemRole:"menuitem"}))}var B=n("1iEr");const T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:c=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of c){const o=T(e,t,n);if(o)return o}}},P=(e,t)=>{const n=((e,t)=>{const n=Object(s.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce((e,n)=>(t[n]&&(e[n]=t[n]),e),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var R=(e,t)=>Object(r.useMemo)(()=>e.reduce((e,n)=>{const o=((e,t)=>{const n=t.map(e=>Object(s.cloneBlock)(e)),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=T(r,t.name,o);if(n){e=!0,o.add(n.clientId),P(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e},[]),[e,t]);function N(e){let{patterns:t,onSelect:n}=e;return Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},Object(r.createElement)(u.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview"},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview-title"},Object(b.__)("Preview")),Object(r.createElement)(M,{patterns:t,onSelect:n})))))}function M(e){let{patterns:t,onSelect:n}=e;const c=Object(u.__unstableUseCompositeState)();return Object(r.createElement)(u.__unstableComposite,Object(o.a)({},c,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":Object(b.__)("Patterns list")}),t.map(e=>Object(r.createElement)(L,{key:e.name,pattern:e,onSelect:n,composite:c})))}function L(e){let{pattern:t,onSelect:n,composite:c}=e;const l="block-editor-block-switcher__preview-patterns-container",i=Object(a.useInstanceId)(L,l+"-list__item-description");return Object(r.createElement)("div",{className:l+"-list__list-item","aria-label":t.title,"aria-describedby":t.description?i:void 0},Object(r.createElement)(u.__unstableCompositeItem,Object(o.a)({role:"option",as:"div"},c,{className:l+"-list__item",onClick:()=>n(t.transformedBlocks)}),Object(r.createElement)(C.a,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),Object(r.createElement)("div",{className:l+"-list__item-title"},t.title)),!!t.description&&Object(r.createElement)(u.VisuallyHidden,{id:i},t.description))}var A=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[c,l]=Object(r.useState)(!1),i=R(n,t);return i.length?Object(r.createElement)(u.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},c&&Object(r.createElement)(N,{patterns:i,onSelect:o}),Object(r.createElement)(u.MenuItem,{onClick:e=>{e.preventDefault(),l(!c)},icon:B.a},Object(b.__)("Patterns"))):null};const D=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=Object(i.useDispatch)(k.a),c=Object(p.a)(n[0].clientId),{possibleBlockTransformations:l,canRemove:a,hasBlockStyles:d,icon:h,blockTitle:g,patterns:O}=Object(i.useSelect)(e=>{var o;const{getBlockRootClientId:r,getBlockTransformItems:l,__experimentalGetPatternTransformItems:i}=e(k.a),{getBlockStyles:a,getBlockType:u}=e(s.store),{canRemoveBlocks:d}=e(k.a),b=r(Object(f.castArray)(t)[0]),[{name:p}]=n,m=1===n.length,h=m&&a(p);let g;if(m)g=null==c?void 0:c.icon;else{var O;g=1===Object(f.uniq)(n.map(e=>{let{name:t}=e;return t})).length?null===(O=u(p))||void 0===O?void 0:O.icon:y.a}return{possibleBlockTransformations:l(n,b),canRemove:d(t,b),hasBlockStyles:!(null==h||!h.length),icon:g,blockTitle:null===(o=u(p))||void 0===o?void 0:o.title,patterns:i(n,b)}},[t,n,null==c?void 0:c.icon]),v=1===n.length&&Object(s.isReusableBlock)(n[0]),j=1===n.length&&Object(s.isTemplatePart)(n[0]),_=!!l.length&&a,C=!(null==O||!O.length)&&a;if(!d&&!_)return Object(r.createElement)(u.ToolbarGroup,null,Object(r.createElement)(u.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:g,icon:Object(r.createElement)(m.a,{icon:h,showColors:!0})}));const S=g,I=1===n.length?Object(b.sprintf)(Object(b.__)("%s: Change block type or style"),g):Object(b.sprintf)(Object(b._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),B=d||_||C;return Object(r.createElement)(u.ToolbarGroup,null,Object(r.createElement)(u.ToolbarItem,null,e=>Object(r.createElement)(u.DropdownMenu,{className:"block-editor-block-switcher",label:S,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(m.a,{icon:h,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||j)&&Object(r.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},Object(r.createElement)(E.a,{clientId:t}))),toggleProps:{describedBy:I,...e},menuProps:{orientation:"both"}},e=>{let{onClose:c}=e;return B&&Object(r.createElement)("div",{className:"block-editor-block-switcher__container"},C&&Object(r.createElement)(A,{blocks:n,patterns:O,onSelect:e=>{(e=>{o(t,e)})(e),c()}}),_&&Object(r.createElement)(w,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:l,blocks:n,onSelect:e=>{(e=>{o(t,Object(s.switchToBlockType)(n,e))})(e),c()}}),d&&Object(r.createElement)(x,{hoveredBlock:n[0],onSwitch:c}))})))};var F=e=>{let{clientIds:t}=e;const n=Object(i.useSelect)(e=>e(k.a).getBlocksByClientId(t),[t]);return!n.length||n.some(e=>!e)?null:Object(r.createElement)(D,{clientIds:t,blocks:n})},z=n("fOYa"),H=n("U1WI");function V(e){let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:c,blockType:b,hasFixedToolbar:p,hasReducedUI:m,isValid:f,isVisual:h}=Object(i.useSelect)(e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:c,getSettings:l}=e(k.a),i=o(),a=i[0],u=c(a),d=l();return{blockClientIds:i,blockClientId:a,blockType:a&&Object(s.getBlockType)(t(a)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:i.every(e=>r(e)),isVisual:i.every(e=>"visual"===n(e))}},[]),{toggleBlockHighlight:g}=Object(i.useDispatch)(k.a),O=Object(r.useRef)(),{showMovers:v,gestures:y}=j({ref:O,onChange(e){e&&m||g(c,e)}}),E=Object(a.useViewportMatch)("medium","<")||p;if(b&&!Object(s.hasBlockSupport)(b,"__experimentalToolbar",!0))return null;const C=E||v;if(0===n.length)return null;const S=f&&h,w=n.length>1,I=l()("block-editor-block-toolbar",C&&"is-showing-movers");return Object(r.createElement)("div",{className:I},!w&&!E&&Object(r.createElement)(_,{clientIds:n}),Object(r.createElement)("div",Object(o.a)({ref:O},y),(S||w)&&Object(r.createElement)(u.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},Object(r.createElement)(F,{clientIds:n}),Object(r.createElement)(d.a,{clientIds:n,hideDragHandle:t||m}))),S&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(z.b.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{group:"other",className:"block-editor-block-toolbar__slot"})),Object(r.createElement)(H.a,{clientIds:n}))}},"//Lo":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},"/Hvg":function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("Tqx9");var i=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var a=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var s=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const u=[{name:Object(c.__)("Uppercase"),value:"uppercase",icon:i},{name:Object(c.__)("Lowercase"),value:"lowercase",icon:a},{name:Object(c.__)("Capitalize"),value:"capitalize",icon:s}];function d(e){let{value:t,onChange:n}=e;return Object(o.createElement)("fieldset",{className:"block-editor-text-transform-control"},Object(o.createElement)("legend",null,Object(c.__)("Letter case")),Object(o.createElement)("div",{className:"block-editor-text-transform-control__buttons"},u.map(e=>Object(o.createElement)(r.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)}))))}},"/QNa":function(e,t,n){"use strict";var o=n("GRId"),r=n("1ZqX"),c=n("wx14"),l=n("K9lf"),i=n("BhPs"),a=n("AHN3");var s=Object(l.createHigherOrderComponent)(e=>Object(r.withRegistry)(t=>{let{useSubRegistry:n=!0,registry:l,...s}=t;if(!n)return Object(o.createElement)(e,Object(c.a)({registry:l},s));const[u,d]=Object(o.useState)(null);return Object(o.useEffect)(()=>{const e=Object(r.createRegistry)({},l);e.registerStore(a.a,i.b),d(e)},[l]),u?Object(o.createElement)(r.RegistryProvider,{value:u},Object(o.createElement)(e,Object(c.a)({registry:u},s))):null}),"withRegistryProvider"),u=n("JGYp"),d=n("cDhi");t.a=s((function(e){const{children:t,settings:n}=e,{updateSettings:c}=Object(r.useDispatch)(i.a);return Object(o.useEffect)(()=>{c(n)},[n]),Object(u.a)(e),Object(o.createElement)(d.b,null,t)}))},"/lNF":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("HSyU"),r=n("1ZqX"),c=n("1CF3"),l=n("BhPs");function i(e,t,n,r,c,l,i){return a=>{const{srcRootClientId:s,srcClientIds:u,type:d,blocks:b}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){i();const n=b.map(e=>Object(o.cloneBlock)(e));l(n,t,e,!0,null)}if("block"===d){const o=n(u[0]);if(s===e&&o===t)return;if(u.includes(e)||r(u).some(t=>t===e))return;const l=s===e,i=u.length;c(u,s,e,l&&oe(l.a).getSettings().mediaUpload,[]),{canInsertBlockType:a,getBlockIndex:s,getClientIdsOfDescendants:u}=Object(r.useSelect)(l.a),{insertBlocks:d,moveBlocksToPosition:b,updateBlockAttributes:p,clearSelectedBlock:m}=Object(r.useDispatch)(l.a),f=i(e,t,s,u,b,d,m),h=function(e,t,n,r,c,l){return i=>{if(!n)return;const a=Object(o.findTransform)(Object(o.getBlockTransforms)("from"),t=>"files"===t.type&&c(t.blockName,e)&&t.isMatch(i));if(a){const n=a.transform(i,r);l(n,t,e)}}}(e,t,n,p,a,d),g=function(e,t,n){return r=>{const c=Object(o.pasteHandler)({HTML:r,mode:"BLOCKS"});c.length&&n(c,t,e)}}(e,t,d);return e=>{const t=Object(c.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");t.length?h(t):n?g(n):f(e)}}},"0E5u":function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("kWXm"),i=n("DmX/"),a=n("suLj"),s=n("bTSr"),u=n("l3Sj");const d={left:l.a,center:i.a,right:a.a,"space-between":s.a};var b=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:b,value:p,popoverProps:m,isToolbar:f}=e;const h=e=>{b(e===p?void 0:e)},g=p?d[p]:d.left,O=[{name:"left",icon:l.a,title:Object(u.__)("Justify items left"),isActive:"left"===p,onClick:()=>h("left")},{name:"center",icon:i.a,title:Object(u.__)("Justify items center"),isActive:"center"===p,onClick:()=>h("center")},{name:"right",icon:a.a,title:Object(u.__)("Justify items right"),isActive:"right"===p,onClick:()=>h("right")},{name:"space-between",icon:s.a,title:Object(u.__)("Space between items"),isActive:"space-between"===p,onClick:()=>h("space-between")}],v=f?c.ToolbarGroup:c.ToolbarDropdownMenu,j=f?{isCollapsed:n}:{};return Object(r.createElement)(v,Object(o.a)({icon:g,popoverProps:m,label:Object(u.__)("Change items justification"),controls:O.filter(e=>t.includes(e.name))},j))};function p(e){return Object(r.createElement)(b,Object(o.a)({},e,{isToolbar:!1}))}function m(e){return Object(r.createElement)(b,Object(o.a)({},e,{isToolbar:!0}))}},"0LBR":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("GRId"),r=n("l3Sj"),c=n("v5LD"),l=n("pY5h");function i(){const e=Object(l.a)(),t=Object(c.a)("color.palette.custom"),n=Object(c.a)("color.palette.theme"),i=Object(c.a)("color.palette.default"),a=Object(c.a)("color.defaultPalette");e.colors=Object(o.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:Object(r._x)("Theme","Indicates this palette comes from the theme."),colors:n}),a&&i&&i.length&&e.push({name:Object(r._x)("Default","Indicates this palette comes from WordPress."),colors:i}),t&&t.length&&e.push({name:Object(r._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e},[i,n,t]);const s=Object(c.a)("color.gradients.custom"),u=Object(c.a)("color.gradients.theme"),d=Object(c.a)("color.gradients.default"),b=Object(c.a)("color.defaultGradients");return e.gradients=Object(o.useMemo)(()=>{const e=[];return u&&u.length&&e.push({name:Object(r._x)("Theme","Indicates this palette comes from the theme."),gradients:u}),b&&d&&d.length&&e.push({name:Object(r._x)("Default","Indicates this palette comes from WordPress."),gradients:d}),s&&s.length&&e.push({name:Object(r._x)("Custom","Indicates this palette is created by the user."),gradients:s}),e},[s,u,d]),e}},"14PQ":function(e,t,n){"use strict";n.d(t,"ic",(function(){return o.b})),n.d(t,"jc",(function(){return o.c})),n.d(t,"kc",(function(){return o.d})),n.d(t,"hc",(function(){return o.a})),n.d(t,"wc",(function(){return o.e})),n.d(t,"yb",(function(){return r.a})),n.d(t,"pc",(function(){return r.e})),n.d(t,"zb",(function(){return r.b})),n.d(t,"oc",(function(){return r.d})),n.d(t,"Tb",(function(){return r.c})),n.d(t,"lc",(function(){return c.b})),n.d(t,"mc",(function(){return c.c})),n.d(t,"nc",(function(){return c.d})),n.d(t,"I",(function(){return c.a})),n.d(t,"xc",(function(){return c.e})),n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return O})),n.d(t,"c",(function(){return B})),n.d(t,"d",(function(){return T.a})),n.d(t,"e",(function(){return T.b})),n.d(t,"nb",(function(){return N})),n.d(t,"lb",(function(){return L})),n.d(t,"f",(function(){return z})),n.d(t,"mb",(function(){return G})),n.d(t,"h",(function(){return U.a})),n.d(t,"i",(function(){return W.b})),n.d(t,"m",(function(){return W.a})),n.d(t,"g",(function(){return $})),n.d(t,"j",(function(){return Z.a})),n.d(t,"rc",(function(){return k.c})),n.d(t,"n",(function(){return C.a})),n.d(t,"r",(function(){return Ie})),n.d(t,"pb",(function(){return Be})),n.d(t,"ob",(function(){return We})),n.d(t,"qb",(function(){return Ye})),n.d(t,"A",(function(){return nt})),n.d(t,"z",(function(){return tt})),n.d(t,"rb",(function(){return ot.a})),n.d(t,"sb",(function(){return rt.a})),n.d(t,"C",(function(){return ct.a})),n.d(t,"B",(function(){return ct.b})),n.d(t,"D",(function(){return at})),n.d(t,"E",(function(){return ut})),n.d(t,"F",(function(){return dt.a})),n.d(t,"vb",(function(){return bt.a})),n.d(t,"wb",(function(){return pt.a})),n.d(t,"xb",(function(){return mt.a})),n.d(t,"Fb",(function(){return ft.a})),n.d(t,"Pb",(function(){return ht.a})),n.d(t,"Qb",(function(){return gt.a})),n.d(t,"tb",(function(){return st.a})),n.d(t,"ub",(function(){return Ot.a})),n.d(t,"Mb",(function(){return vt.a})),n.d(t,"Bb",(function(){return rn})),n.d(t,"Ab",(function(){return Kt})),n.d(t,"Cb",(function(){return ln})),n.d(t,"J",(function(){return an.a})),n.d(t,"tc",(function(){return an.b})),n.d(t,"M",(function(){return sn.b})),n.d(t,"L",(function(){return sn.a})),n.d(t,"O",(function(){return un.b})),n.d(t,"N",(function(){return un.a})),n.d(t,"Hb",(function(){return Vn})),n.d(t,"Ib",(function(){return Tn})),n.d(t,"Kb",(function(){return En})),n.d(t,"Jb",(function(){return _n})),n.d(t,"P",(function(){return Gn.a})),n.d(t,"Lb",(function(){return Se})),n.d(t,"R",(function(){return $n})),n.d(t,"Q",(function(){return no})),n.d(t,"S",(function(){return Kn})),n.d(t,"T",(function(){return Yn})),n.d(t,"X",(function(){return oo})),n.d(t,"Y",(function(){return No})),n.d(t,"Ob",(function(){return Lo})),n.d(t,"ab",(function(){return To})),n.d(t,"bb",(function(){return Ao})),n.d(t,"cb",(function(){return Do})),n.d(t,"ac",(function(){return Fo})),n.d(t,"eb",(function(){return Ho})),n.d(t,"Rb",(function(){return Vo})),n.d(t,"gb",(function(){return On})),n.d(t,"hb",(function(){return qo})),n.d(t,"ib",(function(){return eo})),n.d(t,"Db",(function(){return Zo})),n.d(t,"vc",(function(){return it})),n.d(t,"Wb",(function(){return Xo.a})),n.d(t,"Zb",(function(){return Qo.a})),n.d(t,"Nb",(function(){return Jo})),n.d(t,"Vb",(function(){return er})),n.d(t,"o",(function(){return dr})),n.d(t,"p",(function(){return br.c})),n.d(t,"sc",(function(){return pr.a})),n.d(t,"Eb",(function(){return mr.b})),n.d(t,"q",(function(){return fr.a})),n.d(t,"s",(function(){return Te.a})),n.d(t,"Sb",(function(){return Te.b})),n.d(t,"t",(function(){return hr.a})),n.d(t,"bc",(function(){return hr.b})),n.d(t,"u",(function(){return gr.a})),n.d(t,"v",(function(){return Or.a})),n.d(t,"w",(function(){return F.a})),n.d(t,"x",(function(){return vr.a})),n.d(t,"y",(function(){return Cr})),n.d(t,"G",(function(){return Sr.a})),n.d(t,"dc",(function(){return Sr.b})),n.d(t,"H",(function(){return wr.a})),n.d(t,"Xb",(function(){return Ir.a})),n.d(t,"K",(function(){return xr.a})),n.d(t,"Gb",(function(){return Tr})),n.d(t,"k",(function(){return Rr})),n.d(t,"U",(function(){return Nr})),n.d(t,"V",(function(){return Mr.a})),n.d(t,"W",(function(){return Fr})),n.d(t,"gc",(function(){return Dr})),n.d(t,"ec",(function(){return Ar})),n.d(t,"Z",(function(){return zr})),n.d(t,"db",(function(){return nr})),n.d(t,"fb",(function(){return Ur})),n.d(t,"fc",(function(){return Gr})),n.d(t,"jb",(function(){return Wr.a})),n.d(t,"kb",(function(){return qr.a})),n.d(t,"cc",(function(){return Yr})),n.d(t,"qc",(function(){return ce.a})),n.d(t,"Yb",(function(){return $r.a})),n.d(t,"Ub",(function(){return Qr})),n.d(t,"l",(function(){return Jr.a})),n.d(t,"uc",(function(){return lt.a}));var o=n("5gPN"),r=n("zmSX"),c=n("9XVa"),l=n("wx14"),i=n("GRId"),a=n("YLtl"),s=n("l3Sj"),u=n("tI+e"),d=n("fPbg"),b=n("plpT"),p=n("ziDm");const m=[{icon:d.a,title:Object(s.__)("Align text left"),align:"left"},{icon:b.a,title:Object(s.__)("Align text center"),align:"center"},{icon:p.a,title:Object(s.__)("Align text right"),align:"right"}],f={position:"bottom right",isAlternate:!0};var h=function(e){let{value:t,onChange:n,alignmentControls:o=m,label:r=Object(s.__)("Align"),describedBy:c=Object(s.__)("Change text alignment"),isCollapsed:b=!0,isToolbar:h}=e;function g(e){return()=>n(t===e?void 0:e)}const O=Object(a.find)(o,e=>e.align===t),v=h?u.ToolbarGroup:u.ToolbarDropdownMenu,j=h?{isCollapsed:b}:{};return Object(i.createElement)(v,Object(l.a)({icon:O?O.icon:Object(s.isRTL)()?p.a:d.a,label:r,toggleProps:{describedBy:c},popoverProps:f,controls:o.map(e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:b?"menuitemradio":void 0,onClick:g(n)}})},j))};function g(e){return Object(i.createElement)(h,Object(l.a)({},e,{isToolbar:!1}))}function O(e){return Object(i.createElement)(h,Object(l.a)({},e,{isToolbar:!0}))}var v=n("g56x"),j=n("HSyU"),k=n("ur0x"),_=n("1ZqX"),y=n("pOGT"),E=n("+G0a"),C=n("7SSY"),S=n("BhPs");var w={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=Object(_.useSelect)(e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(S.a),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}},[]),[o,r,c]=Object(E.a)(t,a.noop),l=Object(i.useMemo)(()=>(e.trim()?Object(y.a)(o,r,c,e):Object(a.orderBy)(o,["frecency"],["desc"])).filter(e=>e.name!==n).slice(0,9),[e,n,o,r,c]);return[Object(i.useMemo)(()=>l.map(e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:"block-"+e.id,value:e,label:Object(i.createElement)(i.Fragment,null,Object(i.createElement)(C.a,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}),[l])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:Object(j.createBlock)(t,n,Object(j.createBlocksFromInnerBlocksTemplate)(o))}}};const I=[];function x(e){let{completers:t=I}=e;const{name:n}=Object(k.c)();return Object(i.useMemo)(()=>{let e=t;return(n===Object(j.getDefaultBlockName)()||Object(j.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([w])),Object(v.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(a.clone)),e=Object(v.applyFilters)("editor.Autocomplete.completers",e,n)),e},[t,n])}var B=function(e){return Object(i.createElement)(u.Autocomplete,Object(l.a)({},e,{completers:x(e)}))},T=n("vtO0"),P=n("Tqx9");var R=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var N=function(e){let{isActive:t,label:n=Object(s.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return Object(i.createElement)(u.ToolbarButton,{isActive:t,icon:R,label:n,onClick:()=>o(!t),disabled:r})},M=n("RxS6");var L=function(e){const{label:t=Object(s.__)("Change matrix alignment"),onChange:n=a.noop,value:o="center",isDisabled:r}=e,c=Object(i.createElement)(u.__experimentalAlignmentMatrixControl.Icon,{value:o}),l="block-editor-block-alignment-matrix-control";return Object(i.createElement)(u.Dropdown,{position:"bottom right",className:l,popoverProps:{className:"block-editor-block-alignment-matrix-control__popover",isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return Object(i.createElement)(u.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==M.DOWN||(e.preventDefault(),n())},label:t,icon:c,showTooltip:!0,disabled:r})},renderContent:()=>Object(i.createElement)(u.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},A=n("iClF");var D=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),F=n("f8JO");var z=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=Object(_.useDispatch)(S.a),{clientId:r,parents:c,hasSelection:l}=Object(_.useSelect)(e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(S.a),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}},[]),a=t||Object(s.__)("Document");return Object(i.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":Object(s.__)("Block breadcrumb")},Object(i.createElement)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true"},l&&Object(i.createElement)(u.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!l&&a,!!r&&Object(i.createElement)(A.a,{icon:D,className:"block-editor-block-breadcrumb__separator"})),c.map(e=>Object(i.createElement)("li",{key:e},Object(i.createElement)(u.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},Object(i.createElement)(F.a,{clientId:e})),Object(i.createElement)(A.a,{icon:D,className:"block-editor-block-breadcrumb__separator"}))),!!r&&Object(i.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},Object(i.createElement)(F.a,{clientId:r})))},H=n("TSYQ"),V=n.n(H);function G(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[c,a]=Object(i.useState)(!0),[s,u]=Object(i.useState)(!1),{isParentSelected:d,hasChildSelected:b,isDraggingBlocks:p,isParentHighlighted:m}=Object(_.useSelect)(e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:c}=e(S.a);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:c(t)}},[t]),f=V()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":c,"parent-highlighted":m,"is-dragging-blocks":p});return Object(i.useEffect)(()=>{d||b||c||a(!0),d&&!s&&c&&a(!1),b&&c&&a(!1)},[d,b,c,s]),Object(i.createElement)(n,Object(l.a)({},o,{className:f,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseUp:c?()=>a(!1):void 0}),null==o?void 0:o.children)}var U=n("uoCR"),W=n("fOYa");const q=()=>Object(i.createElement)(u.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Object(i.createElement)(u.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),K=e=>{let{style:t,className:n}=e;return Object(i.createElement)("div",{className:"block-library-colors-selector__icon-container"},Object(i.createElement)("div",{className:n+" block-library-colors-selector__state-selection",style:t},Object(i.createElement)(q,null)))},Y=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(u.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:Object(s.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==M.DOWN||(e.preventDefault(),o())},icon:Object(i.createElement)(n,null,Object(i.createElement)(t,null,Object(i.createElement)(K,null)))}))}};var $=e=>{let{children:t,...n}=e;return Object(i.createElement)(u.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Y(n),renderContent:()=>t})},Z=n("JRTi"),X=n("OzlF"),Q=n("K9lf"),J=n("VKE3"),ee=n("+DUQ"),te=n("Xkls");const ne=Object(ee.animated)(u.__experimentalTreeGridRow);function oe(e){let{isSelected:t,position:n,level:o,rowCount:r,children:c,className:a,path:s,...u}=e;const d=Object(te.a)({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s});return Object(i.createElement)(ne,Object(l.a)({ref:d,className:V()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},u),c)}var re=n("9Ma0"),ce=n("wC17");function le(e){let{onClick:t}=e;return Object(i.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},Object(i.createElement)(A.a,{icon:D}))}var ie=Object(i.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:c,onClick:l,onToggleExpanded:a,position:d,siblingBlockCount:b,level:p,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:g,draggable:O}=t;const v=Object(ce.a)(r),j="list-view-block-select-button__"+Object(Q.useInstanceId)(e),k=((e,t,n)=>Object(s.sprintf)(Object(s.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(d,b,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.Button,{className:V()("block-editor-list-view-block-select-button",o),onClick:l,"aria-describedby":j,ref:n,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:g,draggable:O},Object(i.createElement)(le,{onClick:a}),Object(i.createElement)(C.a,{icon:null==v?void 0:v.icon,showColors:!0}),Object(i.createElement)(F.a,{clientId:r}),(null==v?void 0:v.anchor)&&Object(i.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},v.anchor),c&&Object(i.createElement)(u.VisuallyHidden,null,Object(s.__)("(selected block)"))),Object(i.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:j},k))})),ae=n("ZAjO");var se=Object(i.forwardRef)((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:c,position:a,siblingBlockCount:s,level:u,...d}=e;const{clientId:b}=r,{blockMovingClientId:p,selectedBlockInBlockEditor:m}=Object(_.useSelect)(e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(S.a);return{rootClientId:t(b)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}},[b]),f=p&&m===b,h=V()("block-editor-list-view-block-contents",{"is-dropping-before":f});return Object(i.createElement)(ae.a,{clientIds:[r.clientId]},e=>{let{draggable:b,onDragStart:p,onDragEnd:m}=e;return Object(i.createElement)(ie,Object(l.a)({ref:t,className:h,block:r,onClick:n,onToggleExpanded:o,isSelected:c,position:a,siblingBlockCount:s,level:u,draggable:b,onDragStart:p,onDragEnd:m},d))})}),ue=n("1eGn");const de=Object(i.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),be=()=>Object(i.useContext)(de);var pe=Object(i.memo)((function(e){let{block:t,isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:c,position:l,level:a,rowCount:s,siblingBlockCount:d,showBlockMovers:b,path:p,isExpanded:m}=e;const f=Object(i.useRef)(null),[h,g]=Object(i.useState)(!1),{clientId:O}=t,{toggleBlockHighlight:v}=Object(_.useDispatch)(S.a),{__experimentalFeatures:j,__experimentalPersistentListViewFeatures:k,__experimentalHideContainerBlockActions:y,isTreeGridMounted:E,expand:C,collapse:w}=be(),I=b&&d>0,x=V()("block-editor-list-view-block__mover-cell",{"is-visible":h||o}),B=V()("block-editor-list-view-block__menu-cell",{"is-visible":h||o});Object(i.useEffect)(()=>{k&&!E&&o&&f.current.focus()},[]);const T=k?v:()=>{},P=Object(i.useCallback)(()=>{g(!0),T(O,!0)},[O,g,T]),R=Object(i.useCallback)(()=>{g(!1),T(O,!1)},[O,g,T]),N=Object(i.useCallback)(e=>{e.stopPropagation(),c(O)},[O,c]),M=Object(i.useCallback)(e=>{e.stopPropagation(),!0===m?w(O):!1===m&&C(O)},[O,C,w,m]),L=j&&(!y||y&&a>1),A=j&&!L;let D;I?D=2:A&&(D=3);const F=V()({"is-selected":o,"is-branch-selected":k&&r,"is-dragging":n,"has-single-cell":A});return Object(i.createElement)(oe,{className:F,onMouseEnter:P,onMouseLeave:R,onFocus:P,onBlur:R,level:a,position:l,rowCount:s,path:p,id:"list-view-block-"+O,"data-block":O,isExpanded:m},Object(i.createElement)(u.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:D,ref:f},e=>{let{ref:n,tabIndex:r,onFocus:c}=e;return Object(i.createElement)("div",{className:"block-editor-list-view-block__contents-container"},Object(i.createElement)(se,{block:t,onClick:N,onToggleExpanded:M,isSelected:o,position:l,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:c}))}),I&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.__experimentalTreeGridCell,{className:x,withoutGridItem:!0},Object(i.createElement)(u.__experimentalTreeGridItem,null,e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return Object(i.createElement)(re.b,{orientation:"vertical",clientIds:[O],ref:t,tabIndex:n,onFocus:o})}),Object(i.createElement)(u.__experimentalTreeGridItem,null,e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return Object(i.createElement)(re.a,{orientation:"vertical",clientIds:[O],ref:t,tabIndex:n,onFocus:o})}))),L&&Object(i.createElement)(u.__experimentalTreeGridCell,{className:B},e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return Object(i.createElement)(ue.a,{clientIds:[O],icon:J.a,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:N})}))}));function me(e,t,n){var o;if(null==n?void 0:n.includes(e.clientId))return 0;return null===(o=t[e.clientId])||void 0===o||o?1+e.innerBlocks.reduce(fe(t,n),0):1}const fe=(e,t)=>(n,o)=>{var r;if(null==t?void 0:t.includes(o.clientId))return n;return(null===(r=e[o.clientId])||void 0===r||r)&&o.innerBlocks.length>0?n+me(o,e,t):n+1};function he(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:c,level:l=1,path:s="",isBranchSelected:u=!1,listPosition:d=0,fixedListWindow:b}=e,{expandedState:p,draggedClientIds:m,__experimentalPersistentListViewFeatures:f}=be(),h=Object(a.compact)(t),g=h.length;let O=d;return Object(i.createElement)(i.Fragment,null,h.map((e,t)=>{var d;const{clientId:v,innerBlocks:j}=e;t>0&&(O+=me(h[t-1],p,m));const k=f,{itemInView:y}=b,E=!k||y(O),C=t+1,S=s.length>0?`${s}_${C}`:""+C,w=r&&!!j&&!!j.length,I=w?null===(d=p[v])||void 0===d||d:void 0,x=!(null==m||!m.includes(v)),B=x||E,T=((e,t)=>Object(a.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(v,c),P=u||T&&w;return Object(i.createElement)(_.AsyncModeProvider,{key:v,value:!T},B&&Object(i.createElement)(pe,{block:e,selectBlock:n,isSelected:T,isBranchSelected:P,isDragged:x,level:l,position:C,rowCount:g,siblingBlockCount:g,showBlockMovers:o,path:S,isExpanded:I,listPosition:O}),!B&&Object(i.createElement)("tr",null,Object(i.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&I&&!x&&Object(i.createElement)(he,{blocks:j,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:l+1,path:S,listPosition:O+1,fixedListWindow:b,isBranchSelected:P,selectedClientIds:c}))}))}he.defaultProps={selectBlock:()=>{}};var ge=Object(i.memo)(he);function Oe(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:c}=n||{},[l,a]=Object(i.useMemo)(()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]},[o,r]),s=a||l,d=Object(i.useCallback)(()=>{if(!l)return 0;const e=s.getBoundingClientRect();return l.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left},[l,s]),b=Object(i.useMemo)(()=>{if(!s)return{};const e=d();return{width:s.offsetWidth-e}},[d,s]),p=Object(i.useCallback)(()=>{if(!s)return{};const e=s.ownerDocument,t=s.getBoundingClientRect(),n=d(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===c?{...o,top:t.top,bottom:t.top}:"bottom"===c||"inside"===c?{...o,top:t.bottom,bottom:t.bottom}:{}},[s,c,d]);return s?Object(i.createElement)(u.Popover,{noArrow:!0,animate:!1,getAnchorRect:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},Object(i.createElement)("div",{style:b,className:"block-editor-list-view-drop-indicator__line"})):null}var ve=n("vIlp"),je=n("/lNF");function ke(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const _e=["top","bottom"];function ye(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=Object(_.useSelect)(S.a),[c,l]=Object(i.useState)(),{rootClientId:a,blockIndex:s}=c||{},u=Object(je.a)(a,s),d=o(),b=Object(Q.useThrottle)(Object(i.useCallback)((o,c)=>{const i={x:o.clientX,y:o.clientY},a=!(null==d||!d.length),s=function(e,t){let n,o,r,c;for(const l of e){if(l.isDraggedBlock)continue;const i=l.element.getBoundingClientRect(),[a,s]=Object(ve.a)(t,i,_e),u=ke(t,i);if(void 0===r||a0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,c)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const i=l?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+i,dropPosition:n}}(Array.from(c.querySelectorAll("[data-block]")).map(o=>{const c=o.dataset.block,l=e(c);return{clientId:c,rootClientId:l,blockIndex:t(c),element:o,isDraggedBlock:!!a&&d.includes(c),innerBlockCount:n(c),canInsertDraggedBlocksAsSibling:!a||r(d,l),canInsertDraggedBlocksAsChild:!a||r(d,c)}}),i);s&&l(s)},[d]),200);return{ref:Object(Q.__experimentalUseDropZone)({onDrop:u,onDragOver(e){b(e,e.currentTarget)},onDragEnd(){b.cancel(),l(null)}}),target:c}}const Ee=()=>{},Ce=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var Se=Object(i.forwardRef)((function(e,t){let{blocks:n,onSelect:o=Ee,__experimentalFeatures:r,__experimentalPersistentListViewFeatures:c,__experimentalHideContainerBlockActions:a,showNestedBlocks:d,showBlockMovers:b,...p}=e;const{clientIdsTree:m,draggedClientIds:f,selectedClientIds:h}=function(e){return Object(_.useSelect)(t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(S.a);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}},[e])}(n),{selectBlock:g}=Object(_.useDispatch)(S.a),{visibleBlockCount:O}=Object(_.useSelect)(e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(S.a),o=(null==f?void 0:f.length)>0?n(f).length+1:0;return{visibleBlockCount:t()-o}},[f]),v=Object(i.useCallback)(e=>{g(e),o(e)},[g,o]),[j,k]=Object(i.useReducer)(Ce,{}),{ref:y,target:E}=ye(),C=Object(i.useRef)(),w=Object(Q.useMergeRefs)([C,y,t]),I=Object(i.useRef)(!1);Object(i.useEffect)(()=>{I.current=!0},[]);const[x]=Object(Q.__experimentalUseFixedWindowList)(C,36,O,{useWindowing:c,windowOverscan:40}),B=Object(i.useCallback)(e=>{e&&k({type:"expand",clientId:e})},[k]),T=Object(i.useCallback)(e=>{e&&k({type:"collapse",clientId:e})},[k]),P=Object(i.useCallback)(e=>{var t;B(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)},[B]),R=Object(i.useCallback)(e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)},[T]),N=Object(i.useMemo)(()=>({__experimentalFeatures:r,__experimentalPersistentListViewFeatures:c,__experimentalHideContainerBlockActions:a,isTreeGridMounted:I.current,draggedClientIds:f,expandedState:j,expand:B,collapse:T}),[r,c,a,I.current,f,j,B,T]);return Object(i.createElement)(_.AsyncModeProvider,{value:!0},Object(i.createElement)(Oe,{listViewRef:C,blockDropTarget:E}),Object(i.createElement)(u.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":Object(s.__)("Block navigation structure"),ref:w,onCollapseRow:R,onExpandRow:P},Object(i.createElement)(de.Provider,{value:N},Object(i.createElement)(ge,Object(l.a)({blocks:m,selectBlock:v,showNestedBlocks:d,showBlockMovers:b,fixedListWindow:x,selectedClientIds:h},p)))))}));function we(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...c}=e;return Object(i.createElement)(u.Button,Object(l.a)({},c,{ref:r,icon:X.a,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:Object(s.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Ie=Object(i.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const c=Object(_.useSelect)(e=>!!e(S.a).getBlockCount(),[])&&!n;return Object(i.createElement)(u.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return Object(i.createElement)(we,Object(l.a)({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:c}))},renderContent:()=>Object(i.createElement)("div",{className:"block-editor-block-navigation__container"},Object(i.createElement)("p",{className:"block-editor-block-navigation__label"},Object(s.__)("List view")),Object(i.createElement)(Se,{showNestedBlocks:!0,__experimentalFeatures:o}))})})),xe=n("Civd");var Be=function(e){let{icon:t=xe.a,label:n=Object(s.__)("Choose variation"),instructions:o=Object(s.__)("Select a variation to start with."),variations:r,onSelect:c,allowSkip:l}=e;const a=V()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return Object(i.createElement)(u.Placeholder,{icon:t,label:n,instructions:o,className:a},Object(i.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":Object(s.__)("Block variations")},r.map(e=>Object(i.createElement)("li",{key:e.name},Object(i.createElement)(u.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>c(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),Object(i.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title)))),l&&Object(i.createElement)("div",{className:"block-editor-block-variation-picker__skip"},Object(i.createElement)(u.Button,{variant:"link",onClick:()=>c()},Object(s.__)("Skip"))))},Te=n("REKd"),Pe=n("2gm7"),Re=n("1iEr"),Ne=n("XNw2"),Me=n("b2RC");const Le="carousel",Ae="grid",De=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},Object(i.createElement)(u.Button,{onClick:t},Object(s.__)("Start blank")),Object(i.createElement)(u.Button,{variant:"primary",onClick:n},Object(s.__)("Choose")))},Fe=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},Object(i.createElement)(u.Button,{icon:Pe.a,label:Object(s.__)("Previous pattern"),onClick:t,disabled:0===o}),Object(i.createElement)(u.Button,{icon:Re.a,label:Object(s.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var ze=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:c,totalSlides:l,onBlockPatternSelect:a,onStartBlank:d}=e;const b=t===Le,p=Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},Object(i.createElement)(u.Button,{icon:Ne.a,label:Object(s.__)("Carousel view"),onClick:()=>n(Le),isPressed:b}),Object(i.createElement)(u.Button,{icon:Me.a,label:Object(s.__)("Grid view"),onClick:()=>n(Ae),isPressed:t===Ae}));return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},b&&Object(i.createElement)(Fe,{handlePrevious:o,handleNext:r,activeSlide:c,totalSlides:l}),p,b&&Object(i.createElement)(De,{onBlockPatternSelect:a,onStartBlank:d}))};var He=function(e,t,n){return Object(_.useSelect)(o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:c,__experimentalGetAllowedPatterns:l}=o(S.a),i=r(e);return n?l(i).filter(n):c(t,i)},[e,t,n])};const Ve=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const c=Object(u.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===Le){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return Object(i.createElement)("div",{className:a},Object(i.createElement)("ul",{className:"carousel-container"},o.map((t,n)=>Object(i.createElement)(Ue,{className:e.get(n)||"",key:t.name,pattern:t}))))}return Object(i.createElement)(u.__unstableComposite,Object(l.a)({},c,{role:"listbox",className:a,"aria-label":Object(s.__)("Patterns list")}),o.map(e=>Object(i.createElement)(Ge,{key:e.name,pattern:e,onSelect:r,composite:c})))};function Ge(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:c,title:a,description:s,viewportWidth:d=700}=t,b=Object(Q.useInstanceId)(Ge,r+"__item-description");return Object(i.createElement)("div",{className:r+"__list-item","aria-label":t.title,"aria-describedby":t.description?b:void 0},Object(i.createElement)(u.__unstableCompositeItem,Object(l.a)({role:"option",as:"div"},o,{className:r+"__item",onClick:()=>n(c)}),Object(i.createElement)(Te.a,{blocks:c,viewportWidth:d}),Object(i.createElement)("div",{className:r+"__item-title"},a)),!!s&&Object(i.createElement)(u.VisuallyHidden,{id:b},s))}function Ue(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:c}=n,l=Object(Q.useInstanceId)(Ue,"block-editor-block-pattern-setup-list__item-description");return Object(i.createElement)("li",{className:"pattern-slide "+t,"aria-label":r,"aria-describedby":c?l:void 0},Object(i.createElement)(Te.a,{blocks:o,__experimentalLive:!0}),!!c&&Object(i.createElement)(u.VisuallyHidden,{id:l},c))}var We=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:r,onBlockPatternSelect:c}=e;const[l,a]=Object(i.useState)(Le),[s,u]=Object(i.useState)(0),[d,b]=Object(i.useState)(!1),{replaceBlock:p}=Object(_.useDispatch)(S.a),m=He(t,n,o);if(null==m||!m.length||d)return r;const f=c||(e=>{const n=e.map(e=>Object(j.cloneBlock)(e));p(t,n)});return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup view-mode-"+l},Object(i.createElement)(ze,{viewMode:l,setViewMode:a,activeSlide:s,totalSlides:m.length,handleNext:()=>{u(e=>e+1)},handlePrevious:()=>{u(e=>e-1)},onBlockPatternSelect:()=>{f(m[s].blocks)},onStartBlank:()=>{b(!0)}}),Object(i.createElement)(Ve,{viewMode:l,activeSlide:s,patterns:m,onBlockPatternSelect:f}))},qe=n("NWDH"),Ke=n("Btt3");var Ye=function(e){let{blockClientId:t}=e;const[n,o]=Object(i.useState)(),{updateBlockAttributes:r}=Object(_.useDispatch)(S.a),{variations:c,blockAttributes:l}=Object(_.useSelect)(e=>{const{getBlockVariations:n}=e(j.store),{getBlockName:o,getBlockAttributes:r}=e(S.a),c=t&&o(t);return{variations:c&&n(c,"transform"),blockAttributes:r(t)}},[t]);if(Object(i.useEffect)(()=>{var e;o(null===(e=Object(Ke.a)(l,c))||void 0===e?void 0:e.name)},[l,c]),null==c||!c.length)return null;const a=c.map(e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}),d=e=>{r(t,{...c.find(t=>{let{name:n}=t;return n===e}).attributes})},b="block-editor-block-variation-transforms";return Object(i.createElement)(u.DropdownMenu,{className:b,label:Object(s.__)("Transform to variation"),text:Object(s.__)("Transform to variation"),popoverProps:{position:"bottom center",className:b+"__popover"},icon:qe.a,toggleProps:{iconPosition:"right"}},()=>Object(i.createElement)("div",{className:b+"__container"},Object(i.createElement)(u.MenuGroup,null,Object(i.createElement)(u.MenuItemsChoice,{choices:a,value:n,onSelect:d}))))};const $e=Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(u.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ze=Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(u.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Xe={top:{icon:Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(u.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:Object(s._x)("Align top","Block vertical alignment setting")},center:{icon:Ze,title:Object(s._x)("Align middle","Block vertical alignment setting")},bottom:{icon:$e,title:Object(s._x)("Align bottom","Block vertical alignment setting")}},Qe=["top","center","bottom"],Je={isAlternate:!0};var et=function(e){let{value:t,onChange:n,controls:o=Qe,isCollapsed:r=!0,isToolbar:c}=e;const a=Xe[t],d=Xe.top,b=c?u.ToolbarGroup:u.ToolbarDropdownMenu,p=c?{isCollapsed:r}:{};return Object(i.createElement)(b,Object(l.a)({popoverProps:Je,icon:a?a.icon:d.icon,label:Object(s._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map(e=>{return{...Xe[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o})},p))};function tt(e){return Object(i.createElement)(et,Object(l.a)({},e,{isToolbar:!1}))}function nt(e){return Object(i.createElement)(et,Object(l.a)({},e,{isToolbar:!0}))}var ot=n("Wy3j"),rt=n("2YCo"),ct=n("I5Hl"),lt=n("v5LD"),it=Object(Q.createHigherOrderComponent)(e=>t=>{const n=Object(lt.a)("color.palette"),o=!Object(lt.a)("color.custom"),r=void 0===t.colors?n:t.colors,c=void 0===t.disableCustomColors?o:t.disableCustomColors,s=!Object(a.isEmpty)(r)||!c;return Object(i.createElement)(e,Object(l.a)({},t,{colors:r,disableCustomColors:c,hasColorsToChoose:s}))},"withColorContext"),at=it(u.ColorPalette),st=n("hMaJ");function ut(e){let{onChange:t,value:n,...o}=e;return Object(i.createElement)(st.a,Object(l.a)({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var dt=n("6c9H"),bt=n("1uGa"),pt=n("Bo0k"),mt=n("GKUk"),ft=n("xBDm"),ht=n("kVRd"),gt=n("/Hvg"),Ot=n("dchM"),vt=n("yU1v"),jt=function(e,t){return(jt=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)};var kt=function(){return(kt=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:s,height:s/r}}function wt(e,t,n,o,r){void 0===r&&(r=0);var c=At(t.width,t.height,r),l=c.width,i=c.height;return{x:It(e.x,l,n.width,o),y:It(e.y,i,n.height,o)}}function It(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function xt(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Bt(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Tt(e,t,n,o,r,c,l){void 0===c&&(c=0),void 0===l&&(l=!0);var i=l&&0===c?Pt:Rt,a={x:i(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:i(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:i(100,n.width/t.width*100/r),height:i(100,n.height/t.height*100/r)},s=Math.round(i(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(i(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:s,height:Math.round(s/o)};return{croppedAreaPercentages:a,croppedAreaPixels:kt(kt({},d),{x:Math.round(i(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(i(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function Pt(e,t){return Math.min(e,Math.max(0,t))}function Rt(e,t){return t}function Nt(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),c=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*c,y:((t.naturalHeight-e.height)/2-e.y)*c},zoom:r}}function Mt(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Lt(e,t,n,o,r){var c=Math.cos,l=Math.sin,i=r*Math.PI/180;return[(e-n)*c(i)-(t-o)*l(i)+n,(e-n)*l(i)+(t-o)*c(i)+o]}function At(e,t,n){var o=e/2,r=t/2,c=[Lt(0,0,o,r,n),Lt(e,0,o,r,n),Lt(e,t,o,r,n),Lt(0,t,o,r,n)],l=Math.min.apply(Math,c.map((function(e){return e[0]}))),i=Math.max.apply(Math,c.map((function(e){return e[0]}))),a=Math.min.apply(Math,c.map((function(e){return e[1]})));return{width:i-l,height:Math.max.apply(Math,c.map((function(e){return e[1]})))-a}}function Dt(){for(var e=[],t=0;t0})).join(" ").trim()}var Ft=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Nt(t,n.mediaSize,o),c=r.crop,l=r.zoom;n.props.onCropChange(c),n.props.onZoomChange&&n.props.onZoomChange(l)}},n.computeSizes=function(){var e,t,o,r,c,l,i=n.imageRef||n.videoRef;if(i&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:i.offsetWidth,height:i.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var a=n.props.cropSize?n.props.cropSize:St(i.offsetWidth,i.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(c=n.state.cropSize)||void 0===c?void 0:c.height)===a.height&&(null===(l=n.state.cropSize)||void 0===l?void 0:l.width)===a.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(a),n.setState({cropSize:a},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,c=e.y;n.dragStartPosition={x:r,y:c},n.dragStartCrop=kt({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,c={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},l=n.props.restrictPosition?wt(c,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):c;n.props.onCropChange(l)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=Ct()(e).pixelY,c=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(c,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,c=r.crop,l=r.zoom;return{x:(t+c.x)/l,y:(o+c.y)/l}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),c=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),l={x:r.x*c-o.x,y:r.y*c-o.y},i=n.props.restrictPosition?wt(l,n.mediaSize,n.state.cropSize,c,n.props.rotation):l;n.props.onCropChange(i),n.props.onZoomChange(c)}},n.getCropData=function(){return n.state.cropSize?Tt(n.props.restrictPosition?wt(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?wt(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}jt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,o,r,c,l,i,a,s;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(c=e.crop)||void 0===c?void 0:c.x)===(null===(l=this.props.crop)||void 0===l?void 0:l.x)&&(null===(i=e.crop)||void 0===i?void 0:i.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(s=this.videoRef)||void 0===s||s.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=xt(n,o),this.lastPinchRotation=Bt(n,o),this.onDragStart(Mt(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),c=Mt(o,r);this.onDrag(c),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=xt(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,c),n.lastPinchDistance=e;var l=Bt(o,r),i=n.props.rotation+(l-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(i),n.lastPinchRotation=l}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,c=t.transform,l=t.crop,i=l.x,a=l.y,s=t.rotation,u=t.zoom,d=t.cropShape,b=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,h=p.mediaStyle,g=t.classes,O=g.containerClassName,v=g.cropAreaClassName,j=g.mediaClassName,k=t.objectFit;return yt.a.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Dt("reactEasyCrop_Container",O)},n?yt.a.createElement("img",kt({alt:"",className:Dt("reactEasyCrop_Image","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",j)},r,{src:n,ref:function(t){return e.imageRef=t},style:kt(kt({},h),{transform:c||"translate("+i+"px, "+a+"px) rotate("+s+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&yt.a.createElement("video",kt({autoPlay:!0,loop:!0,muted:!0,className:Dt("reactEasyCrop_Video","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",j)},r,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:kt(kt({},h),{transform:c||"translate("+i+"px, "+a+"px) rotate("+s+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return yt.a.createElement("source",kt({key:e.src},e))}))),this.state.cropSize&&yt.a.createElement("div",{style:kt(kt({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Dt("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",b&&"reactEasyCrop_CropAreaGrid",v)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(yt.a.Component);const zt={position:"bottom right",isAlternate:!0};var Ht=n("ywyh"),Vt=n.n(Ht),Gt=n("onLe");function Ut(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,c]=Object(i.useState)(),[l,a]=Object(i.useState)(),[s,u]=Object(i.useState)({x:0,y:0}),[d,b]=Object(i.useState)(),[p,m]=Object(i.useState)(),[f,h]=Object(i.useState)(),[g,O]=Object(i.useState)(),j=Object(i.useCallback)(()=>{u({x:0,y:0}),b(100),m(0),h(n/o),O(n/o)},[n,o,u,b,m,h,O]),k=Object(i.useCallback)(()=>{const e=(p+90)%360;let r=n/o;if(p%180==90&&(r=o/n),0===e)return c(),m(e),h(1/f),void u({x:-s.y*r,y:s.x*r});const l=new window.Image;l.src=t,l.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const i=n.getContext("2d");i.translate(o,l),i.rotate(e*Math.PI/180),i.drawImage(t.target,0,0),n.toBlob(t=>{c(URL.createObjectURL(t)),m(e),h(1/f),u({x:-s.y*r,y:s.x*r})})};const i=Object(v.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof i&&(l.crossOrigin=i)},[p,n,o,c,m,h,u]);return Object(i.useMemo)(()=>({editedUrl:r,setEditedUrl:c,crop:l,setCrop:a,position:s,setPosition:u,zoom:d,setZoom:b,rotation:p,setRotation:m,rotateClockwise:k,aspect:f,setAspect:h,defaultAspect:g,initializeTransformValues:j}),[r,c,l,a,s,u,d,b,p,m,k,f,h,g,j])}(e),{initializeTransformValues:o}=n;return Object(i.useEffect)(()=>{t&&o()},[t,o]),n}const Wt=Object(i.createContext)({}),qt=()=>Object(i.useContext)(Wt);function Kt(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:c,onFinishEditing:l,onSaveImage:a,children:u}=e;const d=Ut({url:n,naturalWidth:o,naturalHeight:r},c),b=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:c,url:l,id:a,onSaveImage:u,onFinishEditing:d}=e;const{createErrorNotice:b}=Object(_.useDispatch)(Gt.store),[p,m]=Object(i.useState)(!1),f=Object(i.useCallback)(()=>{m(!1),d()},[m,d]),h=Object(i.useCallback)(()=>{m(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=l,Vt()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then(e=>{u({id:e.id,url:e.source_url,height:o&&r?r/c:void 0})}).catch(e=>{b(Object(s.sprintf)(Object(s.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})}).finally(()=>{m(!1),d()})},[m,t,n,o,r,c,l,u,b,m,d]);return Object(i.useMemo)(()=>({isInProgress:p,apply:h,cancel:f}),[p,h,f])}({id:t,url:n,onSaveImage:a,onFinishEditing:l,...d}),p=Object(i.useMemo)(()=>({...d,...b}),[d,b]);return Object(i.createElement)(Wt.Provider,{value:p},u)}function Yt(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:c,naturalWidth:l}=e;const{isInProgress:a,editedUrl:s,position:d,zoom:b,aspect:p,setPosition:m,setCrop:f,setZoom:h,rotation:g}=qt();let O=o||r*c/l;return g%180==90&&(O=r*l/c),Object(i.createElement)("div",{className:V()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:O}},Object(i.createElement)(Ft,{image:s||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:b/100,aspect:p,onCropChange:m,onCropComplete:e=>{f(e)},onZoomChange:e=>{h(100*e)}}),a&&Object(i.createElement)(u.Spinner,null))}var $t=n("cGtP");function Zt(){const{isInProgress:e,zoom:t,setZoom:n}=qt();return Object(i.createElement)(u.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:zt,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return Object(i.createElement)(u.ToolbarButton,{icon:$t.a,label:Object(s.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>Object(i.createElement)(u.RangeControl,{label:Object(s.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Xt=n("RMJe");var Qt=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Jt(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:c}=e;return Object(i.createElement)(u.MenuGroup,{label:o},t.map(e=>{let{title:t,aspect:o}=e;return Object(i.createElement)(u.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===c,icon:o===c?Xt.a:void 0},t)}))}function en(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:c}=qt();return Object(i.createElement)(u.DropdownMenu,{icon:Qt,label:Object(s.__)("Aspect Ratio"),popoverProps:zt,toggleProps:t,className:"wp-block-image__aspect-ratio"},e=>{let{onClose:t}=e;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Jt,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:Object(s.__)("Original"),aspect:c},{title:Object(s.__)("Square"),aspect:1}]}),Object(i.createElement)(Jt,{label:Object(s.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:Object(s.__)("16:10"),aspect:1.6},{title:Object(s.__)("16:9"),aspect:16/9},{title:Object(s.__)("4:3"),aspect:4/3},{title:Object(s.__)("3:2"),aspect:1.5}]}),Object(i.createElement)(Jt,{label:Object(s.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:Object(s.__)("10:16"),aspect:.625},{title:Object(s.__)("9:16"),aspect:9/16},{title:Object(s.__)("3:4"),aspect:3/4},{title:Object(s.__)("2:3"),aspect:2/3}]}))})}var tn=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.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"}));function nn(){const{isInProgress:e,rotateClockwise:t}=qt();return Object(i.createElement)(u.ToolbarButton,{icon:tn,label:Object(s.__)("Rotate"),onClick:t,disabled:e})}function on(){const{isInProgress:e,apply:t,cancel:n}=qt();return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ToolbarButton,{onClick:t,disabled:e},Object(s.__)("Apply")),Object(i.createElement)(u.ToolbarButton,{onClick:n},Object(s.__)("Cancel")))}function rn(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:c,naturalWidth:l}=e;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Yt,{url:t,width:n,height:o,clientWidth:r,naturalHeight:c,naturalWidth:l}),Object(i.createElement)(W.b,null,Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(Zt,null),Object(i.createElement)(u.ToolbarItem,null,e=>Object(i.createElement)(en,{toggleProps:e})),Object(i.createElement)(nn,null)),Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(on,null))))}const cn=[25,50,75,100];function ln(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:c,width:l,height:d,onChange:b,onChangeImage:p=a.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:g}=function(e,t,n,o,r){var c,l;const[a,s]=Object(i.useState)(null!==(c=null!=t?t:o)&&void 0!==c?c:""),[u,d]=Object(i.useState)(null!==(l=null!=e?e:n)&&void 0!==l?l:"");return Object(i.useEffect)(()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&d(n)},[o,n]),Object(i.useEffect)(()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)},[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?s(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),s(null!=t?t:o),r({height:e,width:t})}}}(d,l,n,t,b);return Object(i.createElement)(i.Fragment,null,!Object(a.isEmpty)(o)&&Object(i.createElement)(u.SelectControl,{label:Object(s.__)("Image size"),value:c,options:o,onChange:p}),r&&Object(i.createElement)("div",{className:"block-editor-image-size-control"},Object(i.createElement)("p",{className:"block-editor-image-size-control__row"},Object(s.__)("Image dimensions")),Object(i.createElement)("div",{className:"block-editor-image-size-control__row"},Object(i.createElement)(u.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:Object(s.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),Object(i.createElement)(u.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:Object(s.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),Object(i.createElement)("div",{className:"block-editor-image-size-control__row"},Object(i.createElement)(u.ButtonGroup,{"aria-label":Object(s.__)("Image size presets")},cn.map(e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),c=f===o&&m===r;return Object(i.createElement)(u.Button,{key:e,isSmall:!0,variant:c?"primary":void 0,isPressed:c,onClick:()=>g(r,o)},e,"%")})),Object(i.createElement)(u.Button,{isSmall:!0,onClick:()=>g()},Object(s.__)("Reset")))))}var an=n("p3NJ"),sn=n("1oY3"),un=n("0E5u"),dn=n("btIw"),bn=n("1CF3");var pn=e=>{let{value:t,onChange:n=a.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},c=o.map(e=>Object(i.createElement)(u.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]}));return Object(i.createElement)("fieldset",{className:"block-editor-link-control__settings"},Object(i.createElement)(u.VisuallyHidden,{as:"legend"},Object(s.__)("Currently selected link settings")),c)},mn=n("9Do8"),fn=n.n(mn),hn=n("Mmq9");class gn extends i.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||Object(i.createRef)(),this.inputRef=Object(i.createRef)(),this.updateSuggestions=Object(a.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,fn()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout(()=>{this.scrollingIntoView=!1},100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&Object(hn.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const c=n(t,{isInitialSuggestions:r});c.then(e=>{this.suggestionsRequest===c&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak(Object(s.sprintf)(Object(s._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak(Object(s.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)}).catch(()=>{this.suggestionsRequest===c&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)}),this.suggestionsRequest=c}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case M.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case M.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case M.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const c=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case M.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case M.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case M.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(c),this.props.speak(Object(s.__)("Link selected.")));break;case M.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(c),this.props.onSubmit&&this.props.onSubmit(c,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:c=!1}=e,{showSuggestions:l}=t,i=l;const a=n&&n.length;return c||a||(i=!1),!0===r&&(i=!1),{showSuggestions:i,suggestionsListboxId:"block-editor-url-input-suggestions-"+o,suggestionOptionIdPrefix:"block-editor-url-input-suggestion-"+o}}render(){return Object(i.createElement)(i.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=Object(s.__)("Paste URL or type to search"),__experimentalRenderControl:c,value:l=""}=this.props,{loading:a,showSuggestions:d,selectedSuggestion:b,suggestionsListboxId:p,suggestionOptionIdPrefix:m}=this.state,f={id:"url-input-control-"+o,label:e,className:V()("block-editor-url-input",t,{"is-full-width":n})},h={value:l,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":Object(s.__)("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-owns":p,"aria-activedescendant":null!==b?`${m}-${b}`:void 0,ref:this.inputRef};return c?c(f,h,a):Object(i.createElement)(u.BaseControl,f,Object(i.createElement)("input",h),a&&Object(i.createElement)(u.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:c,selectedSuggestion:s,suggestionsListboxId:d,suggestionOptionIdPrefix:b,loading:p}=this.state,m={id:d,ref:this.autocompleteRef,role:"listbox"},f=(e,t)=>({role:"option",tabIndex:"-1",id:`${b}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===s});return Object(a.isFunction)(t)&&r&&c.length?t({suggestions:c,selectedSuggestion:s,suggestionsListProps:m,buildSuggestionItemProps:f,isLoading:p,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!Object(a.isFunction)(t)&&r&&c.length?Object(i.createElement)(u.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},Object(i.createElement)("div",Object(l.a)({},m,{className:V()("block-editor-url-input__suggestions",e+"__suggestions")}),c.map((e,t)=>Object(i.createElement)(u.Button,Object(l.a)({},f(0,t),{key:e.id,className:V()("block-editor-url-input__suggestion",{"is-selected":t===s}),onClick:()=>this.handleOnClick(e)}),e.title)))):null}}var On=Object(Q.compose)(Q.withSafeTimeout,u.withSpokenMessages,Q.withInstanceId,Object(_.withSelect)((e,t)=>{if(Object(a.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(S.a);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}}))(gn),vn=n("Q4Sy");var jn=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:c,buttonText:d}=e;return n?(t=d?Object(a.isFunction)(d)?d(n):d:Object(i.createInterpolateElement)(Object(s.sprintf)(Object(s.__)("Create: %s"),n),{mark:Object(i.createElement)("mark",null)}),Object(i.createElement)(u.Button,Object(l.a)({},r,{className:V()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":c}),onClick:o}),Object(i.createElement)(A.a,{className:"block-editor-link-control__search-item-icon",icon:vn.a}),Object(i.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(i.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},kn=n("K8zD");var _n=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:c=!1,searchTerm:a="",shouldShowType:d=!1}=e;return Object(i.createElement)(u.Button,Object(l.a)({},t,{onClick:r,className:V()("block-editor-link-control__search-item",{"is-selected":o,"is-url":c,"is-entity":!c})}),c&&Object(i.createElement)(A.a,{className:"block-editor-link-control__search-item-icon",icon:kn.a}),Object(i.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(i.createElement)("span",{className:"block-editor-link-control__search-item-title"},Object(i.createElement)(u.TextHighlight,{text:n.title,highlight:a})),Object(i.createElement)("span",{"aria-hidden":!c,className:"block-editor-link-control__search-item-info"},!c&&(Object(hn.filterURLForDisplay)(Object(hn.safeDecodeURI)(n.url))||""),c&&Object(s.__)("Press ENTER to add this link"))),d&&n.type&&Object(i.createElement)("span",{className:"block-editor-link-control__search-item-type"},"post_tag"===n.type?"tag":n.type))};const yn=[{id:"opensInNewTab",title:Object(s.__)("Open in new tab")}];function En(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:c,buildSuggestionItemProps:a,suggestions:d,selectedSuggestion:b,isLoading:p,isInitialSuggestions:m,createSuggestionButtonText:f,suggestionsQuery:h}=e;const g=V()("block-editor-link-control__search-results",{"is-loading":p}),O=["url","mailto","tel","internal"],v=1===d.length&&O.includes(d[0].type.toLowerCase()),j=n&&!v&&!m,k=!(null!=h&&h.type),_="block-editor-link-control-search-results-label-"+t,y=m?Object(s.__)("Recently updated"):Object(s.sprintf)(Object(s.__)('Search results for "%s"'),o),E=Object(i.createElement)(m?i.Fragment:u.VisuallyHidden,{},Object(i.createElement)("span",{className:"block-editor-link-control__search-results-label",id:_},y));return Object(i.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},E,Object(i.createElement)("div",Object(l.a)({},c,{className:g,"aria-labelledby":_}),d.map((e,t)=>j&&"__CREATE__"===e.type?Object(i.createElement)(jn,{searchTerm:o,buttonText:f,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===b}):"__CREATE__"===e.type?null:Object(i.createElement)(_n,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===b,isURL:O.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:k}))))}function Cn(e){const t=Object(a.startsWith)(e,"#");return Object(hn.isURL)(e)||e&&e.includes("www.")||t}const Sn=()=>Promise.resolve([]),wn=e=>{let t="URL";const n=Object(hn.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),Object(a.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?Object(hn.prependHTTP)(e):e,type:t}])};function In(e,t,n,o){const{fetchSearchSuggestions:r}=Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return{fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}},[]),c=t?wn:Sn;return Object(i.useCallback)((t,l)=>{let{isInitialSuggestions:i}=l;return Cn(t)?c(t,{isInitialSuggestions:i}):(async(e,t,n,o,r,c)=>{const{isInitialSuggestions:l}=t;let i=await Promise.all([n(e,t),o(e)]);return i=!e.includes(" ")&&c&&!l?i[0].concat(i[1]):i[0],l||Cn(e)||!r?i:i.concat({title:e,url:e,type:"__CREATE__"})})(t,{...e,isInitialSuggestions:i},r,c,n,o)},[c,r,n])}const xn=()=>Promise.resolve([]),Bn=Object(i.forwardRef)((e,t)=>{let{value:n,children:o,currentLink:r={},className:c=null,placeholder:l=null,withCreateSuggestion:u=!1,onCreateSuggestion:d=a.noop,onChange:b=a.noop,onSelect:p=a.noop,showSuggestions:m=!0,renderSuggestions:f=(e=>Object(i.createElement)(En,e)),fetchSuggestions:h=null,allowDirectEntry:g=!0,showInitialSuggestions:O=!1,suggestionsQuery:v={},withURLSuggestion:j=!0,createSuggestionButtonText:k,useLabel:_=!1}=e;const y=In(v,g,u,j),E=m?h||y:xn,C=Object(Q.useInstanceId)(Bn),[S,w]=Object(i.useState)(),I=async e=>{let t=e;if("__CREATE__"!==e.type)(g||t&&Object.keys(t).length>=1)&&p({...Object(a.omit)(r,"id","url"),...t},t);else try{var n;t=await d(e.title),null!==(n=t)&&void 0!==n&&n.url&&p(t)}catch(e){}},x=V()(c,{"has-no-label":!_});return Object(i.createElement)("div",{className:"block-editor-link-control__search-input-container"},Object(i.createElement)(On,{label:_?"URL":void 0,className:x,value:n,onChange:(e,t)=>{b(e),w(t)},placeholder:null!=l?l:Object(s.__)("Search or type url"),__experimentalRenderSuggestions:m?e=>f({...e,instanceId:C,withCreateSuggestion:u,currentInputValue:n,createSuggestionButtonText:k,suggestionsQuery:v,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:E,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:O,onSubmit:(e,t)=>{var o;const r=e||S;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?I(r||{url:n}):t.preventDefault()},ref:t}),o)});var Tn=Bn,Pn=n("FnAh"),Rn=n("B9Az"),Nn=n("Mp0b");const{Slot:Mn,Fill:Ln}=Object(u.createSlotFill)("BlockEditorLinkControlViewer");function An(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error("Unexpected action type "+t.type)}}var Dn=function(e){const[t,n]=Object(i.useReducer)(An,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}},[]);return Object(i.useEffect)(()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then(e=>{n({type:"RESOLVED",richData:e})}).catch(()=>{r.aborted||n({type:"ERROR"})}),()=>{t.abort()}}},[e]),t};function Fn(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:c=!1,onRemove:l}=e;const a=r?null==n?void 0:n.url:null,{richData:d,isFetching:b}=Dn(a),p=d&&Object.keys(d).length,m=n&&Object(hn.filterURLForDisplay)(Object(hn.safeDecodeURI)(n.url),16)||"",f=(null==d?void 0:d.title)||(null==n?void 0:n.title)||m,h=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let g;return g=null!=d&&d.icon?Object(i.createElement)("img",{src:null==d?void 0:d.icon,alt:""}):h?Object(i.createElement)(A.a,{icon:Pn.a,size:32}):Object(i.createElement)(A.a,{icon:kn.a}),Object(i.createElement)("div",{"aria-label":Object(s.__)("Currently selected"),"aria-selected":"true",className:V()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":p,"is-fetching":!!b,"is-preview":!0,"is-error":h})},Object(i.createElement)("div",{className:"block-editor-link-control__search-item-top"},Object(i.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(i.createElement)("span",{className:V()("block-editor-link-control__search-item-icon",{"is-image":null==d?void 0:d.icon})},g),Object(i.createElement)("span",{className:"block-editor-link-control__search-item-details"},h?Object(i.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},"Link is empty"):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},Object(bn.__unstableStripHTML)(f)),(null==n?void 0:n.url)&&Object(i.createElement)("span",{className:"block-editor-link-control__search-item-info"},m)))),Object(i.createElement)(u.Button,{icon:Rn.a,label:Object(s.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),c&&Object(i.createElement)(u.Button,{icon:Nn.a,label:Object(s.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),Object(i.createElement)(Mn,{fillProps:n})),(p&&((null==d?void 0:d.image)||(null==d?void 0:d.description))||b)&&Object(i.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==d?void 0:d.image)||b)&&Object(i.createElement)("div",{"aria-hidden":!(null!=d&&d.image),className:V()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=d&&d.image)})},(null==d?void 0:d.image)&&Object(i.createElement)("img",{src:null==d?void 0:d.image,alt:""})),((null==d?void 0:d.description)||b)&&Object(i.createElement)("div",{"aria-hidden":!(null!=d&&d.description),className:V()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=d&&d.description)})},(null==d?void 0:d.description)&&Object(i.createElement)(u.__experimentalText,{truncate:!0,numberOfLines:"2"},d.description))))}const zn=e=>{let t=!1;return{promise:new Promise((n,o)=>{e.then(e=>t?o({isCanceled:!0}):n(e),e=>o(t?{isCanceled:!0}:e))}),cancel(){t=!0}}};function Hn(e){var t,n,o;let{searchInputPlaceholder:r,value:c,settings:l=yn,onChange:d=a.noop,onRemove:b,noDirectEntry:p=!1,showSuggestions:m=!0,showInitialSuggestions:f,forceIsEditingLink:h,createSuggestion:g,withCreateSuggestion:O,inputValue:v="",suggestionsQuery:j={},noURLSuggestion:k=!1,createSuggestionButtonText:_,hasRichPreviews:y=!1,hasTextControl:E=!1,renderControlBottom:C=null}=e;void 0===O&&g&&(O=!0);const S=Object(i.useRef)(!0),w=Object(i.useRef)(),I=Object(i.useRef)(),[x,B]=Object(i.useState)((null==c?void 0:c.url)||""),[T,P]=Object(i.useState)((null==c?void 0:c.title)||""),R=v||x,[N,L]=Object(i.useState)(void 0!==h?h:!c||!c.url),A=Object(i.useRef)(!1),D=!(null!=R&&null!==(t=R.trim())&&void 0!==t&&t.length);function F(){var e;A.current=!(null===(e=w.current)||void 0===e||!e.contains(w.current.ownerDocument.activeElement)),L(!1)}Object(i.useEffect)(()=>{void 0!==h&&h!==N&&L(h)},[h]),Object(i.useEffect)(()=>{if(S.current)return void(S.current=!1);const e=null!=I&&I.current?1:0;(bn.focus.focusable.find(w.current)[e]||w.current).focus(),A.current=!1},[N]),Object(i.useEffect)(()=>{null!=c&&c.title&&c.title!==T&&P(c.title),null!=c&&c.url&&B(c.url)},[c]);const{createPage:z,isCreatingPage:H,errorMessage:G}=function(e){const t=Object(i.useRef)(),[n,o]=Object(i.useState)(!1),[r,c]=Object(i.useState)(null);return Object(i.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:async function(n){o(!0),c(null);try{return t.current=zn(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw c(e.message||Object(s.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(g),U=()=>{R===(null==c?void 0:c.url)&&T===(null==c?void 0:c.title)||d({url:R,title:T}),F()},W=b&&c&&!N&&!H,q=!(null==l||!l.length),K=(null==c||null===(n=c.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&E;return Object(i.createElement)("div",{tabIndex:-1,ref:w,className:"block-editor-link-control"},H&&Object(i.createElement)("div",{className:"block-editor-link-control__loading"},Object(i.createElement)(u.Spinner,null)," ",Object(s.__)("Creating"),"…"),(N||!c)&&!H&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:V()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":K})},K&&Object(i.createElement)(u.TextControl,{ref:I,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:T,onChange:P,onKeyDown:e=>{const{keyCode:t}=e;t!==M.ENTER||D||(e.preventDefault(),U())}}),Object(i.createElement)(Tn,{currentLink:c,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:R,withCreateSuggestion:O,onCreateSuggestion:z,onChange:B,onSelect:e=>{d({...e,title:T||(null==e?void 0:e.title)}),F()},showInitialSuggestions:f,allowDirectEntry:!p,showSuggestions:m,suggestionsQuery:j,withURLSuggestion:!k,createSuggestionButtonText:_,useLabel:K},Object(i.createElement)("div",{className:"block-editor-link-control__search-actions"},Object(i.createElement)(u.Button,{onClick:U,label:Object(s.__)("Submit"),icon:dn.a,className:"block-editor-link-control__search-submit",disabled:D})))),G&&Object(i.createElement)(u.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},G)),c&&!N&&!H&&Object(i.createElement)(Fn,{key:null==c?void 0:c.url,value:c,onEditClick:()=>L(!0),hasRichPreviews:y,hasUnlinkControl:W,onRemove:b}),q&&Object(i.createElement)("div",{className:"block-editor-link-control__tools"},Object(i.createElement)(pn,{value:c,settings:l,onChange:d})),C&&C())}Hn.ViewerFill=Ln;var Vn=Hn,Gn=n("weEX"),Un=n("gdqT"),Wn=n("rH4q"),qn=n("NTP4");var Kn=Object(u.withFilters)("editor.MediaUpload")(()=>null);var Yn=function(e){let{fallback:t=null,children:n}=e;return Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return!!t().mediaUpload},[])?n:t};var $n=Object(Q.compose)([Object(_.withDispatch)(e=>{const{createNotice:t,removeNotice:n}=e(Gt.store);return{createNotice:t,removeNotice:n}}),Object(u.withFilters)("editor.MediaReplaceFlow")])(e=>{let{mediaURL:t,mediaId:n,allowedTypes:o,accept:r,onSelect:c,onSelectURL:l,onFilesUpload:d=a.noop,name:b=Object(s.__)("Replace"),createNotice:p,removeNotice:m,children:f}=e;const[h,g]=Object(i.useState)(t),O=Object(_.useSelect)(e=>e(S.a).getSettings().mediaUpload,[]),v=Object(i.createRef)(),j=Object(a.uniqueId)("block-editor/media-replace-flow/error-notice/"),k=e=>{const t=document.createElement("div");t.innerHTML=Object(i.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout(()=>{p("error",n,{speak:!0,id:j,isDismissible:!0})},1e3)},y=e=>{g(e.url),c(e),Object(Un.speak)(Object(s.__)("The media file has been replaced")),m(j)},E=e=>{e.keyCode===M.DOWN&&(e.preventDefault(),e.target.click())};return Object(i.createElement)(u.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(i.createElement)(u.ToolbarButton,{ref:v,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:E},b)},renderContent:e=>{let{onClose:t}=e;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},Object(i.createElement)(Kn,{value:n,onSelect:e=>y(e),allowedTypes:o,render:e=>{let{open:t}=e;return Object(i.createElement)(u.MenuItem,{icon:Wn.a,onClick:t},Object(s.__)("Open Media Library"))}}),Object(i.createElement)(Yn,null,Object(i.createElement)(u.FormFileUpload,{onChange:e=>{(e=>{const t=e.target.files;d(t);O({allowedTypes:o,filesList:t,onFileChange:e=>{let[t]=e;y(t)},onError:k})})(e)},accept:r,render:e=>{let{openFileDialog:t}=e;return Object(i.createElement)(u.MenuItem,{icon:qn.a,onClick:()=>{t()}},Object(s.__)("Upload"))}})),f),l&&Object(i.createElement)("form",{className:"block-editor-media-flow__url-input"},Object(i.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},Object(s.__)("Current media URL:")),Object(i.createElement)(Vn,{value:{url:h},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;g(t),l(t),v.current.focus()}})))}})}),Zn=n("NMb1"),Xn=n.n(Zn);function Qn(e){let{url:t,urlLabel:n,className:o}=e;const r=V()(o,"block-editor-url-popover__link-viewer-url");return t?Object(i.createElement)(u.ExternalLink,{className:r,href:t},n||Object(hn.filterURLForDisplay)(Object(hn.safeDecodeURI)(t))):Object(i.createElement)("span",{className:r})}function Jn(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:c="firstElement",...a}=e;const[d,b]=Object(i.useState)(!1),p=!!o&&d;return Object(i.createElement)(u.Popover,Object(l.a)({className:"block-editor-url-popover",focusOnMount:c,position:r},a),Object(i.createElement)("div",{className:"block-editor-url-popover__input-container"},Object(i.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&Object(i.createElement)(u.Button,{className:"block-editor-url-popover__settings-toggle",icon:qe.a,label:Object(s.__)("Link settings"),onClick:()=>{b(!d)},"aria-expanded":d})),p&&Object(i.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!p&&Object(i.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}Jn.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...c}=e;return Object(i.createElement)("form",Object(l.a)({className:V()("block-editor-url-popover__link-editor",n)},c),Object(i.createElement)(On,{value:r,onChange:o,autocompleteRef:t}),Object(i.createElement)(u.Button,{icon:dn.a,label:Object(s.__)("Apply"),type:"submit"}))},Jn.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:c,...a}=e;return Object(i.createElement)("div",Object(l.a)({className:V()("block-editor-url-popover__link-viewer",t)},a),Object(i.createElement)(Qn,{url:r,urlLabel:c,className:n}),o&&Object(i.createElement)(u.Button,{icon:Rn.a,label:Object(s.__)("Edit"),onClick:o}))};var eo=Jn;const to=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return Object(i.createElement)(eo,{onClose:r},Object(i.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},Object(i.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":Object(s.__)("URL"),placeholder:Object(s.__)("Paste or type URL"),onChange:n,value:t}),Object(i.createElement)(u.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:dn.a,label:Object(s.__)("Apply"),type:"submit"})))};var no=Object(u.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:c={},mediaPreview:l,notices:d,isAppender:b,accept:p,addToGallery:m,multiple:f=!1,handleUpload:h=!0,dropZoneUIOnly:g,disableDropZone:O,disableMediaButtons:v,onError:j,onSelect:k,onCancel:y,onSelectURL:E,onDoubleClick:C,onFilesPreUpload:w=a.noop,onHTMLDrop:I=a.noop,children:x,mediaLibraryButton:B,placeholder:T,style:P}=e;const R=Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return t().mediaUpload},[]),[N,M]=Object(i.useState)(""),[L,A]=Object(i.useState)(!1);Object(i.useEffect)(()=>{var e;M(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")},[null==t?void 0:t.src]);const D=e=>{M(e.target.value)},F=()=>{A(!0)},z=()=>{A(!1)},H=e=>{e.preventDefault(),N&&E&&(E(N),z())},G=e=>{if(!h)return k(e);let o;if(w(e),f)if(m){let e=[];o=n=>{const o=(null!=t?t:[]).filter(t=>t.id?!e.some(e=>{let{id:n}=e;return Number(n)===Number(t.id)}):!e.some(e=>{let{urlSlug:n}=e;return t.url.includes(n)}));k(o.concat(n)),e=n.map(e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}})}}else o=k;else o=e=>{let[t]=e;return k(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:j})},U=e=>{G(e.target.files)},W=null!=T?T:e=>{let{instructions:t,title:a}=c;if(R||E||(t=Object(s.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===a){const e=null!=n?n:[],[o]=e,r=1===e.length,c=r&&"audio"===o,l=r&&"image"===o,i=r&&"video"===o;void 0===t&&R&&(t=Object(s.__)("Upload a media file or pick one from your media library."),c?t=Object(s.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?t=Object(s.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(t=Object(s.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===a&&(a=Object(s.__)("Media"),c?a=Object(s.__)("Audio"):l?a=Object(s.__)("Image"):i&&(a=Object(s.__)("Video")))}const p=V()("block-editor-media-placeholder",o,{"is-appender":b});return Object(i.createElement)(u.Placeholder,{icon:r,label:a,instructions:t,className:p,notices:d,onDoubleClick:C,preview:l,style:P},e,x)},q=()=>O?null:Object(i.createElement)(u.DropZone,{onFilesDrop:G,onHTMLDrop:I}),K=()=>y&&Object(i.createElement)(u.Button,{className:"block-editor-media-placeholder__cancel-button",title:Object(s.__)("Cancel"),variant:"link",onClick:y},Object(s.__)("Cancel")),Y=()=>E&&Object(i.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},Object(i.createElement)(u.Button,{className:"block-editor-media-placeholder__button",onClick:F,isPressed:L,variant:"tertiary"},Object(s.__)("Insert from URL")),L&&Object(i.createElement)(to,{src:N,onChange:D,onSubmit:H,onClose:z}));return g||v?(g&&Xn()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),Object(i.createElement)(Yn,null,q())):Object(i.createElement)(Yn,{fallback:W(Y())},(()=>{const e=null!=B?B:e=>{let{open:t}=e;return Object(i.createElement)(u.Button,{variant:"tertiary",onClick:()=>{t()}},Object(s.__)("Media Library"))},o=Object(i.createElement)(Kn,{addToGallery:m,gallery:f&&!(!n||0===n.length)&&n.every(e=>"image"===e||e.startsWith("image/")),multiple:f,onSelect:k,allowedTypes:n,value:Array.isArray(t)?t.map(e=>{let{id:t}=e;return t}):t.id,render:e});if(R&&b)return Object(i.createElement)(i.Fragment,null,q(),Object(i.createElement)(u.FormFileUpload,{onChange:U,accept:p,multiple:f,render:e=>{let{openFileDialog:t}=e;const n=Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.Button,{variant:"primary",className:V()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},Object(s.__)("Upload")),o,Y(),K());return W(n)}}));if(R){const e=Object(i.createElement)(i.Fragment,null,q(),Object(i.createElement)(u.FormFileUpload,{variant:"primary",className:V()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:p,multiple:f},Object(s.__)("Upload")),o,Y(),K());return W(e)}return W(o)})())}));var oo=e=>{let{colorSettings:t,...n}=e;const o=t.map(e=>{let{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}});return Object(i.createElement)(vt.a,Object(l.a)({settings:o,gradients:[],disableCustomGradients:!0},n))},ro=n("O6Fj"),co=n.n(ro),lo=n("qRz9");const io={position:"bottom right",isAlternate:!0};var ao=()=>Object(i.createElement)(i.Fragment,null,["bold","italic","link"].map(e=>Object(i.createElement)(u.Slot,{name:"RichText.ToolbarControls."+e,key:e})),Object(i.createElement)(u.Slot,{name:"RichText.ToolbarControls"},e=>{if(!e.length)return null;const t=e.map(e=>{let[{props:t}]=e;return t}).some(e=>{let{isActive:t}=e;return t});return Object(i.createElement)(u.ToolbarItem,null,n=>Object(i.createElement)(u.DropdownMenu,{icon:qe.a,label:Object(s.__)("More"),toggleProps:{...n,className:V()(n.className,{"is-pressed":t}),describedBy:Object(s.__)("Displays more block tools")},controls:Object(a.orderBy)(e.map(e=>{let[{props:t}]=e;return t}),"title"),popoverProps:io}))}));var so=e=>{let{inline:t,anchorRef:n}=e;return t?Object(i.createElement)(u.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},Object(i.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(ao,null)))):Object(i.createElement)(W.b,{group:"inline"},Object(i.createElement)(ao,null))};function uo(){const{didAutomaticChange:e,getSettings:t}=Object(_.useSelect)(S.a);return Object(Q.useRefEffect)(n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==M.DELETE&&o!==M.BACKSPACE&&o!==M.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}},[])}var bo=n("xTGt");function po(e){return e.filter(e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif)$/.test(t)}).map(e=>``).join("")}var mo=n("SVSp");function fo(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function ho(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function go(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?go.EMPTY_ARRAY:t||n?t||(Xn()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),n.map(e=>"core/"+e)):void 0}go.EMPTY_ARRAY=[];function Oo(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:c,multilineTag:l}=e;if(!o||!r)return;const i=[],[a,s]=Object(lo.split)(t),u=n.length>0;let d=-1;const b=Object(lo.isEmpty)(a)&&!Object(lo.isEmpty)(s);u&&Object(lo.isEmpty)(a)||(i.push(r(Object(lo.toHTMLString)({value:a,multilineTag:l}),!b)),d+=1),u?(i.push(...n),d+=n.length):c&&i.push(c()),(u||c)&&Object(lo.isEmpty)(s)||i.push(r(Object(lo.toHTMLString)({value:s,multilineTag:l}),b));o(i,u?d:1,u?-1:0)}function vo(e,t){return t?Object(lo.replace)(e,/\n+/g,lo.__UNSTABLE_LINE_SEPARATOR):Object(lo.replace)(e,new RegExp(lo.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function jo(e){const t=Object(i.useRef)(e);return t.current=e,Object(Q.useRefEffect)(e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:c,formatTypes:l,tagName:i,onReplace:a,onSplit:s,onSplitMiddle:u,__unstableEmbedURLOnPaste:d,multilineTag:b,preserveWhiteSpace:p,pastePlainText:m}=t.current;if(!n)return void e.preventDefault();const{clipboardData:f}=e;let h="",g="";try{h=f.getData("text/plain"),g=f.getData("text/html")}catch(e){try{g=f.getData("Text")}catch(e){return}}if(g=function(e){return e.replace(/.*/s,"").replace(/.*/s,"")}(g),g=function(e){const t="";if(e.startsWith(t))return e.slice(t.length);return e}(g),e.preventDefault(),window.console.log("Received HTML:\n\n",g),window.console.log("Received plain text:\n\n",h),o)return void r(Object(lo.insert)(c,h));const O=l.reduce((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===c&&(e=n(c,{html:g,plainText:h})),e},c);if(O!==c)return void r(O);const v=[...Object(bn.getFilesFromDataTransfer)(f)];if("true"===f.getData("rich-text")){const e=f.getData("rich-text-multi-line-tag")||void 0;let t=Object(lo.create)({html:g,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:p});return t=vo(t,!!b),fo(t,c.activeFormats),void r(Object(lo.insert)(c,t))}if(m)return void r(Object(lo.insert)(c,Object(lo.create)({text:h})));if(v&&v.length&&!g){const e=Object(j.pasteHandler)({HTML:po(v),mode:"BLOCKS",tagName:i,preserveWhiteSpace:p});return window.console.log("Received items:\n\n",v),void(a&&Object(lo.isEmpty)(c)?a(e):Oo({value:c,pastedBlocks:e,onReplace:a,onSplit:s,onSplitMiddle:u,multilineTag:b}))}let k=a&&s?"AUTO":"INLINE";var _;"AUTO"===k&&Object(lo.isEmpty)(c)&&(_=h,Object(mo.regexp)(".*").test(_))&&(k="BLOCKS"),d&&Object(lo.isEmpty)(c)&&Object(hn.isURL)(h.trim())&&(k="BLOCKS");const y=Object(j.pasteHandler)({HTML:g,plainText:h,mode:k,tagName:i,preserveWhiteSpace:p});if("string"==typeof y){let e=Object(lo.create)({html:y});e=vo(e,!!b),fo(e,c.activeFormats),r(Object(lo.insert)(c,e))}else y.length>0&&(a&&Object(lo.isEmpty)(c)?a(y,y.length-1,-1):Oo({value:c,pastedBlocks:y,onReplace:a,onSplit:s,onSplitMiddle:u,multilineTag:b}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}},[])}function ko(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=Object(_.useDispatch)(S.a),o=Object(i.useRef)(e);return o.current=e,Object(Q.useRefEffect)(e=>{function r(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:r,text:c}=e;if(" "!==c.slice(r-1,r))return;const l=c.slice(0,r).trim(),i=Object(j.getBlockTransforms)("from").filter(e=>{let{type:t}=e;return"prefix"===t}),a=Object(j.findTransform)(i,e=>{let{prefix:t}=e;return l===t});if(!a)return;const s=Object(lo.toHTMLString)({value:Object(lo.slice)(e,r,c.length)});t([a.transform(s)]),n()}function c(e){const{inputType:c,type:l}=e,{value:i,onChange:a,__unstableAllowPrefixTransformations:s,formatTypes:u}=o.current;if("insertText"!==c&&"compositionend"!==l)return;s&&r&&r();const d=u.reduce((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e},i);d!==i&&(t(),a({...d,activeFormats:i.activeFormats}),n())}return e.addEventListener("input",c),e.addEventListener("compositionend",c),()=>{e.removeEventListener("input",c),e.removeEventListener("compositionend",c)}},[])}function _o(e){const{__unstableMarkAutomaticChange:t}=Object(_.useDispatch)(S.a),n=Object(i.useRef)(e);return n.current=e,Object(Q.useRefEffect)(e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:r,onReplace:c,onSplit:l,onSplitMiddle:i,multilineTag:a,onChange:s,disableLineBreaks:u,onSplitAtEnd:d}=n.current;if(e.keyCode!==M.ENTER)return;e.preventDefault();const b={...r};b.formats=o(r);const p=c&&l;if(c){const e=Object(j.getBlockTransforms)("from").filter(e=>{let{type:t}=e;return"enter"===t}),n=Object(j.findTransform)(e,e=>e.regExp.test(b.text));n&&(c([n.transform({content:b.text})]),t())}if(a)e.shiftKey?u||s(Object(lo.insert)(b,"\n")):p&&Object(lo.__unstableIsEmptyLine)(b)?Oo({value:b,onReplace:c,onSplit:l,onSplitMiddle:i,multilineTag:a}):s(Object(lo.__unstableInsertLineSeparator)(b));else{const{text:t,start:n,end:o}=b,r=d&&n===o&&o===t.length;e.shiftKey||!p&&!r?u||s(Object(lo.insert)(b,"\n")):!p&&r?d():p&&Oo({value:b,onReplace:c,onSplit:l,onSplitMiddle:i,multilineTag:a})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[])}function yo(e){return e(lo.store).getFormatTypes()}const Eo=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Co(e){return Object(Q.useRefEffect)(t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},[])}function So(e){return Object(Q.useRefEffect)(t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}},[])}function wo(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:c}=e;return t.map(e=>{const{name:t,edit:l}=e;if(!l)return null;const s=Object(lo.getActiveFormat)(r,t);let u=void 0!==s;const d=Object(lo.getActiveObject)(r),b=void 0!==d&&d.type===t;if("core/link"===t&&!Object(lo.isCollapsed)(r)){const e=r.formats,t=Object(a.find)(e[r.start],{type:"core/link"}),n=Object(a.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(u=!1)}return Object(i.createElement)(l,{key:t,isActive:u,activeAttributes:u&&s.attributes||{},isObjectActive:b,activeObjectAttributes:b&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:c})})}const Io=Object(i.createContext)(),xo=Object(i.createContext)();const Bo=Object(i.forwardRef)((function e(t,n){let{children:o,tagName:r="div",value:c="",onChange:s,isSelected:d,multiline:b,inlineToolbar:p,wrapperClassName:m,autocompleters:f,onReplace:h,placeholder:g,allowedFormats:O,formattingControls:v,withoutInteractiveFormatting:y,onRemove:E,onMerge:C,onSplit:w,__unstableOnSplitAtEnd:I,__unstableOnSplitMiddle:B,identifier:T,preserveWhiteSpace:P,__unstablePastePlainText:R,__unstableEmbedURLOnPaste:N,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:F,...z}=t;const H=Object(Q.useInstanceId)(e);T=T||H,z=function(e){return Object(a.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(z);const G=Object(i.useRef)(),{clientId:U}=Object(k.c)(),{selectionStart:W,selectionEnd:q,isSelected:K,disabled:Y}=Object(_.useSelect)(e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(S.a),c=t(),l=n();let i;return void 0===d?i=c.clientId===U&&c.attributeKey===T:d&&(i=c.clientId===U),{selectionStart:i?c.offset:void 0,selectionEnd:i?l.offset:void 0,isSelected:i,disabled:o()||r()}}),{selectionChange:$}=Object(_.useDispatch)(S.a),Z=ho(b),X=go({allowedFormats:O,formattingControls:v,disableFormats:L}),J=!X||X.length>0;let ee=c,te=s;Array.isArray(c)&&(ee=j.children.toHTML(c),te=e=>s(j.children.fromDOM(Object(lo.__unstableCreateElement)(document,e).childNodes)));const ne=Object(i.useCallback)((e,t)=>{$(U,T,e,t)},[U,T]),{formatTypes:oe,prepareHandlers:re,valueHandlers:ce,changeHandlers:le,dependencies:ie}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const c=Object(_.useSelect)(yo,[]),l=Object(i.useMemo)(()=>c.filter(e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t))&&(!o||!Eo.has(n))}),[c,r,Eo]),a=Object(_.useSelect)(e=>l.reduce((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o),{}),[l,t,n]),s=Object(_.useDispatch)(),u=[],d=[],b=[],p=[];return l.forEach(e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)p.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:n,blockClientId:t})),b.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}}),{formatTypes:l,prepareHandlers:u,valueHandlers:d,changeHandlers:b,dependencies:p}}({clientId:U,identifier:T,withoutInteractiveFormatting:y,allowedFormats:X});function ae(e){return oe.forEach(t=>{t.__experimentalCreatePrepareEditableTree&&(e=Object(lo.removeFormat)(e,t.name,0,e.text.length))}),e.formats}const{value:se,onChange:ue,ref:de}=Object(lo.__unstableUseRichText)({value:ee,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;te(e),Object.values(le).forEach(e=>{e(n,o)})},selectionStart:W,selectionEnd:q,onSelectionChange:ne,placeholder:g,__unstableIsSelected:K,__unstableMultilineTag:Z,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...ie,r],__unstableAfterParse:function(e){return ce.reduce((t,n)=>n(t,e.text),e.formats)},__unstableBeforeSerialize:ae,__unstableAddInvisibleFormats:function(e){return re.reduce((t,n)=>n(t,e.text),e.formats)}}),be=function(e){return Object(u.__unstableUseAutocompleteProps)({...e,completers:x(e)})}({onReplace:h,completers:f,record:se,onChange:ue});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=Object(_.useSelect)(S.a),{enterFormattedText:r,exitFormattedText:c}=Object(_.useDispatch)(S.a);Object(i.useEffect)(()=>{n?o()||r():o()&&c()},[n])}({value:se}),function(e){let{html:t,value:n}=e;const o=Object(i.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:c}=Object(_.useDispatch)(S.a);Object(i.useLayoutEffect)(()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout(()=>{c()},1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}c()}else o.current=n.text},[t,r])}({html:ee,value:se});const pe=Object(i.useRef)(new Set),me=Object(i.useRef)(new Set);function fe(){G.current.focus()}const he=r,ge=Object(i.createElement)(i.Fragment,null,K&&Object(i.createElement)(Io.Provider,{value:pe},Object(i.createElement)(xo.Provider,{value:me},Object(i.createElement)(u.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:se,onChange:ue,onFocus:fe}),Object(i.createElement)(wo,{value:se,onChange:ue,onFocus:fe,formatTypes:oe,forwardedRef:G})))),K&&J&&Object(i.createElement)(so,{inline:p,anchorRef:G.current}),Object(i.createElement)(he,Object(l.a)({role:"textbox","aria-multiline":!0,"aria-label":g},z,be,{ref:Object(Q.useMergeRefs)([be.ref,z.ref,de,ko({value:se,onChange:ue,__unstableAllowPrefixTransformations:F,formatTypes:oe,onReplace:h}),Object(Q.useRefEffect)(e=>{function t(e){(M.isKeyboardEvent.primary(e,"z")||M.isKeyboardEvent.primary(e,"y")||M.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}},[]),Co(pe),So(me),uo(),jo({isSelected:K,disableFormats:L,onChange:ue,value:se,formatTypes:oe,tagName:r,onReplace:h,onSplit:w,onSplitMiddle:B,__unstableEmbedURLOnPaste:N,multilineTag:Z,preserveWhiteSpace:P,pastePlainText:R}),_o({removeEditorOnlyFormats:ae,value:se,onReplace:h,onSplit:w,onSplitMiddle:B,multilineTag:Z,onChange:ue,disableLineBreaks:A,onSplitAtEnd:I}),G,n]),contentEditable:!Y||void 0,suppressContentEditableWarning:!Y,className:V()("block-editor-rich-text__editable",z.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===M.DELETE||t===M.BACKSPACE)){const{start:n,end:o,text:r}=se,c=t===M.BACKSPACE,l=se.activeFormats&&!!se.activeFormats.length;if(!Object(lo.isCollapsed)(se)||l||c&&0!==n||!c&&o!==r.length)return;C&&C(!c),E&&Object(lo.isEmpty)(se)&&c&&E(!c),e.preventDefault()}}})));if(!m)return ge;Xn()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const Oe=V()("block-editor-rich-text",m);return Object(i.createElement)("div",{className:Oe},ge)}));Bo.Content=e=>{let{value:t,tagName:n,multiline:o,...r}=e;Array.isArray(t)&&(t=j.children.toHTML(t));const c=ho(o);!t&&c&&(t=`<${c}>`);const l=Object(i.createElement)(i.RawHTML,null,t);return n?Object(i.createElement)(n,Object(a.omit)(r,["format"]),l):l},Bo.isEmpty=e=>!e||0===e.length;var To=Bo;const Po=Object(i.forwardRef)((e,t)=>Object(i.createElement)(To,Object(l.a)({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0})));Po.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return Object(i.createElement)(n,o,t)};var Ro=Po;var No=Object(i.forwardRef)((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return Object(i.createElement)(Ro,Object(l.a)({ref:t},o));const{className:r,onChange:c,...a}=o;return Object(i.createElement)(co.a,Object(l.a)({ref:t,className:V()("block-editor-plain-text",r),onChange:e=>c(e.target.value)},a))});function Mo(e){let{property:t,viewport:n,desc:o}=e;const r=Object(Q.useInstanceId)(Mo),c=o||Object(s.sprintf)(Object(s._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("span",{"aria-describedby":"rbc-desc-"+r},n.label),Object(i.createElement)(u.VisuallyHidden,{as:"span",id:"rbc-desc-"+r},c))}var Lo=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:c,renderResponsiveControls:l,isResponsive:a=!1,defaultLabel:d={id:"all",label:Object(s.__)("All")},viewports:b=[{id:"small",label:Object(s.__)("Small screens")},{id:"medium",label:Object(s.__)("Medium screens")},{id:"large",label:Object(s.__)("Large screens")}]}=e;if(!t||!n||!c)return null;const p=o||Object(s.sprintf)(Object(s.__)("Use the same %s on all screensizes."),n),m=Object(s.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),f=c(Object(i.createElement)(Mo,{property:n,viewport:d}),d);return Object(i.createElement)("fieldset",{className:"block-editor-responsive-block-control"},Object(i.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),Object(i.createElement)("div",{className:"block-editor-responsive-block-control__inner"},Object(i.createElement)(u.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:p,checked:!a,onChange:r,help:m}),Object(i.createElement)("div",{className:V()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&f,a&&(l?l(b):b.map(e=>Object(i.createElement)(i.Fragment,{key:e.id},c(Object(i.createElement)(Mo,{property:n,viewport:e}),e)))))))};function Ao(e){let{character:t,type:n,onUse:o}=e;const r=Object(i.useContext)(Io),c=Object(i.useRef)();return c.current=o,Object(i.useEffect)(()=>{function e(e){M.isKeyboardEvent[n](e,t)&&(c.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}},[t,n]),null}function Do(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...c}=e,a="RichText.ToolbarControls";return n&&(a+="."+n),o&&r&&(t=M.displayShortcut[o](r)),Object(i.createElement)(u.Fill,{name:a},Object(i.createElement)(u.ToolbarButton,Object(l.a)({},c,{shortcut:t})))}function Fo(e){let{inputType:t,onInput:n}=e;const o=Object(i.useContext)(xo),r=Object(i.useRef)();return r.current=n,Object(i.useEffect)(()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}},[t]),null}const zo=Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(u.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var Ho=Object(i.forwardRef)((function(e,t){const n=Object(_.useSelect)(e=>e(S.a).isNavigationMode(),[]),{setNavigationMode:o}=Object(_.useDispatch)(S.a),r=e=>{o("edit"!==e)};return Object(i.createElement)(u.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:c}=o;return Object(i.createElement)(u.Button,Object(l.a)({},e,{ref:t,icon:n?zo:Rn.a,"aria-expanded":r,"aria-haspopup":"true",onClick:c,label:Object(s.__)("Tools")}))},position:"bottom right",renderContent:()=>Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.NavigableMenu,{role:"menu","aria-label":Object(s.__)("Tools")},Object(i.createElement)(u.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:Object(i.createElement)(i.Fragment,null,Object(i.createElement)(A.a,{icon:Rn.a}),Object(s.__)("Edit"))},{value:"select",label:Object(i.createElement)(i.Fragment,null,zo,Object(s.__)("Select"))}]})),Object(i.createElement)("div",{className:"block-editor-tool-selector__help"},Object(s.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Vo(e){let{units:t,...n}=e;const o=Object(u.__experimentalUseCustomUnits)({availableUnits:Object(lt.a)("spacing.units")||["%","px","em","rem","vw"],units:t});return Object(i.createElement)(u.__experimentalUnitControl,Object(l.a)({units:o},n))}var Go=n("Bpkj"),Uo=n("cjQ8");class Wo extends i.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?Object(s.__)("Edit link"):Object(s.__)("Insert link");return Object(i.createElement)("div",{className:"block-editor-url-input__button"},Object(i.createElement)(u.Button,{icon:Go.a,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&Object(i.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},Object(i.createElement)("div",{className:"block-editor-url-input__button-modal-line"},Object(i.createElement)(u.Button,{className:"block-editor-url-input__back",icon:Uo.a,label:Object(s.__)("Close"),onClick:this.toggle}),Object(i.createElement)(On,{value:e||"",onChange:t}),Object(i.createElement)(u.Button,{icon:dn.a,label:Object(s.__)("Submit"),type:"submit"}))))}}var qo=Wo,Ko=n("w95h");const Yo=["noreferrer","noopener"],$o=Object(i.createElement)(u.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)(u.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(i.createElement)(u.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),Object(i.createElement)(u.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),Zo=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:c,mediaLink:l,linkTarget:d,linkClass:b,rel:p}=e;const[m,f]=Object(i.useState)(!1),h=Object(i.useCallback)(()=>{f(!0)}),[g,O]=Object(i.useState)(!1),[v,j]=Object(i.useState)(null),k=Object(i.useRef)(null),_=Object(i.useCallback)(()=>{"media"!==t&&"attachment"!==t||j(""),O(!0)}),y=Object(i.useCallback)(()=>{O(!1)}),E=Object(i.useCallback)(()=>{j(null),y(),f(!1)}),C=e=>{let t=e;return void 0===e||Object(a.isEmpty)(t)||Object(a.isEmpty)(t)||(Object(a.each)(Yo,e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")}),t!==e&&(t=t.trim()),Object(a.isEmpty)(t)&&(t=void 0)),t},S=Object(i.useCallback)(()=>e=>{const t=k.current;t&&t.contains(e.target)||(f(!1),j(null),y())}),w=Object(i.useCallback)(()=>e=>{if(v){var t;const e=(null===(t=x().find(e=>e.url===v))||void 0===t?void 0:t.linkDestination)||"custom";n({href:v,linkDestination:e})}y(),j(null),e.preventDefault()}),I=Object(i.useCallback)(()=>{n({linkDestination:"none",href:""})}),x=()=>{const e=[{linkDestination:"media",title:Object(s.__)("Media File"),url:"image"===r?c:void 0,icon:$o}];return"image"===r&&l&&e.push({linkDestination:"attachment",title:Object(s.__)("Attachment Page"),url:"image"===r?l:void 0,icon:Object(i.createElement)(u.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)(u.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),Object(i.createElement)(u.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},B=Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ToggleControl,{label:Object(s.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;return n=t||p?C(p):void 0,{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===d}),Object(i.createElement)(u.TextControl,{label:Object(s.__)("Link Rel"),value:C(p)||"",onChange:e=>{n({rel:e})}}),Object(i.createElement)(u.TextControl,{label:Object(s.__)("Link CSS Class"),value:b||"",onChange:e=>{n({linkClass:e})}})),T=null!==v?v:o,P=(Object(a.find)(x(),["linkDestination",t])||{}).title;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ToolbarButton,{icon:Go.a,className:"components-toolbar__control",label:o?Object(s.__)("Edit link"):Object(s.__)("Insert link"),"aria-expanded":m,onClick:h}),m&&Object(i.createElement)(eo,{onFocusOutside:S(),onClose:E,renderSettings:()=>B,additionalControls:!T&&Object(i.createElement)(u.NavigableMenu,null,Object(a.map)(x(),e=>Object(i.createElement)(u.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{j(null),(e=>{const t=x();let o;o=e?(Object(a.find)(t,t=>t.url===e)||{linkDestination:"custom"}).linkDestination:"none",n({linkDestination:o,href:e})})(e.url),y()}},e.title)))},(!o||g)&&Object(i.createElement)(eo.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:T,onChangeInputValue:j,onSubmit:w(),autocompleteRef:k}),o&&!g&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(eo.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:_,urlLabel:P}),Object(i.createElement)(u.Button,{icon:Ko.a,label:Object(s.__)("Remove link"),onClick:I}))))};var Xo=n("Jyyd"),Qo=n("mlss");function Jo(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:c}=e;if(Object(Q.useViewportMatch)("small","<"))return null;const l={className:V()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,children:Object(s.__)("Preview")};return Object(i.createElement)(u.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:l,toggleProps:a,icon:null},()=>Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.MenuGroup,null,Object(i.createElement)(u.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>c("Desktop"),icon:"Desktop"===r&&Xt.a},Object(s.__)("Desktop")),Object(i.createElement)(u.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>c("Tablet"),icon:"Tablet"===r&&Xt.a},Object(s.__)("Tablet")),Object(i.createElement)(u.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>c("Mobile"),icon:"Mobile"===r&&Xt.a},Object(s.__)("Mobile"))),t))}function er(e){const[t,n]=Object(i.useState)(window.innerWidth);Object(i.useEffect)(()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var tr=n("PKbb");var nr=Object(_.withSelect)(e=>({selectedBlockClientId:e(S.a).getBlockSelectionStart()}))(e=>{let{selectedBlockClientId:t}=e;const n=Object(tr.b)(t);return t?Object(i.createElement)(u.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},Object(s.__)("Skip to the selected block")):null}),or=n("GvwK"),rr=n("7NR9"),cr=n("7fqt"),lr=n("wzfx");var ir=Object(_.withSelect)(e=>{const{getMultiSelectedBlocks:t}=e(S.a);return{blocks:t()}})((function(e){let{blocks:t}=e;const n=Object(cr.count)(Object(j.serialize)(t),"words");return Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},Object(i.createElement)(C.a,{icon:lr.a,showColors:!0}),Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},Object(s.sprintf)(Object(s._n)("%d block","%d blocks",t.length),t.length)),Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},Object(s.sprintf)(Object(s._n)("%d word","%d words",n),n))))}));function ar(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:r}=Object(_.useSelect)(e=>{var n,o;const r=e(S.a).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==r||null===(n=r.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==r?void 0:r.onChange)&&void 0!==o?o:null,styles:e(j.store).getBlockStyles(t)}},[t]),c=Object(i.useMemo)(()=>[{label:Object(s.__)("Not set"),value:""},...r.map(e=>{let{label:t,name:n}=e;return{label:t,value:n}})],[r]),l=Object(i.useCallback)(e=>{o(t,e)},[t,o]);return o&&Object(i.createElement)(u.SelectControl,{options:c,value:n||"",label:Object(s.__)("Default Style"),onChange:l})}const sr=e=>{let{clientId:t,blockName:n,hasBlockStyles:o,bubblesVirtually:r}=e;const c=Object(ce.a)(t);return Object(i.createElement)("div",{className:"block-editor-block-inspector"},Object(i.createElement)(or.a,c),Object(i.createElement)(Ye,{blockClientId:t}),o&&Object(i.createElement)("div",null,Object(i.createElement)(u.PanelBody,{title:Object(s.__)("Styles")},Object(i.createElement)(rr.a,{clientId:t}),Object(j.hasBlockSupport)(n,"defaultStylePicker",!0)&&Object(i.createElement)(ar,{blockName:n}))),Object(i.createElement)(sn.b.Slot,{bubblesVirtually:r}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"typography",bubblesVirtually:r,label:Object(s.__)("Typography")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"dimensions",bubblesVirtually:r,label:Object(s.__)("Dimensions")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"border",label:Object(s.__)("Border")}),Object(i.createElement)("div",null,Object(i.createElement)(ur,{bubblesVirtually:r})),Object(i.createElement)(nr,{key:"back"}))},ur=e=>{let{bubblesVirtually:t}=e;const n=Object(u.__experimentalUseSlot)(sn.a.slotName);return Boolean(n.fills&&n.fills.length)?Object(i.createElement)(u.PanelBody,{className:"block-editor-block-inspector__advanced",title:Object(s.__)("Advanced"),initialOpen:!1},Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"advanced",bubblesVirtually:t})):null};var dr=e=>{let{showNoBlockSelectedMessage:t=!0,bubblesVirtually:n=!0}=e;const{count:o,hasBlockStyles:r,selectedBlockName:c,selectedBlockClientId:l,blockType:a}=Object(_.useSelect)(e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(S.a),{getBlockStyles:r}=e(j.store),c=t(),l=c&&o(c),i=l&&Object(j.getBlockType)(l),a=l&&r(l);return{count:n(),selectedBlockClientId:c,selectedBlockName:l,blockType:i,hasBlockStyles:a&&a.length>0}},[]);if(o>1)return Object(i.createElement)("div",{className:"block-editor-block-inspector"},Object(i.createElement)(ir,null),Object(i.createElement)(sn.b.Slot,null),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"typography",label:Object(s.__)("Typography")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"dimensions",label:Object(s.__)("Dimensions")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"border",label:Object(s.__)("Border")}));const u=c===Object(j.getUnregisteredTypeHandlerName)();return a&&l&&!u?Object(i.createElement)(sr,{clientId:l,blockName:a.name,hasBlockStyles:r,bubblesVirtually:n}):t?Object(i.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},Object(s.__)("No block selected.")):null},br=n("VyCT"),pr=n("nlh6"),mr=n("w8sn"),fr=n("JygI"),hr=n("zQI6"),gr=n("U1WI"),Or=n("pXCJ"),vr=n("+gtr"),jr=n("hF7m"),kr=n("PS/H"),_r=n("xCFn"),yr=n("JUfZ"),Er=n("2z9l");function Cr(e){let{children:t,__unstableContentRef:n,...o}=e;const r=Object(Q.useViewportMatch)("medium"),c=Object(_.useSelect)(e=>e(S.a).getSettings().hasFixedToolbar,[]),s=Object(jr.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:d,getBlockRootClientId:b}=Object(_.useSelect)(S.a),{duplicateBlocks:p,removeBlocks:m,insertAfterBlock:f,insertBeforeBlock:h,clearSelectedBlock:g,moveBlocksUp:O,moveBlocksDown:v}=Object(_.useDispatch)(S.a);return Object(i.createElement)("div",Object(l.a)({},o,{onKeyDown:function(e){if(s("core/block-editor/move-up",e)){const t=d();if(t.length){e.preventDefault();const n=b(Object(a.first)(t));O(t,n)}}else if(s("core/block-editor/move-down",e)){const t=d();if(t.length){e.preventDefault();const n=b(Object(a.first)(t));v(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=d();t.length&&(e.preventDefault(),p(t))}else if(s("core/block-editor/remove",e)){const t=d();t.length&&(e.preventDefault(),m(t))}else if(s("core/block-editor/insert-after",e)){const t=d();t.length&&(e.preventDefault(),f(Object(a.last)(t)))}else if(s("core/block-editor/insert-before",e)){const t=d();t.length&&(e.preventDefault(),h(Object(a.first)(t)))}else if(s("core/block-editor/delete-multi-selection",e)){if(["INPUT","TEXTAREA"].includes(e.target.nodeName)||e.defaultPrevented)return;const t=d();t.length>1&&(e.preventDefault(),m(t))}else if(s("core/block-editor/unselect",e)){d().length>1&&(e.preventDefault(),g(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}}),Object(i.createElement)(kr.b,{__unstableContentRef:n},(c||!r)&&Object(i.createElement)(yr.a,{isFixed:!0}),Object(i.createElement)(_r.a,{__unstableContentRef:n}),Object(i.createElement)(u.Popover.Slot,{name:"block-toolbar",ref:Object(Er.a)(n)}),t,Object(i.createElement)(u.Popover.Slot,{name:"__unstable-block-tools-after",ref:Object(Er.a)(n)})))}var Sr=n("+0ps"),wr=n("5L8O"),Ir=n("KyyN"),xr=n("qrxh"),Br=n("xZzQ");var Tr=function(e){let{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:c=!1,__experimentalInsertionIndex:l,__experimentalFilterValue:s,onSelect:u=a.noop,shouldFocusBlock:d=!1}=e;const b=Object(_.useSelect)(e=>{const{getBlockRootClientId:o}=e(S.a);return t||o(n)||void 0},[n,t]);return Object(i.createElement)(Br.a,{onSelect:u,rootClientId:b,clientId:n,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:c,__experimentalInsertionIndex:l,__experimentalFilterValue:s,shouldFocusBlock:d})};function Pr(){return null}Pr.Register=function(){const{registerShortcut:e}=Object(_.useDispatch)(jr.store);return Object(i.useEffect)(()=>{e({name:"core/block-editor/duplicate",category:"block",description:Object(s.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:Object(s.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:Object(s.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:Object(s.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:Object(s.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:Object(s.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:Object(s.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:Object(s.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:Object(s.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:Object(s.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})},[e]),null};var Rr=Pr;function Nr(){return Xn()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in."}),null}var Mr=n("GkEL");const Lr=new Set([M.UP,M.RIGHT,M.DOWN,M.LEFT,M.ENTER,M.BACKSPACE]);function Ar(){const e=Object(_.useSelect)(e=>e(S.a).isTyping(),[]),{stopTyping:t}=Object(_.useDispatch)(S.a);return Object(Q.useRefEffect)(n=>{if(!e)return;const{ownerDocument:o}=n;let r,c;function l(e){const{clientX:n,clientY:o}=e;r&&c&&(r!==n||c!==o)&&t(),r=n,c=o}return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)}},[e,t])}function Dr(){const e=Object(_.useSelect)(e=>e(S.a).isTyping()),{startTyping:t,stopTyping:n}=Object(_.useDispatch)(S.a),o=Ar(),r=Object(Q.useRefEffect)(o=>{const{ownerDocument:r}=o,{defaultView:c}=r;if(e){let e;function l(t){const{target:o}=t;e=c.setTimeout(()=>{Object(bn.isTextField)(o)||n()})}function i(e){const{keyCode:t}=e;t!==M.ESCAPE&&t!==M.TAB||n()}function a(){const e=c.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",l),o.addEventListener("keydown",i),r.addEventListener("selectionchange",a),()=>{c.clearTimeout(e),o.removeEventListener("focus",l),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",a)}}function s(e){const{type:n,target:r}=e;Object(bn.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Lr.has(t)}(e))&&t()}return o.addEventListener("keypress",s),o.addEventListener("keydown",s),()=>{o.removeEventListener("keypress",s),o.removeEventListener("keydown",s)}},[e,t,n]);return Object(Q.useMergeRefs)([o,r])}var Fr=function(e){let{children:t}=e;return Object(i.createElement)("div",{ref:Dr()},t)};function zr(){return Xn()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const Hr=-1!==window.navigator.userAgent.indexOf("Trident"),Vr=new Set([M.UP,M.DOWN,M.LEFT,M.RIGHT]);function Gr(){const e=Object(_.useSelect)(e=>e(S.a).hasSelectedBlock(),[]);return Object(Q.useRefEffect)(t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,c,l;function i(){r||(r=o.requestAnimationFrame(()=>{b(),r=null}))}function a(e){c&&o.cancelAnimationFrame(c),c=o.requestAnimationFrame(()=>{s(e),c=null})}function s(e){let{keyCode:r}=e;if(!p())return;const c=Object(bn.computeCaretRect)(o);if(!c)return;if(!l)return void(l=c);if(Vr.has(r))return void(l=c);const i=c.top-l.top;if(0===i)return;const a=Object(bn.getScrollContainer)(t);if(!a)return;const s=a===n.body,u=s?o.scrollY:a.scrollTop,d=s?0:a.getBoundingClientRect().top,b=s?l.top/o.innerHeight:(l.top-d)/(o.innerHeight-d);if(0===u&&b<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(l=c);const m=s?o.innerHeight:a.clientHeight;l.top+l.height>d+m||l.top{o.removeEventListener("scroll",i,!0),o.removeEventListener("resize",i,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",s),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(c)}},[e])}var Ur=Hr?e=>e.children:function(e){let{children:t}=e;return Object(i.createElement)("div",{ref:Gr(),className:"block-editor__typewriter"},t)},Wr=n("Zzu2"),qr=n("TVFh");const Kr=Object(a.overEvery)([bn.isTextField,bn.focus.tabbable.isTabbableIndex]);function Yr(){return Object(Q.useRefEffect)(e=>{function t(t){if(t.target!==e)return;const n=bn.focus.focusable.find(e),o=Object(a.findLast)(n,Kr);if(!o)return;const{bottom:r}=o.getBoundingClientRect();t.clientY{e.addEventListener("mousedown",t)}},[])}var $r=n("hHnB");const Zr=Object(i.createContext)({});function Xr(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function Qr(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=Object(i.useContext)(Zr),{name:r}=Object(k.c)();n=n||r;const c=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),l=Object(i.useMemo)(()=>Xr(o,n,e),[o,n,e]),a=Object(i.useCallback)(e=>{let{children:t}=e;return Object(i.createElement)(Zr.Provider,{value:l},t)},[l]);return[c,a]}var Jr=n("/QNa")},"16Al":function(e,t,n){"use strict";var o=n("WbBG");function r(){}function c(){}c.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,c,l){if(l!==o){var i=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 i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={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:c,resetWarningCache:r};return n.PropTypes=n,n}},"17x9":function(e,t,n){e.exports=n("16Al")()},"1CF3":function(e,t){e.exports=window.wp.dom},"1K8p":function(e,t,n){"use strict";var o=n("jrfk"),r=n("ez49");function c(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}c.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=c},"1ZqX":function(e,t){e.exports=window.wp.data},"1eGn":function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("l3Sj"),i=n("tI+e"),a=n("1ZqX"),s=n("VKE3"),u=n("HSyU"),d=n("hF7m"),b=n("K9lf"),p=n("+0ps"),m=n("BhPs");function f(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:l,getBlocksByClientId:i,canMoveBlocks:s,canRemoveBlocks:d}=Object(a.useSelect)(m.a),{getDefaultBlockName:b,getGroupingBlockName:f}=Object(a.useSelect)(u.store),h=i(t),g=l(t[0]),O=Object(c.every)(h,e=>!!e&&Object(u.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,g)),v=r(b(),g),j=s(t,g),k=d(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:I,setNavigationMode:x,selectBlock:B}=Object(a.useDispatch)(m.a),T=Object(p.c)();return n({canDuplicate:O,canInsertDefaultBlock:v,canMove:j,canRemove:k,rootClientId:g,blocks:h,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S(Object(c.first)(Object(c.castArray)(t)))},onInsertAfter(){C(Object(c.last)(Object(c.castArray)(t)))},onMoveTo(){x(!0),B(t[0]),I(t[0])},onGroup(){if(!h.length)return;const e=f(),n=Object(u.switchToBlockType)(h,e);n&&y(t,n)},onUngroup(){if(!h.length)return;const e=h[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=h.map(e=>{let{clientId:t}=e;return t});1===h.length&&w(e[0]),T("copy",e)}})}var h=Object(b.compose)([Object(a.withSelect)((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:c}=e(m.a),l=o(n),i=c().codeEditingEnabled;return{mode:r(n),blockType:l?Object(u.getBlockType)(l.name):null,isCodeEditingEnabled:i}}),Object(a.withDispatch)((e,t)=>{let{onToggle:n=c.noop,clientId:o}=t;return{onToggleMode(){e(m.a).toggleBlockMode(o),n()}}})])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:c=!1,isCodeEditingEnabled:a=!0}=e;if(!Object(u.hasBlockSupport)(t,"html",!0)||!a)return null;const s="visual"===n?Object(l.__)("Edit as HTML"):Object(l.__)("Edit visually");return Object(r.createElement)(i.MenuItem,{onClick:o},!c&&s)}));var g=Object(b.compose)(Object(a.withSelect)((e,t)=>{let{clientId:n}=t;const o=e(m.a).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}}),Object(a.withDispatch)((e,t)=>{let{block:n}=t;return{onClick:()=>e(m.a).replaceBlocks(n.clientId,Object(u.rawHandler)({HTML:Object(u.getBlockContent)(n)}))}}))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const c=Object(l.__)("Convert to Blocks");return Object(r.createElement)(i.MenuItem,{onClick:n},!o&&c)})),O=n("Jyyd"),v=n("pXCJ");const j={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function k(e){let{blocks:t,onCopy:n}=e;const o=Object(b.useCopyToClipboard)(()=>Object(u.serialize)(t),n);return Object(r.createElement)(i.MenuItem,{ref:o},Object(l.__)("Copy"))}t.a=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:b,...p}=e;const _=Object(c.castArray)(t),y=_.length,E=_[0],{onlyBlock:C,title:S}=Object(a.useSelect)(e=>{var t;const{getBlockCount:n,getBlockName:o}=e(m.a),{getBlockType:r}=e(u.store);return{onlyBlock:1===n(),title:null===(t=r(o(E)))||void 0===t?void 0:t.title}},[E]),w=Object(a.useSelect)(e=>{const{getShortcutRepresentation:t}=e(d.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}},[]),I=Object(r.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:c.noop,[n]),x=Object(l.sprintf)(Object(l.__)("Remove %s"),S),B=1===y?x:Object(l.__)("Remove blocks");return Object(r.createElement)(f,{clientIds:t,__experimentalUpdateSelection:!n},e=>{let{canDuplicate:n,canInsertDefaultBlock:a,canMove:u,canRemove:d,onDuplicate:m,onInsertAfter:f,onInsertBefore:_,onRemove:S,onCopy:x,onMoveTo:T,blocks:P}=e;return Object(r.createElement)(i.DropdownMenu,Object(o.a)({icon:s.a,label:Object(l.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:j,noIcons:!0},p),e=>{let{onClose:o}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.MenuGroup,null,Object(r.createElement)(O.a.Slot,{fillProps:{onClose:o}}),1===y&&Object(r.createElement)(g,{clientId:E}),Object(r.createElement)(k,{blocks:P,onCopy:x}),n&&Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,m,I),shortcut:w.duplicate},Object(l.__)("Duplicate")),a&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,_),shortcut:w.insertBefore},Object(l.__)("Insert before")),Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,f),shortcut:w.insertAfter},Object(l.__)("Insert after"))),u&&!C&&Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,T)},Object(l.__)("Move to")),1===y&&Object(r.createElement)(h,{clientId:E,onToggle:o})),Object(r.createElement)(v.a.Slot,{fillProps:{onClose:o},clientIds:t}),"function"==typeof b?b({onClose:o}):r.Children.map(e=>Object(r.cloneElement)(e,{onClose:o})),d&&Object(r.createElement)(i.MenuGroup,null,Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,S,I),shortcut:w.remove},B)))})})}},"1iEr":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.a=c},"1oY3":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("wx14"),r=n("GRId"),c=n("NtoT"),l=n("jwne");const i=c.a;i.Slot=l.a;const a=e=>Object(r.createElement)(c.a,Object(o.a)({},e,{__experimentalGroup:"advanced"}));a.Slot=e=>Object(r.createElement)(l.a,Object(o.a)({},e,{__experimentalGroup:"advanced"})),a.slotName="InspectorAdvancedControls",t.b=i},"1uGa":function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("RxS6");t.a=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:i,disableCustomDuotone:a,value:s,onChange:u}=e;return Object(o.createElement)(r.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:Object(c.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(o.createElement)(r.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==l.DOWN||(e.preventDefault(),n())},label:Object(c.__)("Apply duotone filter"),icon:Object(o.createElement)(r.DuotoneSwatch,{values:s})})},renderContent:()=>Object(o.createElement)(r.MenuGroup,{label:Object(c.__)("Duotone")},Object(o.createElement)("div",{className:"block-editor-duotone-control__description"},Object(c.__)("Create a two-tone color effect without losing your original image.")),Object(o.createElement)(r.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:i,disableCustomDuotone:a,value:s,onChange:u}))})}},"2YCo":function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("bVTw"),i=n("Tqx9");var a=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Object(o.createElement)(i.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var s=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Object(o.createElement)(i.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 u=[{label:Object(c.__)("Solid"),icon:l.a,value:"solid"},{label:Object(c.__)("Dashed"),icon:a,value:"dashed"},{label:Object(c.__)("Dotted"),icon:s,value:"dotted"}];function d(e){let{onChange:t,value:n}=e;return Object(o.createElement)("fieldset",{className:"components-border-style-control"},Object(o.createElement)("legend",null,Object(c.__)("Style")),Object(o.createElement)("div",{className:"components-border-style-control__buttons"},u.map(e=>Object(o.createElement)(r.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label}))))}},"2gm7":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));t.a=c},"2z9l":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("K9lf");function r(e){return Object(o.useRefEffect)(t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}},[e])}},"5L8O":function(e,t,n){"use strict";var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("l3Sj"),i=n("K9lf"),a=n("HSyU"),s=n("rmEH"),u=n("1ZqX"),d=n("qrxh"),b=n("BhPs");t.a=Object(i.compose)(Object(u.withSelect)((e,t)=>{const{getBlockCount:n,getBlockName:o,isBlockValid:r,getSettings:c,getTemplateLock:l}=e(b.a),i=!n(t.rootClientId),s=o(t.lastBlockClientId)===Object(a.getDefaultBlockName)(),u=r(t.lastBlockClientId),{bodyPlaceholder:d}=c();return{isVisible:i||!s||!u,showPrompt:i,isLocked:!!l(t.rootClientId),placeholder:d}}),Object(u.withDispatch)((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(b.a);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}}))((function(e){let{isLocked:t,isVisible:n,onAppend:r,showPrompt:i,placeholder:a,rootClientId:u}=e;if(t||!n)return null;const b=Object(s.decodeEntities)(a)||Object(l.__)("Type / to choose a block");return Object(o.createElement)("div",{"data-root-client-id":u||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":i})},Object(o.createElement)("p",{tabIndex:"0",contentEditable:!0,suppressContentEditableWarning:!0,role:"button","aria-label":Object(l.__)("Add block"),className:"block-editor-default-block-appender__content",onFocus:r},i?b:"\ufeff"),Object(o.createElement)(d.a,{rootClientId:u,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}))},"5gPN":function(e,t,n){"use strict";n.d(t,"b",(function(){return o.a})),n.d(t,"c",(function(){return o.b})),n.d(t,"d",(function(){return o.c})),n.d(t,"a",(function(){return b})),n.d(t,"e",(function(){return p}));var o=n("bVpQ"),r=n("wx14"),c=n("GRId"),l=n("YLtl"),i=n("K9lf"),a=n("v5LD");const s=e=>Object(i.createHigherOrderComponent)(t=>n=>Object(c.createElement)(t,Object(r.a)({},n,{colors:e})),"withCustomColorPalette"),u=()=>Object(i.createHigherOrderComponent)(e=>t=>{const n=Object(a.a)("color.palette.custom"),o=Object(a.a)("color.palette.theme"),l=Object(a.a)("color.palette.default"),i=Object(c.useMemo)(()=>[...n||[],...o||[],...l||[]],[n,o,l]);return Object(c.createElement)(e,Object(r.a)({},t,{colors:i}))},"withEditorColorPalette");function d(e,t){const n=Object(l.reduce)(e,(e,t)=>({...e,...Object(l.isString)(t)?{[t]:Object(l.kebabCase)(t)}:t}),{});return Object(i.compose)([t,e=>class extends c.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return Object(o.d)(t,e)}createSetters(){return Object(l.reduce)(n,(e,t,n)=>{const o=Object(l.upperFirst)(n),r="custom"+o;return e["set"+o]=this.createSetColor(n,r),e},{})}createSetColor(e,t){return n=>{const r=Object(o.c)(this.props.colors,n);this.props.setAttributes({[e]:r&&r.slug?r.slug:void 0,[t]:r&&r.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:r,colors:c}=e;return Object(l.reduce)(n,(e,n,i)=>{const a=Object(o.b)(c,r[i],r["custom"+Object(l.upperFirst)(i)]),s=t[i];return(null==s?void 0:s.color)===a.color&&s?e[i]=s:e[i]={...a,class:Object(o.a)(n,a.slug)},e},{})}render(){return Object(c.createElement)(e,Object(r.a)({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function b(e){return function(){const t=s(e);for(var n=arguments.length,o=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var p=Object(o.memo)((function(e){let{className:t,isFirst:n,item:l,onSelect:p,onHover:m,isDraggable:f,...h}=e;const g=Object(o.useRef)(!1),O=l.icon?{backgroundColor:l.icon.background,color:l.icon.foreground}:{},v=Object(o.useMemo)(()=>[Object(r.createBlock)(l.name,l.initialAttributes,Object(r.createBlocksFromInnerBlocksTemplate)(l.innerBlocks))],[l.name,l.initialAttributes,l.initialAttributes]);return Object(o.createElement)(d.a,{isEnabled:f&&!l.disabled,blocks:v,icon:l.icon},e=>{let{draggable:r,onDragStart:d,onDragEnd:f}=e;return Object(o.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{g.current=!0,d&&(m(null),d(e))},onDragEnd:e=>{g.current=!1,f&&f(e)}},Object(o.createElement)(u.a,Object(c.a)({isFirst:n,className:i()("block-editor-block-types-list__item",t),disabled:l.isDisabled,onClick:e=>{e.preventDefault(),p(l,b()?e.metaKey:e.ctrlKey),m(null)},onKeyDown:e=>{const{keyCode:t}=e;t===a.ENTER&&(e.preventDefault(),p(l,b()?e.metaKey:e.ctrlKey),m(null))},onFocus:()=>{g.current||m(l)},onMouseEnter:()=>{g.current||m(l)},onMouseLeave:()=>m(null),onBlur:()=>m(null)},h),Object(o.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:O},Object(o.createElement)(s.a,{icon:l.icon,showColors:!0})),Object(o.createElement)("span",{className:"block-editor-block-types-list__item-title"},l.title)))})})),m=n("xkPd"),f=n("HC45");t.a=function(e){let{items:t=[],onSelect:n,onHover:c=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return Object(o.createElement)(m.a,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let o=0,r=e.length;oObject(o.createElement)(f.a,{key:t},e.map((e,l)=>Object(o.createElement)(p,{key:e.id,item:e,className:Object(r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:c,isDraggable:a,isFirst:0===t&&0===l})))),l)}},"6c9H":function(e,t,n){"use strict";var o=n("GRId"),r=n("fHnH"),c=n("abaT"),l=n("7bKH"),i=n("gdqT"),a=n("l3Sj"),s=n("tI+e");function u(e){let{colordBackgroundColor:t,colordTextColor:n,backgroundColor:r,textColor:c}=e;const l=t.brightness(){Object(i.speak)(Object(a.__)("This color combination may be hard for people to read."))},[r,c]),Object(o.createElement)("div",{className:"block-editor-contrast-checker"},Object(o.createElement)(s.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},l))}Object(r.b)([c.a,l.a]),t.a=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:c,fontSize:l,isLargeText:i,textColor:a}=e;if(!t&&!n||!a&&!c)return null;const s=Object(r.a)(t||n),d=Object(r.a)(a||c);return 1!==s.alpha()||1!==d.alpha()||d.isReadable(s,{level:"AA",size:i||!1!==i&&l>=24?"large":"small"})?null:Object(o.createElement)(u,{backgroundColor:t,textColor:a,colordBackgroundColor:s,colordTextColor:d})}},"6jxZ":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("1ZqX"),r=n("K9lf"),c=n("OL6h"),l=n("BhPs");function i(e){const{isBlockSelected:t}=Object(o.useSelect)(l.a),{selectBlock:n,selectionChange:i}=Object(o.useDispatch)(l.a);return Object(r.useRefEffect)(o=>{function r(r){t(e)?r.target.isContentEditable||i(e):Object(c.c)(o,r.target)&&n(e)}return o.addEventListener("focusin",r),()=>{o.removeEventListener("focusin",r)}},[t,n])}},"715p":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("YLtl");const r=e=>{if(!Object(o.isObject)(e)||Array.isArray(e))return e;const t=Object(o.pickBy)(Object(o.mapValues)(e,r),o.identity);return Object(o.isEmpty)(t)?void 0:t}},"7NR9":function(e,t,n){"use strict";var o=n("GRId"),r=n("YLtl"),c=n("TSYQ"),l=n.n(c),i=n("1ZqX"),a=n("RxS6"),s=n("l3Sj"),u=n("HSyU"),d=n("BLeD"),b=n.n(d);var p=n("REKd"),m=n("BhPs");const f={};function h(e){let{genericPreviewBlock:t,viewportWidth:n,style:r,isActive:c,onBlur:i,onHover:s,onSelect:u,styleClassName:d,itemRole:b}=e;const m=Object(o.useMemo)(()=>({...t,attributes:{...t.attributes,className:d}}),[t,d]);return Object(o.createElement)("div",{key:r.name,className:l()("block-editor-block-styles__item",{"is-active":c}),onClick:()=>u(),onKeyDown:e=>{a.ENTER!==e.keyCode&&a.SPACE!==e.keyCode||(e.preventDefault(),u())},onMouseEnter:s,onMouseLeave:i,role:b||"button",tabIndex:"0","aria-label":r.label||r.name},Object(o.createElement)("div",{className:"block-editor-block-styles__item-preview"},Object(o.createElement)(p.a,{viewportWidth:n,blocks:m})),Object(o.createElement)("div",{className:"block-editor-block-styles__item-label"},r.label||r.name))}t.a=function(e){let{clientId:t,onSwitch:n=r.noop,onHoverClassName:c=r.noop,itemRole:l}=e;const{styles:a,block:d,type:p,className:g}=Object(i.useSelect)(e=>{const{getBlock:n}=e(m.a),o=n(t);if(!o)return f;const r=Object(u.getBlockType)(o.name),{getBlockStyles:c}=e(u.store);return{block:o,type:r,styles:c(o.name),className:o.attributes.className||""}},[t]),{updateBlockAttributes:O}=Object(i.useDispatch)(m.a),v=function(e,t){return Object(o.useMemo)(()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?Object(u.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?Object(u.cloneBlock)(e):void 0},[null!=t&&t.example?null==e?void 0:e.name:e,t])}(d,p);if(!a||0===a.length)return null;const j=Object(r.find)(a,"isDefault")?a:[{name:"default",label:Object(s._x)("Default","block style"),isDefault:!0},...a],k=function(e,t){for(const n of new b.a(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=Object(r.find)(e,{name:t});if(o)return o}return Object(r.find)(e,"isDefault")}(j,g);return Object(o.createElement)("div",{className:"block-editor-block-styles"},j.map(e=>{var r,i;const a=function(e,t,n){const o=new b.a(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}(g,k,e);return Object(o.createElement)(h,{genericPreviewBlock:v,viewportWidth:null!==(r=null===(i=p.example)||void 0===i?void 0:i.viewportWidth)&&void 0!==r?r:500,className:g,isActive:k===e,key:e.name,onSelect:()=>{O(t,{className:a}),c(null),n()},onBlur:()=>c(null),onHover:()=>c(a),style:e,styleClassName:a,itemRole:l})}))}},"7SSY":function(e,t,n){"use strict";var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("tI+e"),i=n("//Lo");t.a=Object(o.memo)((function(e){var t;let{icon:n,showColors:r=!1,className:a}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:i.a});const s=Object(o.createElement)(l.Icon,{icon:n&&n.src?n.src:n}),u=r?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return Object(o.createElement)("span",{style:u,className:c()("block-editor-block-icon",a,{"has-colors":r})},s)}))},"7bKH":function(e,t,n){"use strict";var o=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},r=function(e){return.2126*o(e.r)+.7152*o(e.g)+.0722*o(e.b)};t.a=function(e){e.prototype.luminance=function(){return e=r(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,o,c,l,i,a,s,u=t instanceof e?t:new e(t);return l=this.rgba,i=u.toRgb(),n=(a=r(l))>(s=r(i))?(a+.05)/(s+.05):(s+.05)/(a+.05),void 0===(o=2)&&(o=0),void 0===c&&(c=Math.pow(10,o)),Math.floor(c*n)/c+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(l=void 0===(c=(n=t).size)?"normal":c,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===l?7:"AA"===r&&"large"===l?3:4.5);var n,o,r,c,l}}},"7fqt":function(e,t){e.exports=window.wp.wordcount},"8oxB":function(e,t){var n,o,r=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{o="function"==typeof clearTimeout?clearTimeout:l}catch(e){o=l}}();var a,s=[],u=!1,d=-1;function b(){u&&a&&(u=!1,a.length?s=a.concat(s):d=-1,s.length&&p())}function p(){if(!u){var e=i(b);u=!0;for(var t=s.length;t;){for(a=s,s=[];++d1)for(var n=1;n"up"===e?"horizontal"===l?Object(b.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===l?Object(b.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const c=t+1;if(r<0&&n)return Object(b.__)("Blocks cannot be moved up as they are already at the top");if(r>0&&o)return Object(b.__)("Blocks cannot be moved down as they are already at the bottom");if(r<0&&!n)return Object(b.sprintf)(Object(b._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,c);if(r>0&&!o)return Object(b.sprintf)(Object(b._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,c)}(e,n,o,r,c);if(o&&r)return Object(b.sprintf)(Object(b.__)("Block %s is the only block, and cannot be moved"),t);if(c>0&&!r){const e=a("down");if("down"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d down to position %3$d"),t,i,i+1);if("left"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d left to position %3$d"),t,i,i+1);if("right"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d right to position %3$d"),t,i,i+1)}if(c>0&&r){const e=a("down");if("down"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(c<0&&!o){const e=a("up");if("up"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d up to position %3$d"),t,i,i-1);if("left"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d left to position %3$d"),t,i,i-1);if("right"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d right to position %3$d"),t,i,i-1)}if(c<0&&o){const e=a("up");if("up"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}var O=n("BhPs");const v=(e,t)=>"up"===e?"horizontal"===t?Object(b.isRTL)()?p.a:m.a:f.a:"down"===e?"horizontal"===t?Object(b.isRTL)()?m.a:p.a:h.a:null,j=(e,t)=>"up"===e?"horizontal"===t?Object(b.isRTL)()?Object(b.__)("Move right"):Object(b.__)("Move left"):Object(b.__)("Move up"):"down"===e?"horizontal"===t?Object(b.isRTL)()?Object(b.__)("Move left"):Object(b.__)("Move right"):Object(b.__)("Move down"):null,k=Object(r.forwardRef)((e,t)=>{let{clientIds:n,direction:c,orientation:b,...p}=e;const m=Object(u.useInstanceId)(k),f=Object(i.castArray)(n).length,{blockType:h,isDisabled:_,rootClientId:y,isFirst:E,isLast:C,firstIndex:S,orientation:w="vertical"}=Object(d.useSelect)(e=>{const{getBlockIndex:t,getBlockRootClientId:o,getBlockOrder:r,getBlock:l,getBlockListSettings:s}=e(O.a),u=Object(i.castArray)(n),d=Object(i.first)(u),p=o(d),m=t(d),f=t(Object(i.last)(u)),h=r(p),g=l(d),v=0===m,j=f===h.length-1,{orientation:k}=s(p)||{};return{blockType:g?Object(a.getBlockType)(g.name):null,isDisabled:"up"===c?v:j,rootClientId:p,firstIndex:m,isFirst:v,isLast:j,orientation:b||k}},[n,c]),{moveBlocksDown:I,moveBlocksUp:x}=Object(d.useDispatch)(O.a),B="up"===c?x:I,T="block-editor-block-mover-button__description-"+m;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(s.Button,Object(o.a)({ref:t,className:l()("block-editor-block-mover-button",`is-${c}-button`),icon:v(c,w),label:j(c,w),"aria-describedby":T},p,{onClick:_?null:e=>{B(n,y),p.onClick&&p.onClick(e)},"aria-disabled":_})),Object(r.createElement)("span",{id:T,className:"block-editor-block-mover-button__description"},g(f,h&&h.title,S,E,C,"up"===c?-1:1,w)))}),_=Object(r.forwardRef)((e,t)=>Object(r.createElement)(k,Object(o.a)({direction:"up",ref:t},e))),y=Object(r.forwardRef)((e,t)=>Object(r.createElement)(k,Object(o.a)({direction:"down",ref:t},e)))},"9XVa":function(e,t,n){"use strict";n.d(t,"b",(function(){return o.a})),n.d(t,"c",(function(){return o.b})),n.d(t,"d",(function(){return o.c})),n.d(t,"a",(function(){return r.a})),n.d(t,"e",(function(){return d}));var o=n("NMUH"),r=n("QP/w"),c=n("wx14"),l=n("GRId"),i=n("YLtl"),a=n("K9lf"),s=n("v5LD");const u=[];var d=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]="custom"+Object(i.upperFirst)(t),e),{});return Object(a.createHigherOrderComponent)(Object(a.compose)([Object(a.createHigherOrderComponent)(e=>t=>{const n=Object(s.a)("typography.fontSizes")||u;return Object(l.createElement)(e,Object(c.a)({},t,{fontSizes:n}))},"withFontSizes"),e=>class extends l.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object(i.reduce)(r,(e,t,n)=>(e["set"+Object(i.upperFirst)(n)]=this.createSetFontSize(n,t),e),{})}createSetFontSize(e,t){return n=>{const o=Object(i.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:c}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!Object(i.some)(r,l))return null;const a=Object(i.reduce)(Object(i.pickBy)(r,l),(e,t,r)=>{const l=n[r],i=Object(o.a)(c,l,n[t]);return e[r]={...i,class:Object(o.b)(l)},e},{});return{...t,...a}}render(){return Object(l.createElement)(e,Object(c.a)({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")}},AHN3:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o="core/block-editor"},AORF:function(e,t,n){"use strict";var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("l3Sj"),i=n("gdqT"),a=n("GRId"),s=n("BhPs");t.a=function(e){let{rootClientId:t="",insertionIndex:n,clientId:u,isAppender:d,onSelect:b,shouldFocusBlock:p=!0}=e;const{getSelectedBlock:m}=Object(r.useSelect)(s.a),{destinationRootClientId:f,destinationIndex:h}=Object(r.useSelect)(e=>{const{getSelectedBlockClientId:o,getBlockRootClientId:r,getBlockIndex:c,getBlockOrder:l}=e(s.a),i=o();let a,b=t;return void 0!==n?a=n:u?a=c(u):!d&&i?(b=r(i),a=c(i)+1):a=l(b).length,{destinationRootClientId:b,destinationIndex:a}},[t,n,u,d]),{replaceBlocks:g,insertBlocks:O,showInsertionPoint:v,hideInsertionPoint:j}=Object(r.useDispatch)(s.a),k=Object(a.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=m();!d&&r&&Object(c.isUnmodifiedDefaultBlock)(r)?g(r.clientId,e,null,p||n?0:null,t):O(e,h,f,!0,p||n?0:null,t);const a=Object(l.sprintf)(Object(l._n)("%d block added.","%d blocks added.",Object(o.castArray)(e).length),Object(o.castArray)(e).length);Object(i.speak)(a),b&&b()}),[d,m,g,O,f,h,b,p]),_=Object(a.useCallback)(e=>{e?v(f,h):j()},[v,j,f,h]);return[f,k,_]}},B9Az:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");var c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));t.a=c},BCrt:function(e,t,n){"use strict";n.d(t,"c",(function(){return o.a})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"a",(function(){return i.a})),n.d(t,"b",(function(){return g}));var o=n("vSu0"),r=n("lJLt");function c(e){if(void 0===e)e=r.b.colors;else{const t=e.filter(e=>e.color);0===t.length?e=r.b.colors:t.lengthe.gradient);0===t.length?e=r.b.gradients:t.lengtha(m(e,t)).value).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function u(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=s(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return a(e)}function d(e){for(let t=0;tn.height?n.width:n.height),"%":.01*("font"===n.type?n.fontSize:n.width),ch:8,ex:7.15625,lh:n.lineHeight},r={in:96,cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,px:1,Q:96/2.54/40};return o[e.unit]?(o[e.unit]*e.value).toFixed(0)+"px":r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":null}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=a(e);return n.unit||(n=u(e)),d(e)&&!n.unit?b(e):p(n,t)}const f={};function h(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+h(t);return f[n]||(f[n]=m(e,t)),f[n]}},BLeD:function(e,t){e.exports=window.wp.tokenList},BhPs:function(e,t,n){"use strict";n.d(t,"b",(function(){return Cn})),n.d(t,"a",(function(){return Sn}));var o={};n.r(o),n.d(o,"getBlockName",(function(){return w})),n.d(o,"isBlockValid",(function(){return I})),n.d(o,"getBlockAttributes",(function(){return x})),n.d(o,"getBlock",(function(){return B})),n.d(o,"__unstableGetBlockWithoutInnerBlocks",(function(){return T})),n.d(o,"getBlocks",(function(){return P})),n.d(o,"__unstableGetClientIdWithClientIdsTree",(function(){return R})),n.d(o,"__unstableGetClientIdsTree",(function(){return N})),n.d(o,"getClientIdsOfDescendants",(function(){return M})),n.d(o,"getClientIdsWithDescendants",(function(){return L})),n.d(o,"getGlobalBlockCount",(function(){return A})),n.d(o,"getBlocksByClientId",(function(){return D})),n.d(o,"getBlockCount",(function(){return F})),n.d(o,"getSelectionStart",(function(){return z})),n.d(o,"getSelectionEnd",(function(){return H})),n.d(o,"getBlockSelectionStart",(function(){return V})),n.d(o,"getBlockSelectionEnd",(function(){return G})),n.d(o,"getSelectedBlockCount",(function(){return U})),n.d(o,"hasSelectedBlock",(function(){return W})),n.d(o,"getSelectedBlockClientId",(function(){return q})),n.d(o,"getSelectedBlock",(function(){return K})),n.d(o,"getBlockRootClientId",(function(){return Y})),n.d(o,"getBlockParents",(function(){return $})),n.d(o,"getBlockParentsByBlockName",(function(){return Z})),n.d(o,"getBlockHierarchyRootClientId",(function(){return X})),n.d(o,"getLowestCommonAncestorWithSelectedBlock",(function(){return Q})),n.d(o,"getAdjacentBlockClientId",(function(){return J})),n.d(o,"getPreviousBlockClientId",(function(){return ee})),n.d(o,"getNextBlockClientId",(function(){return te})),n.d(o,"getSelectedBlocksInitialCaretPosition",(function(){return ne})),n.d(o,"getSelectedBlockClientIds",(function(){return oe})),n.d(o,"getMultiSelectedBlockClientIds",(function(){return re})),n.d(o,"getMultiSelectedBlocks",(function(){return ce})),n.d(o,"getFirstMultiSelectedBlockClientId",(function(){return le})),n.d(o,"getLastMultiSelectedBlockClientId",(function(){return ie})),n.d(o,"isFirstMultiSelectedBlock",(function(){return ae})),n.d(o,"isBlockMultiSelected",(function(){return se})),n.d(o,"isAncestorMultiSelected",(function(){return ue})),n.d(o,"getMultiSelectedBlocksStartClientId",(function(){return de})),n.d(o,"getMultiSelectedBlocksEndClientId",(function(){return be})),n.d(o,"getBlockOrder",(function(){return pe})),n.d(o,"getBlockIndex",(function(){return me})),n.d(o,"isBlockSelected",(function(){return fe})),n.d(o,"hasSelectedInnerBlock",(function(){return he})),n.d(o,"isBlockWithinSelection",(function(){return ge})),n.d(o,"hasMultiSelection",(function(){return Oe})),n.d(o,"isMultiSelecting",(function(){return ve})),n.d(o,"isSelectionEnabled",(function(){return je})),n.d(o,"getBlockMode",(function(){return ke})),n.d(o,"isTyping",(function(){return _e})),n.d(o,"isDraggingBlocks",(function(){return ye})),n.d(o,"getDraggedBlockClientIds",(function(){return Ee})),n.d(o,"isBlockBeingDragged",(function(){return Ce})),n.d(o,"isAncestorBeingDragged",(function(){return Se})),n.d(o,"isCaretWithinFormattedText",(function(){return we})),n.d(o,"getBlockInsertionPoint",(function(){return Ie})),n.d(o,"isBlockInsertionPointVisible",(function(){return xe})),n.d(o,"isValidTemplate",(function(){return Be})),n.d(o,"getTemplate",(function(){return Te})),n.d(o,"getTemplateLock",(function(){return Pe})),n.d(o,"canInsertBlockType",(function(){return Me})),n.d(o,"canInsertBlocks",(function(){return Le})),n.d(o,"canRemoveBlock",(function(){return Ae})),n.d(o,"canRemoveBlocks",(function(){return De})),n.d(o,"canMoveBlock",(function(){return Fe})),n.d(o,"canMoveBlocks",(function(){return ze})),n.d(o,"getInserterItems",(function(){return qe})),n.d(o,"getBlockTransformItems",(function(){return Ke})),n.d(o,"hasInserterItems",(function(){return Ye})),n.d(o,"__experimentalGetAllowedBlocks",(function(){return $e})),n.d(o,"__experimentalGetDirectInsertBlock",(function(){return Ze})),n.d(o,"__experimentalGetParsedPattern",(function(){return Xe})),n.d(o,"__experimentalGetAllowedPatterns",(function(){return Je})),n.d(o,"__experimentalGetPatternsByBlockTypes",(function(){return et})),n.d(o,"__experimentalGetPatternTransformItems",(function(){return tt})),n.d(o,"getBlockListSettings",(function(){return nt})),n.d(o,"getSettings",(function(){return ot})),n.d(o,"isLastBlockChangePersistent",(function(){return rt})),n.d(o,"__experimentalGetBlockListSettingsForBlocks",(function(){return ct})),n.d(o,"__experimentalGetReusableBlockTitle",(function(){return lt})),n.d(o,"__unstableIsLastBlockChangeIgnored",(function(){return it})),n.d(o,"__experimentalGetLastBlockAttributeChanges",(function(){return at})),n.d(o,"isNavigationMode",(function(){return ut})),n.d(o,"hasBlockMovingClientId",(function(){return dt})),n.d(o,"didAutomaticChange",(function(){return bt})),n.d(o,"isBlockHighlighted",(function(){return pt})),n.d(o,"areInnerBlocksControlled",(function(){return mt})),n.d(o,"__experimentalGetActiveBlockIdByBlockNames",(function(){return ft})),n.d(o,"wasBlockJustInserted",(function(){return ht}));var r={};n.r(r),n.d(r,"resetBlocks",(function(){return _t})),n.d(r,"validateBlocksToTemplate",(function(){return yt})),n.d(r,"resetSelection",(function(){return Et})),n.d(r,"receiveBlocks",(function(){return Ct})),n.d(r,"updateBlockAttributes",(function(){return St})),n.d(r,"updateBlock",(function(){return wt})),n.d(r,"selectBlock",(function(){return It})),n.d(r,"selectPreviousBlock",(function(){return xt})),n.d(r,"selectNextBlock",(function(){return Bt})),n.d(r,"startMultiSelect",(function(){return Tt})),n.d(r,"stopMultiSelect",(function(){return Pt})),n.d(r,"multiSelect",(function(){return Rt})),n.d(r,"clearSelectedBlock",(function(){return Nt})),n.d(r,"toggleSelection",(function(){return Mt})),n.d(r,"replaceBlocks",(function(){return At})),n.d(r,"replaceBlock",(function(){return Dt})),n.d(r,"moveBlocksDown",(function(){return zt})),n.d(r,"moveBlocksUp",(function(){return Ht})),n.d(r,"moveBlocksToPosition",(function(){return Vt})),n.d(r,"moveBlockToPosition",(function(){return Gt})),n.d(r,"insertBlock",(function(){return Ut})),n.d(r,"insertBlocks",(function(){return Wt})),n.d(r,"showInsertionPoint",(function(){return qt})),n.d(r,"hideInsertionPoint",(function(){return Kt})),n.d(r,"setTemplateValidity",(function(){return Yt})),n.d(r,"synchronizeTemplate",(function(){return $t})),n.d(r,"mergeBlocks",(function(){return Zt})),n.d(r,"removeBlocks",(function(){return Xt})),n.d(r,"removeBlock",(function(){return Qt})),n.d(r,"replaceInnerBlocks",(function(){return Jt})),n.d(r,"toggleBlockMode",(function(){return en})),n.d(r,"startTyping",(function(){return tn})),n.d(r,"stopTyping",(function(){return nn})),n.d(r,"startDraggingBlocks",(function(){return on})),n.d(r,"stopDraggingBlocks",(function(){return rn})),n.d(r,"enterFormattedText",(function(){return cn})),n.d(r,"exitFormattedText",(function(){return ln})),n.d(r,"selectionChange",(function(){return an})),n.d(r,"insertDefaultBlock",(function(){return sn})),n.d(r,"updateBlockListSettings",(function(){return un})),n.d(r,"updateSettings",(function(){return dn})),n.d(r,"__unstableSaveReusableBlock",(function(){return bn})),n.d(r,"__unstableMarkLastChangeAsPersistent",(function(){return pn})),n.d(r,"__unstableMarkNextChangeAsNotPersistent",(function(){return mn})),n.d(r,"__unstableMarkAutomaticChange",(function(){return fn})),n.d(r,"setNavigationMode",(function(){return hn})),n.d(r,"setBlockMovingClientId",(function(){return gn})),n.d(r,"duplicateBlocks",(function(){return On})),n.d(r,"insertBeforeBlock",(function(){return vn})),n.d(r,"insertAfterBlock",(function(){return jn})),n.d(r,"toggleBlockHighlight",(function(){return kn})),n.d(r,"flashBlock",(function(){return _n})),n.d(r,"setHasControlledInnerBlocks",(function(){return yn}));var c=n("1ZqX"),l=n("YLtl"),i=n("HSyU"),a=n("lJLt");function s(e,t,n){return[...e.slice(0,n),...Object(l.castArray)(t),...e.slice(n)]}function u(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),s(r,e.slice(t,t+o),n)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach(e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,d(r,o))}),n}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce((e,n)=>Object.assign(e,{[n.clientId]:t},b(n.innerBlocks,n.clientId)),{})}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function m(e){return p(e,e=>Object(l.omit)(e,"attributes"))}function f(e){return p(e,e=>e.attributes)}function h(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&Object(l.isEqual)(e.clientIds,t.clientIds)&&(n=e.attributes,o=t.attributes,Object(l.isEqual)(Object(l.keys)(n),Object(l.keys)(o)));var n,o}function g(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map(e=>n[e.clientId])});return n}function O(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),c=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){c.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map(e=>t[e]);for(const n of c)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map(e=>t[e])};return t}const v=Object(l.flow)(c.combineReducers,e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=Object(l.mapValues)(t.attributes,(n,r)=>{const{name:c}=t.byClientId[r];return"core/block"===c&&n.ref===e?{...n,ref:o}:n})}return e(t,n)},e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=g(o,n.blocks);o.tree=O(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=O(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e),{});o.tree=O(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=g(o,n.blocks);o.tree=O(o,{...Object(l.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter(t=>!e[t]).map(e=>"controlled||"+e))),...e},n.blocks.map(e=>e.clientId),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=O(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=O(o,Object(l.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map(e=>"controlled||"+e))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=O(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=O(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object(l.keys)(Object(l.omitBy)(o.attributes,(e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId));o.tree=O(o,{...o.tree,...e.reduce((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e),{})},e,!1)}}return o},e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let c=r;return n.blocks.length&&(c=e(c,{...n,type:"INSERT_BLOCKS",index:0}),c.order={...c.order,...Object(l.reduce)(o,(e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e),{})}),c},e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:m(n.blocks),attributes:f(n.blocks),order:d(n.blocks),parents:b(n.blocks),controlledInnerBlocks:{}},o=g(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map(e=>o[e.clientId])}},e}return e(t,n)},(function(e){let t,n=!1;return(o,r)=>{let c=e(o,r);const l="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===c&&!l){var i;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(i=null==o?void 0:o.isPersistentChange)||void 0===i||i;return o.isPersistentChange===e?o:{...c,isPersistentChange:e}}return c={...c,isPersistentChange:l?!n:!h(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,c}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)})({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...m(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=Object(l.omit)(t.updates,"attributes");return Object(l.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...Object(l.omit)(e,t.replacedClientIds),...m(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return Object(l.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...f(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every(t=>!e[t]))return e;const n=t.clientIds.reduce((n,o)=>({...n,[o]:Object(l.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,(t,n,r)=>{var c,l;return n!==t[r]&&((t=(c=e[o])===(l=t)?{...c}:l)[r]=n),t},e[o])}),{});return t.clientIds.every(t=>n[t]===e[t])?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...Object(l.omit)(e,t.replacedClientIds),...f(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return Object(l.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=d(t.blocks);return{...e,...Object(l.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=d(t.blocks,n),{index:c=o.length}=t;return{...e,...r,[n]:s(o,r[n],c)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:c=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:u(e[o],t,c,r.length)}}return{...e,[n]:Object(l.without)(e[n],...r),[o]:s(e[o],r,c)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=Object(l.first)(n),c=e[o];if(!c.length||r===Object(l.first)(c))return e;const i=c.indexOf(r);return{...e,[o]:u(c,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=Object(l.first)(n),c=Object(l.last)(n),i=e[o];if(!i.length||c===Object(l.last)(i))return e;const a=i.indexOf(r);return{...e,[o]:u(i,a,a+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=d(t.blocks);return Object(l.flow)([e=>Object(l.omit)(e,t.replacedClientIds),e=>({...e,...Object(l.omit)(o,"")}),e=>Object(l.mapValues)(e,e=>Object(l.reduce)(e,(e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e),[]))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return Object(l.flow)([e=>Object(l.omit)(e,t.removedClientIds),e=>Object(l.mapValues)(e,e=>Object(l.without)(e,...t.removedClientIds))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...b(t.blocks)};case"INSERT_BLOCKS":return{...e,...b(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce((e,n)=>(e[n]=t.toRootClientId||"",e),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...Object(l.omit)(e,t.replacedClientIds),...b(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return Object(l.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var k=Object(c.combineReducers)({blocks:v,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.startOffset},selectionEnd:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:c}=o;return{selectionStart:r,selectionEnd:c};case"MULTI_SELECT":const{start:l,end:i}=o;return{selectionStart:{clientId:l},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const a=null==n||null===(e=n.selectionStart)||void 0===e?void 0:e.clientId,s=null==n||null===(t=n.selectionEnd)||void 0===t?void 0:t.clientId;if(!a&&!s)return n;if(!o.blocks.some(e=>e.clientId===a))return{selectionStart:{},selectionEnd:{}};if(!o.blocks.some(e=>e.clientId===s))return{...n,selectionEnd:n.selectionStart}}return{selectionStart:j(n.selectionStart,o),selectionEnd:j(n.selectionEnd,o)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object(l.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?Object(l.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?Object(l.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.b,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.a,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce((e,n)=>{const{attributes:o,name:r}=n,l=Object(c.select)(i.store).getActiveBlockVariation(r,o);let a=null!=l&&l.name?`${r}/${l.name}`:r;const s={name:a};return"core/block"===r&&(s.ref=o.ref,a+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[a]:{time:t.time,count:e.insertUsage[a]?e.insertUsage[a].count+1:1,insert:s}}}},e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes}),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":if(!n.blocks.length)return t;return{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t}}),_=n("pPDe"),y=n("GRId"),E=n("g56x"),C=n("+WrK");const S=[];function w(e,t){const n=e.blocks.byClientId[t];if("web"!==y.Platform.OS&&"core/social-link"===(null==n?void 0:n.name)){const n=e.blocks.attributes[t],{service:o}=n;return o?"core/social-link-"+o:"core/social-link"}return n?n.name:null}function I(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function x(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function B(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const T=Object(_.a)((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:x(e,t)}:null},(e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]);function P(e,t){var n;const o=t&&mt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||S}const R=Object(_.a)((e,t)=>({clientId:t,innerBlocks:N(e,t)}),e=>[e.blocks.order]),N=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object(l.map)(pe(e,t),t=>R(e,t))}),e=>[e.blocks.order]),M=(e,t)=>Object(l.flatMap)(t,t=>{const n=pe(e,t);return[...n,...M(e,n)]}),L=Object(_.a)(e=>{const t=pe(e);return[...t,...M(e,t)]},e=>[e.blocks.order]),A=Object(_.a)((e,t)=>{const n=L(e);return t?Object(l.reduce)(n,(n,o)=>e.blocks.byClientId[o].name===t?n+1:n,0):n.length},e=>[e.blocks.order,e.blocks.byClientId]),D=Object(_.a)((e,t)=>Object(l.map)(Object(l.castArray)(t),t=>B(e,t)),(e,t)=>Object(l.map)(Object(l.castArray)(t),t=>e.blocks.tree[t]));function F(e,t){return pe(e,t).length}function z(e){return e.selection.selectionStart}function H(e){return e.selection.selectionEnd}function V(e){return e.selection.selectionStart.clientId}function G(e){return e.selection.selectionEnd.clientId}function U(e){const t=re(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function W(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function q(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function K(e){const t=q(e);return t?B(e,t):null}function Y(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const $=Object(_.a)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),e=>[e.blocks.parents]),Z=Object(_.a)((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=$(e,t,o);return Object(l.map)(Object(l.filter)(Object(l.map)(r,t=>({id:t,name:w(e,t)})),e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n}),e=>{let{id:t}=e;return t})}),e=>[e.blocks.parents]);function X(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function Q(e,t){const n=q(e),o=[...$(e,t),t],r=[...$(e,n),n];let c;const l=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=q(e)),void 0===t&&(t=n<0?le(e):ie(e)),!t)return null;const o=Y(e,t);if(null===o)return null;const{order:r}=e.blocks,c=r[o],l=c.indexOf(t),i=l+1*n;return i<0||i===c.length?null:c[i]}function ee(e,t){return J(e,t,-1)}function te(e,t){return J(e,t,1)}function ne(e){return e.initialPosition}const oe=Object(_.a)(e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return S;if(t.clientId===n.clientId)return[t.clientId];const o=Y(e,t.clientId);if(null===o)return S;const r=pe(e,o),c=r.indexOf(t.clientId),l=r.indexOf(n.clientId);return c>l?r.slice(l,c+1):r.slice(c,l+1)},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?S:oe(e)}const ce=Object(_.a)(e=>{const t=re(e);return t.length?t.map(t=>B(e,t)):S},e=>[...oe.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]);function le(e){return Object(l.first)(re(e))||null}function ie(e){return Object(l.last)(re(e))||null}function ae(e,t){return le(e)===t}function se(e,t){return-1!==re(e).indexOf(t)}const ue=Object(_.a)((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Y(e,n),o=se(e,n);return o},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function de(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function pe(e,t){return e.blocks.order[t||""]||S}function me(e,t){return pe(e,Y(e,t)).indexOf(t)}function fe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function he(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(l.some)(pe(e,t),t=>fe(e,t)||se(e,t)||n&&he(e,t,n))}function ge(e,t){if(!t)return!1;const n=re(e),o=n.indexOf(t);return o>-1&&oCe(e,t))}function we(e){return e.isCaretWithinFormattedText}function Ie(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:c}=r;return c?(t=Y(e,c)||void 0,n=me(e,r.clientId)+1):n=pe(e).length,{rootClientId:t,index:n}}function xe(e){return null!==e.insertionPoint}function Be(e){return e.template.isValid}function Te(e){return e.settings.template}function Pe(e,t){if(!t)return e.settings.templateLock;const n=nt(e,t);return n?n.templateLock:null}const Re=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object(l.isBoolean)(e)?e:Object(l.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ne=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=Object(i.getBlockType)(t),!n)return!1;const{allowedBlockTypes:r}=ot(e),c=Re(r,t,!0);if(!c)return!1;const l=!!Pe(e,o);if(l)return!1;const a=nt(e,o);if(o&&void 0===a)return!1;const s=null==a?void 0:a.allowedBlocks,u=Re(s,t),d=n.parent,b=w(e,o),p=Re(d,b),m=null===u&&null===p||!0===u||!0===p;return m?Object(E.applyFilters)("blockEditor.__unstableCanInsertBlockType",m,n,o,{getBlock:B.bind(null,e),getBlockParentsByBlockName:Z.bind(null,e)}):m},Me=Object(_.a)(Ne,(e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]);function Le(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every(t=>Me(e,w(e,t),n))}function Ae(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=x(e,t);if(null===o)return!0;const{lock:r}=o,c=!!Pe(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!c:!(null!=r&&r.remove)}function De(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every(t=>Ae(e,t,n))}function Fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=x(e,t);if(null===o)return;const{lock:r}=o,c="all"===Pe(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!c:!(null!=r&&r.move)}function ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every(t=>Fe(e,t,n))}function He(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const Ve=(e,t,n)=>!!Object(i.hasBlockSupport)(t,"inserter",!0)&&Ne(e,t.name,n),Ge=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:c=0}=He(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Ue(r,c)}},Ue=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},We=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;Object(i.hasBlockSupport)(t.name,"multiple",!0)||(r=Object(l.some)(D(e,L(e)),{name:t.name}));const{time:c,count:a=0}=He(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:Ue(c,a)};if("transform"===n)return s;const u=Object(i.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:u,example:t.example,utility:1}}},qe=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=We(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=C.a;if("web"===y.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,r=Object(i.getBlockType)(t+o);r&&(n=r.icon)}}const r="core/block/"+t.id,{time:c,count:l=0}=He(e,r)||{},a=Ue(c,l);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:a}},c=Object(i.getBlockTypes)().filter(n=>Ve(e,n,t)).map(n),l=Ne(e,"core/block",t)?st(e).map(r):[],a=c.reduce((t,n)=>{const{variations:o=[]}=n;if(o.some(e=>{let{isDefault:t}=e;return t})||t.push(n),o.length){const r=Ge(e,n);t.push(...o.map(r))}return t},[]),s=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:u,noncore:d}=a.reduce(s,{core:[],noncore:[]}),b=[...u,...d];return[...b,...l]}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,st(e),Object(i.getBlockTypes)()]),Ke=Object(_.a)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=We(e,{buildScope:"transform"}),r=Object(i.getBlockTypes)().filter(t=>Ve(e,t,n)).map(o),c=Object(l.mapKeys)(r,e=>{let{name:t}=e;return t}),a=Object(i.getPossibleBlockTransformations)(t).reduce((e,t)=>(c[null==t?void 0:t.name]&&e.push(c[t.name]),e),[]),s=Object(l.orderBy)(a,e=>c[e.name].frecency,"desc");return s}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Object(i.getBlockTypes)()]),Ye=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Object(l.some)(Object(i.getBlockTypes)(),n=>Ve(e,n,t));if(n)return!0;const o=Ne(e,"core/block",t)&&st(e).length>0;return o}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,st(e),Object(i.getBlockTypes)()]),$e=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return Object(l.filter)(Object(i.getBlockTypes)(),n=>Ve(e,n,t))}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Object(i.getBlockTypes)()]),Ze=Object(_.a)((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,c=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&c?"function"==typeof c?c(B(e,o))?r:null:r:void 0}),(e,t)=>[e.blockListSettings[t],e.blocks.tree[t]]),Xe=Object(_.a)((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find(e=>{let{name:n}=e;return n===t});return n?{...n,blocks:Object(i.parse)(n.content)}:null},e=>[e.settings.__experimentalBlockPatterns]),Qe=Object(_.a)(e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=ot(e);return t.filter(e=>{let{inserter:t=!0}=e;return!!t}).map(t=>{let{name:n}=t;return Xe(e,n)}).filter(e=>{let{blocks:t}=e;return((e,t)=>{if(Object(l.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Re(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach(e=>{n.push(e)})}return!0})(t,n)})},e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes]),Je=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Qe(e),o=Object(l.filter)(n,n=>{let{blocks:o}=n;return o.every(n=>{let{name:o}=n;return Me(e,o,t)})});return o}),(e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]]),et=Object(_.a)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return S;const o=Je(e,n),r=Array.isArray(t)?t:[t];return o.filter(e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,e=>r.includes(e))})}),(e,t)=>[...Je.getDependants(e,t)]),tt=Object(_.a)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return S;if(t.some(t=>{let{clientId:n,innerBlocks:o}=t;return o.length||mt(e,n)}))return S;const o=Array.from(new Set(t.map(e=>{let{name:t}=e;return t})));return et(e,o,n)}),(e,t)=>[...et.getDependants(e,t)]);function nt(e,t){return e.blockListSettings[t]}function ot(e){return e.settings}function rt(e){return e.blocks.isPersistentChange}const ct=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t,{})}),e=>[e.blockListSettings]),lt=Object(_.a)((e,t)=>{var n;const o=Object(l.find)(st(e),e=>e.id===t);return o?null===(n=o.title)||void 0===n?void 0:n.raw:null},e=>[st(e)]);function it(e){return e.blocks.isIgnoredChange}function at(e){return e.lastBlockAttributesChange}function st(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:S}function ut(e){return e.isNavigationMode}function dt(e){return e.hasBlockMovingClientId}function bt(e){return!!e.automaticChangeStatus}function pt(e,t){return e.highlightedBlock===t}function mt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const ft=Object(_.a)((e,t)=>{if(!t.length)return null;const n=q(e);if(t.includes(w(e,n)))return n;const o=re(e),r=Z(e,n||o[0],t);return r?Object(l.last)(r):null},(e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]);function ht(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var gt=n("gdqT"),Ot=n("l3Sj"),vt=n("qRz9"),jt=n("NMb1"),kt=n.n(jt);const _t=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(yt(e))},yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),c=n.getTemplateLock(),l=!r||"all"!==c||Object(i.doBlocksMatchTemplate)(e,r);if(l!==n.isValidTemplate())return o.setTemplateValidity(l),l};function Et(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ct(e){return kt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function St(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Object(l.castArray)(e),attributes:t,uniqueByBlock:n}}function wt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function It(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const xt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Bt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Tt(){return{type:"START_MULTI_SELECT"}}function Pt(){return{type:"STOP_MULTI_SELECT"}}const Rt=(e,t)=>n=>{let{select:o,dispatch:r}=n;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t});const c=o.getSelectedBlockCount();Object(gt.speak)(Object(Ot.sprintf)(Object(Ot._n)("%s block selected.","%s blocks selected.",c),c),"assertive")};function Nt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Mt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Lt(e,t){var n,o;const r=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map(e=>{var t;const n=e.name;if(!Object(i.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:c={}}=e,l=r[n];return{...e,attributes:{...c,className:`${o||""} is-style-${l}`.trim()}}})}const At=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return c=>{let{select:i,dispatch:a}=c;e=Object(l.castArray)(e),t=Lt(Object(l.castArray)(t),i.getSettings());const s=i.getBlockRootClientId(Object(l.first)(e));for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})}};function Dt(e,t){return At(e,t)}const Ft=e=>(t,n)=>o=>{let{select:r,dispatch:c}=o;r.canMoveBlocks(t,n)&&c({type:e,clientIds:Object(l.castArray)(t),rootClientId:n})},zt=Ft("MOVE_BLOCKS_DOWN"),Ht=Ft("MOVE_BLOCKS_UP"),Vt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:c,dispatch:l}=r;if(c.canMoveBlocks(e,t)){if(t!==n){if(!c.canRemoveBlocks(e,t))return;if(!c.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function Gt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return Vt([e],t,n,o)}function Ut(e,t,n,o,r){return Wt([e],t,n,o,0,r)}const Wt=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5?arguments[5]:void 0;return i=>{let{select:a,dispatch:s}=i;Object(l.isObject)(r)&&(c=r,r=0,kt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"10.1",plugin:"Gutenberg",hint:"The meta argument is now the 6th argument of the function"})),e=Lt(Object(l.castArray)(e),a.getSettings());const u=[];for(const t of e){a.canInsertBlockType(t.name,n)&&u.push(t)}u.length&&s({type:"INSERT_BLOCKS",blocks:u,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:c})}};function qt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function Kt(){return{type:"HIDE_INSERTION_POINT"}}function Yt(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const $t=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),c=Object(i.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(c)},Zt=(e,t)=>n=>{let{select:o,dispatch:r}=n;const c=[e,t];r({type:"MERGE_BLOCKS",blocks:c});const[a,s]=c,u=o.getBlock(a),d=Object(i.getBlockType)(u.name);if(d&&!d.merge)return void r.selectBlock(u.clientId);const b=o.getBlock(s),p=Object(i.getBlockType)(b.name),{clientId:m,attributeKey:f,offset:h}=o.getSelectionStart(),g=(m===a?d:p).attributes[f],O=(m===a||m===s)&&void 0!==f&&void 0!==h&&!!g;g||("number"==typeof f?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const v=Object(i.cloneBlock)(u),j=Object(i.cloneBlock)(b);if(O){const e=m===a?v:j,t=e.attributes[f],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=g,c=Object(vt.insert)(Object(vt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"†",h,h);e.attributes[f]=Object(vt.toHTMLString)({value:c,multilineTag:n,preserveWhiteSpace:r})}const k=u.name===b.name?[j]:Object(i.switchToBlockType)(j,u.name);if(!k||!k.length)return;const _=d.merge(v.attributes,k[0].attributes);if(O){const e=Object(l.findKey)(_,e=>"string"==typeof e&&-1!==e.indexOf("†")),t=_[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:c}=d.attributes[e],i=Object(vt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:c}),a=i.text.indexOf("†"),s=Object(vt.remove)(i,a,a+1),b=Object(vt.toHTMLString)({value:s,multilineTag:n,preserveWhiteSpace:c});_[e]=b,r.selectionChange(u.clientId,e,a,a)}r.replaceBlocks([u.clientId,b.clientId],[{...u,attributes:{...u.attributes,..._}},...k.slice(1)],0)},Xt=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=Object(l.castArray)(e);const c=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,c)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r(e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Qt(e,t){return Xt([e],t)}function Jt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function en(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function tn(){return{type:"START_TYPING"}}function nn(){return{type:"STOP_TYPING"}}function on(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function rn(){return{type:"STOP_DRAGGING_BLOCKS"}}function cn(){return{type:"ENTER_FORMATTED_TEXT"}}function ln(){return{type:"EXIT_FORMATTED_TEXT"}}function an(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}function sn(e,t,n){const o=Object(i.getDefaultBlockName)();if(!o)return;return Ut(Object(i.createBlock)(o,e),n,t)}function un(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function dn(e){return{type:"UPDATE_SETTINGS",settings:e}}function bn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function pn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function mn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const fn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n(()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})})},hn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?Object(gt.speak)(Object(Ot.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):Object(gt.speak)(Object(Ot.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},gn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&Object(gt.speak)(Object(Ot.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},On=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;const c=o.getBlocksByClientId(e);if(Object(l.some)(c,e=>!e))return;if(c.map(e=>e.name).some(e=>!Object(i.hasBlockSupport)(e,"multiple",!0)))return;const a=o.getBlockRootClientId(e[0]),s=o.getBlockIndex(Object(l.last)(Object(l.castArray)(e))),u=c.map(e=>Object(i.__experimentalCloneSanitizedBlock)(e));return r.insertBlocks(u,s+1,a,t),u.length>1&&t&&r.multiSelect(Object(l.first)(u).clientId,Object(l.last)(u).clientId),u.map(e=>e.clientId)}},vn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const c=n.getBlockIndex(e);return o.insertDefaultBlock({},r,c)},jn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const c=n.getBlockIndex(e);return o.insertDefaultBlock({},r,c+1)};function kn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const _n=e=>async t=>{let{dispatch:n}=t;n(kn(e,!0)),await new Promise(e=>setTimeout(e,150)),n(kn(e,!1))};function yn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}var En=n("AHN3");const Cn={reducer:k,selectors:o,actions:r,__experimentalUseThunks:!0},Sn=Object(c.createReduxStore)(En.a,{...Cn,persist:["preferences"]});Object(c.registerStore)(En.a,{...Cn,persist:["preferences"]})},Bo0k:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj");const l=[{name:Object(c._x)("Regular","font style"),value:"normal"},{name:Object(c._x)("Italic","font style"),value:"italic"}],i=[{name:Object(c._x)("Thin","font weight"),value:"100"},{name:Object(c._x)("Extra Light","font weight"),value:"200"},{name:Object(c._x)("Light","font weight"),value:"300"},{name:Object(c._x)("Regular","font weight"),value:"400"},{name:Object(c._x)("Medium","font weight"),value:"500"},{name:Object(c._x)("Semi Bold","font weight"),value:"600"},{name:Object(c._x)("Bold","font weight"),value:"700"},{name:Object(c._x)("Extra Bold","font weight"),value:"800"},{name:Object(c._x)("Black","font weight"),value:"900"}],a=(e,t)=>e?t?Object(c.__)("Appearance"):Object(c.__)("Font style"):Object(c.__)("Font weight");function s(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:s=!0,value:{fontStyle:u,fontWeight:d}}=e,b=n||s,p=a(n,s),m={key:"default",name:Object(c.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},f=Object(o.useMemo)(()=>n&&s?(()=>{const e=[m];return l.forEach(t=>{let{name:n,value:o}=t;i.forEach(t=>{let{name:r,value:l}=t;const i="normal"===o?r:Object(c.sprintf)(Object(c.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})})}),e})():n?(()=>{const e=[m];return l.forEach(t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})}),e})():(()=>{const e=[m];return i.forEach(t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})}),e})(),[e.options]),h=f.find(e=>e.style.fontStyle===u&&e.style.fontWeight===d)||f[0];return b&&Object(o.createElement)(r.CustomSelectControl,{className:"components-font-appearance-control",label:p,describedBy:h?n?s?Object(c.sprintf)(Object(c.__)("Currently selected font appearance: %s"),h.name):Object(c.sprintf)(Object(c.__)("Currently selected font style: %s"),h.name):Object(c.sprintf)(Object(c.__)("Currently selected font weight: %s"),h.name):Object(c.__)("No selected font appearance"),options:f,value:h,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}},Bpkj:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));t.a=c},Btt3:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("YLtl");const r=(e,t)=>{if(!t||!e)return;const n=t.filter(t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&Object(o.isMatch)(e,n)});return 1===n.length?n[0]:void 0}},CNgt:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Object(l.c)(),o=Object(i.a)("color.gradients.custom"),d=Object(i.a)("color.gradients.theme"),p=Object(i.a)("color.gradients.default"),m=Object(r.useMemo)(()=>[...o||[],...d||[],...p||[]],[o,d,p]),{gradient:f,customGradient:h}=Object(c.useSelect)(o=>{const{getBlockAttributes:r}=o(a.a),c=r(n)||{};return{customGradient:c[t],gradient:c[e]}},[n,e,t]),{updateBlockAttributes:g}=Object(c.useDispatch)(a.a),O=Object(r.useCallback)(o=>{const r=b(m,o);g(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})},[m,n,g]),v=s(f);let j;return j=f?u(m,f):h,{gradientClass:v,gradientValue:j,setGradient:O}}},Crq9:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},"DmX/":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));t.a=c},ERVc:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("HSyU"),c=n("BhPs");function l(e){return Object(o.useSelect)(t=>{const{getBlockName:n,getBlockAttributes:o}=t(c.a),l=o(e);if(null==l||!l.className)return;const i=Object(r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0},[e])}},EpZT:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));t.a=c},Fmc1:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("K9lf"),i=n("l3Sj"),a=n("REKd"),s=n("j6zP");function u(e){let{isDraggable:t,pattern:n,onClick:i,composite:d}=e;const{blocks:b,viewportWidth:p}=n,m="block-editor-block-patterns-list__item-description-"+Object(l.useInstanceId)(u);return Object(r.createElement)(s.a,{isEnabled:t,blocks:b},e=>{let{draggable:t,onDragStart:l,onDragEnd:s}=e;return Object(r.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?m:void 0,draggable:t,onDragStart:l,onDragEnd:s},Object(r.createElement)(c.__unstableCompositeItem,Object(o.a)({role:"option",as:"div"},d,{className:"block-editor-block-patterns-list__item",onClick:()=>i(n,b)}),Object(r.createElement)(a.a,{blocks:b,viewportWidth:p}),Object(r.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&Object(r.createElement)(c.VisuallyHidden,{id:m},n.description)))})}function d(){return Object(r.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}t.a=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:l,onClickPattern:a,orientation:s,label:b=Object(i.__)("Block Patterns")}=e;const p=Object(c.__unstableUseCompositeState)({orientation:s});return Object(r.createElement)(c.__unstableComposite,Object(o.a)({},p,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":b}),n.map(e=>l.includes(e)?Object(r.createElement)(u,{key:e.name,pattern:e,onClick:a,isDraggable:t,composite:p}):Object(r.createElement)(d,{key:e.name})))}},FnAh:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},G4zt:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("9Do8"),r=n.n(o),c=n("GRId"),l=n("1ZqX"),i=n("1CF3"),a=n("BhPs");function s(e){const t=Object(c.useRef)(),n=Object(l.useSelect)(t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(a.a);return n(e)||o()===e},[e]);return Object(c.useEffect)(()=>{if(!n)return;const e=t.current;if(!e)return;if(e.contains(e.ownerDocument.activeElement))return;const o=Object(i.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&r()(e,o,{onlyScrollIfNeeded:!0})},[n]),t}},GKUk:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("tI+e"),i=n("l3Sj"),a=n("v5LD");function s(e){let{value:t="",onChange:n,fontFamilies:s,...u}=e;const d=Object(a.a)("typography.fontFamilies");if(s||(s=d),Object(c.isEmpty)(s))return null;const b=[{value:"",label:Object(i.__)("Default")},...s.map(e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}})];return Object(r.createElement)(l.SelectControl,Object(o.a)({label:Object(i.__)("Font family"),options:b,value:t,onChange:n,labelPosition:"top"},u))}},GOly:function(e,t,n){"use strict";var o=n("GRId");const r=Object(o.createContext)();t.a=r},GRId:function(e,t){e.exports=window.wp.element},GemG:function(e,t,n){var o,r,c; +!function(){var e={6411:function(e,t){var n,o,r; /*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize -*/r=[e,t],void 0===(c="function"==typeof(o=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function l(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t,n=null,o=null,l=null,i=function(){e.clientWidth!==o&&d()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.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",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:a,update:d}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),d()}function s(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var t=function(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}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+n+"px",o=e.clientWidth,t.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o{!function(e){const[t]=a.focus.tabbable.find(e);t&&t.focus()}(e.current)},[]);Object(s.useShortcut)("core/block-editor/focus-toolbar",d),Object(r.useEffect)(()=>{l&&d()},[n,l,d]),Object(r.useEffect)(()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame(()=>{const t=u(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()})),()=>{if(window.cancelAnimationFrame(t),!c||!e.current)return;const n=u(e.current).findIndex(e=>0===e.tabIndex);c(n)}},[i,l])}t.a=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:l,__experimentalOnIndexChange:s,...u}=e;const b=Object(r.useRef)(),p=function(e){const[t,n]=Object(r.useState)(!0),o=Object(r.useCallback)(()=>{const t=a.focus.tabbable.find(e.current),o=!t.some(e=>!("toolbarItem"in e.dataset));o||i()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(o)},[]);return Object(r.useLayoutEffect)(()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()},[t]),t}(b);return d(b,n,p,l,s),p?Object(r.createElement)(c.Toolbar,Object(o.a)({label:u["aria-label"],ref:b},u),t):Object(r.createElement)(c.NavigableMenu,Object(o.a)({orientation:"horizontal",role:"toolbar",ref:b},u),t)}},GvwK:function(e,t,n){"use strict";var o=n("GRId"),r=n("NMb1"),c=n.n(r),l=n("7SSY");t.a=function(e){let{title:t,icon:n,description:r,blockType:i}=e;return i&&(c()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:r}=i)),Object(o.createElement)("div",{className:"block-editor-block-card"},Object(o.createElement)(l.a,{icon:n,showColors:!0}),Object(o.createElement)("div",{className:"block-editor-block-card__content"},Object(o.createElement)("h2",{className:"block-editor-block-card__title"},t),Object(o.createElement)("span",{className:"block-editor-block-card__description"},r)))}},HC45:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("GOly");t.a=Object(r.forwardRef)((function(e,t){const n=Object(r.useContext)(l.a);return Object(r.createElement)(c.__unstableCompositeGroup,Object(o.a)({state:n,role:"presentation",ref:t},e))}))},HSyU:function(e,t){e.exports=window.wp.blocks},HgtZ:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("ur0x"),c=n("BhPs");function l(){const{isSelected:e,clientId:t,name:n}=Object(r.c)();return Object(o.useSelect)(o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(c.a);return!!l(t)&&i().every(e=>r(e)===n)},[t,e,n])}},I5Hl:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("tI+e"),i=n("l3Sj"),a=n("iClF"),s=n("Q4Sy"),u=n("NMb1"),d=n.n(u),b=n("qrxh");function p(e,t){let{rootClientId:n,className:r,onFocus:u,tabIndex:d}=e;return Object(o.createElement)(b.a,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:b,disabled:p,isOpen:m,blockTitle:f,hasSingleBlockType:h}=e;n=h?Object(i.sprintf)(Object(i._x)("Add %s","directly add the only allowed block"),f):Object(i._x)("Add block","Generic label for block inserter button");const g=!h;let O=Object(o.createElement)(l.Button,{ref:t,onFocus:u,tabIndex:d,className:c()(r,"block-editor-button-block-appender"),onClick:b,"aria-haspopup":g?"true":void 0,"aria-expanded":g?m:void 0,disabled:p,label:n},!h&&Object(o.createElement)(l.VisuallyHidden,{as:"span"},n),Object(o.createElement)(a.a,{icon:s.a}));return(g||h)&&(O=Object(o.createElement)(l.Tooltip,{text:n},O)),O},isAppender:!0})}const m=Object(o.forwardRef)((e,t)=>(d()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender"}),p(e,t)));t.b=Object(o.forwardRef)(p)},JDWi:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("K9lf"),c=n("BhPs");function l(e){const{isNavigationMode:t,isBlockSelected:n}=Object(o.useSelect)(c.a),{setNavigationMode:l,selectBlock:i}=Object(o.useDispatch)(c.a);return Object(r.useRefEffect)(o=>{function r(o){t()&&!o.defaultPrevented&&(o.preventDefault(),n(e)?l(!1):i(e))}return o.addEventListener("mousedown",r),()=>{o.addEventListener("mousedown",r)}},[e,t,n,l])}},JGYp:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("YLtl"),r=n("GRId"),c=n("1ZqX"),l=n("HSyU"),i=n("BhPs");function a(e){let{clientId:t=null,value:n,selection:a,onChange:s=o.noop,onInput:u=o.noop}=e;const d=Object(c.useRegistry)(),{resetBlocks:b,resetSelection:p,replaceInnerBlocks:m,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:h}=d.dispatch(i.a),{getBlockName:g,getBlocks:O}=d.select(i.a),v=Object(c.useSelect)(e=>!t||e(i.a).areInnerBlocksControlled(t),[t]),j=Object(r.useRef)({incoming:null,outgoing:[]}),k=Object(r.useRef)(!1),_=()=>{n&&(h(),t?d.batch(()=>{f(t,!0);const e=n.map(e=>Object(l.cloneBlock)(e));k.current&&(j.current.incoming=e),h(),m(t,e)}):(k.current&&(j.current.incoming=n),b(n)))},y=Object(r.useRef)(u),E=Object(r.useRef)(s);Object(r.useEffect)(()=>{y.current=u,E.current=s},[u,s]),Object(r.useEffect)(()=>{j.current.outgoing.includes(n)?Object(o.last)(j.current.outgoing)===n&&(j.current.outgoing=[]):O(t)!==n&&(j.current.outgoing=[],_(),a&&p(a.selectionStart,a.selectionEnd,a.initialPosition))},[n,t]),Object(r.useEffect)(()=>{v||(j.current.outgoing=[],_())},[v]),Object(r.useEffect)(()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:c,areInnerBlocksControlled:l}=d.select(i.a);let a=O(t),s=r(),u=!1;k.current=!0;const b=d.subscribe(()=>{if(null!==t&&null===g(t))return;if(!(!t||l(t)))return;const i=r(),d=O(t),b=d!==a;if(a=d,b&&(j.current.incoming||c()))return j.current.incoming=null,void(s=i);if(b||u&&!b&&i&&!s){s=i,j.current.outgoing.push(a);(s?E.current:y.current)(a,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=b});return()=>b()},[d,t])}},JRTi:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n("GRId"),r=n("wx14"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("tI+e"),s=n("HSyU"),u=n("uoCR");const d={};var b=Object(a.withFilters)("editor.BlockEdit")(e=>{const{attributes:t={},name:n}=e,c=Object(s.getBlockType)(n),a=Object(o.useContext)(u.b),b=Object(o.useMemo)(()=>c&&c.usesContext?Object(i.pick)(a,c.usesContext):d,[c,a]);if(!c)return null;const p=c.edit||c.save;if(c.apiVersion>1)return Object(o.createElement)(p,Object(r.a)({},e,{context:b}));const m=Object(s.hasBlockSupport)(c,"className",!0)?Object(s.getBlockDefaultClassName)(n):null,f=l()(m,t.className);return Object(o.createElement)(p,Object(r.a)({},e,{context:b,className:f}))}),p=n("ur0x");function m(e){const{name:t,isSelected:n,clientId:r}=e,c={name:t,isSelected:n,clientId:r};return Object(o.createElement)(p.a,{value:Object(o.useMemo)(()=>c,Object.values(c))},Object(o.createElement)(b,e))}},JUfZ:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("l3Sj"),a=n("HSyU"),s=n("1ZqX"),u=n("GkEL"),d=n("+gtr"),b=n("BhPs");t.a=function(e){let{focusOnMount:t,isFixed:n,...c}=e;const{blockType:p,hasParents:m,showParentSelector:f}=Object(s.useSelect)(e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(b.a),{getBlockType:r}=e(a.store),c=o(),l=c[0],i=n(l),s=r(t(i[i.length-1]));return{blockType:l&&r(t(l)),hasParents:i.length,showParentSelector:Object(a.hasBlockSupport)(s,"__experimentalParentSelector",!0)&&c.length<=1}},[]);if(p&&!Object(a.hasBlockSupport)(p,"__experimentalToolbar",!0))return null;const h=l()("block-editor-block-contextual-toolbar",{"has-parent":m&&f,"is-fixed":n});return Object(r.createElement)(u.a,Object(o.a)({focusOnMount:t,className:h,"aria-label":Object(i.__)("Block tools")},c),Object(r.createElement)(d.a,{hideDragHandle:n}))}},JygI:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("TSYQ"),i=n.n(l),a=n("xN+R"),s=n("tI+e"),u=n("HSyU"),d=n("1ZqX"),b=n("l3Sj"),p=n("ZAjO"),m=n("9Ma0"),f=n("BhPs");t.a=Object(d.withSelect)((e,t)=>{var n;let{clientIds:o}=t;const{getBlock:r,getBlockIndex:l,getBlockListSettings:i,canMoveBlocks:a,getBlockOrder:s,getBlockRootClientId:d}=e(f.a),b=Object(c.castArray)(o),p=Object(c.first)(b),m=r(p),h=d(Object(c.first)(b)),g=l(p),O=0===g,v=l(Object(c.last)(b))===s(h).length-1;return{blockType:m?Object(u.getBlockType)(m.name):null,canMove:a(o,h),rootClientId:h,firstIndex:g,isFirst:O,isLast:v,orientation:null===(n=i(h))||void 0===n?void 0:n.orientation}})((function(e){let{isFirst:t,isLast:n,clientIds:c,canMove:l,isHidden:u,rootClientId:d,orientation:f,hideDragHandle:h}=e;const[g,O]=Object(r.useState)(!1),v=()=>O(!0),j=()=>O(!1);if(!l||t&&n&&!d)return null;const k=Object(b.__)("Drag");return Object(r.createElement)("div",{className:i()("block-editor-block-mover",{"is-visible":g||!u,"is-horizontal":"horizontal"===f})},!h&&Object(r.createElement)(p.a,{clientIds:c,cloneClassname:"block-editor-block-mover__drag-clone"},e=>Object(r.createElement)(s.Button,Object(o.a)({icon:a.a,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:k,tabIndex:"-1"},e))),Object(r.createElement)(s.ToolbarGroup,{className:"block-editor-block-mover__move-button-container"},Object(r.createElement)(s.ToolbarItem,{onFocus:v,onBlur:j},e=>Object(r.createElement)(m.b,Object(o.a)({clientIds:c},e))),Object(r.createElement)(s.ToolbarItem,{onFocus:v,onBlur:j},e=>Object(r.createElement)(m.a,Object(o.a)({clientIds:c},e)))))}))},Jyyd:function(e,t,n){"use strict";var o=n("tI+e");const{Fill:r,Slot:c}=Object(o.createSlotFill)("__unstableBlockSettingsMenuFirstItem");r.Slot=c,t.a=r},"K/rC":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("1ZqX"),r=n("w8sn"),c=n("BhPs"),l=n("PPMp");const i=["none","left","center","right","wide","full"],a=["wide","full"];function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=Object(o.useSelect)(e=>{const{getSettings:t}=e(c.a),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}},[]),s=Object(r.d)(),u=Object(l.a)(null==s?void 0:s.type),d=u.getAlignments(s);if(n){const t=d.filter(t=>{let{name:n}=t;return e.includes(n)});return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==u.name)return[];const{alignments:b=i}=s,p=e.filter(e=>(s.alignments||t||!a.includes(e))&&b.includes(e)).map(e=>({name:e}));return 1===p.length&&"none"===p[0].name?[]:p}},K8zD:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},K9lf:function(e,t){e.exports=window.wp.compose},KyyN:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("GRId"),r=n("fHnH"),c=n("abaT"),l=n("7bKH"),i=n("vSu0");function a(e){return Object(o.useCallback)(e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,c=t.querySelector(".editor-styles-wrapper");let l;if(c)l=n.getComputedStyle(c,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Object(r.a)(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")},[e])}function s(e){let{styles:t}=e;const n=Object(o.useMemo)(()=>Object(i.a)(t,".editor-styles-wrapper"),[t]);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("style",{ref:a(t)}),n.map((e,t)=>Object(o.createElement)("style",{key:t},e)))}Object(r.b)([c.a,l.a])},LolH:function(e,t,n){"use strict";var o=n("GRId"),r=n("l3Sj"),c=n("iClF"),l=n("//Lo");t.a=function(){return Object(o.createElement)("div",{className:"block-editor-inserter__no-results"},Object(o.createElement)(c.a,{className:"block-editor-inserter__no-results-icon",icon:l.a}),Object(o.createElement)("p",null,Object(r.__)("No results found.")))}},"M+co":function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("GOly");t.a=Object(r.forwardRef)((function(e,t){let{isFirst:n,as:i,children:a,...s}=e;const u=Object(r.useContext)(l.a);return Object(r.createElement)(c.__unstableCompositeItem,Object(o.a)({ref:t,state:u,role:"option",focusable:!0},s),e=>{const t={...e,tabIndex:n?0:e.tabIndex};return i?Object(r.createElement)(i,t,a):"function"==typeof a?a(t):Object(r.createElement)(c.Button,t,a)})}))},Mmq9:function(e,t){e.exports=window.wp.url},Mp0b:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));t.a=c},NMUH:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l}));var o=n("YLtl");const r=(e,t,n)=>{if(t){const n=Object(o.find)(e,{slug:t});if(n)return n}return{size:n}};function c(e,t){const n=Object(o.find)(e,{size:t});return n||{size:t}}function l(e){if(e)return`has-${Object(o.kebabCase)(e)}-font-size`}},NMb1:function(e,t){e.exports=window.wp.deprecated},NTP4:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},NWDH:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.a=c},NtoT:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var o=n("GRId"),r=n("YLtl"),c=n("tI+e"),l=(n("Z23Y"),n("HgtZ")),i=n("VrEk");function a(t){var n;let{__experimentalGroup:a="default",children:s}=t;const u=Object(l.a)(),d=null===(n=i.a[a])||void 0===n?void 0:n.Fill;return d?u?Object(o.createElement)(c.__experimentalStyleProvider,{document:document},Object(o.createElement)(d,null,e=>{const t=Object(r.isEmpty)(e)?null:e;return Object(o.createElement)(c.__experimentalToolsPanelContext.Provider,{value:t},s)})):null:(void 0!==e&&e.env,null)}}).call(this,n("8oxB"))},O6Fj:function(e,t,n){"use strict";t.__esModule=!0;var o=n("CNgt");t.default=o.TextareaAutosize},OL6h:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return i}));const o=".block-editor-block-list__block",r=".block-list-appender";function c(e,t){return e.closest(o)===t.closest(o)}function l(e,t){return t.closest([o,r].join(","))===e}function i(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(o);return t?t.id.slice("block-".length):void 0}},OzlF:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));t.a=c},P7XM:function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},PKbb:function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var o=n("GRId"),r=n("K9lf"),c=n("cDhi");function l(e){const{refs:t,callbacks:n}=Object(o.useContext)(c.a),l=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(t.set(l,e),()=>{t.delete(l)}),[e]),Object(r.useRefEffect)(t=>{l.current=t,n.forEach((n,o)=>{e===n&&o(t)})},[e])}function i(e){const{refs:t}=Object(o.useContext)(c.a),n=Object(o.useRef)();return n.current=e,Object(o.useMemo)(()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}}),[])}function a(e){const{callbacks:t}=Object(o.useContext)(c.a),n=i(e),[r,l]=Object(o.useState)(null);return Object(o.useLayoutEffect)(()=>{if(e)return t.set(l,e),()=>{t.delete(l)}},[e]),n.current||r}},PPMp:function(e,t,n){"use strict";n.d(t,"a",(function(){return I})),n.d(t,"b",(function(){return x}));var o=n("GRId"),r=n("l3Sj"),c=n("kWXm"),l=n("DmX/"),i=n("suLj"),a=n("bTSr"),s=n("Tqx9");var u=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(s.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"}));var d=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(s.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"})),b=n("tI+e");function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map(e=>`.editor-styles-wrapper ${e} ${t}`).join(",")}var m=n("v5LD"),f=n("fOYa"),h=n("0E5u");const g={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},O={left:"flex-start",right:"flex-end",center:"center"},v=["wrap","nowrap"];var j={name:"flex",label:Object(r.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n}=e;const{allowOrientation:r=!0}=t;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(b.Flex,null,Object(o.createElement)(b.FlexItem,null,Object(o.createElement)(k,{layout:t,onChange:n})),Object(o.createElement)(b.FlexItem,null,r&&Object(o.createElement)(y,{layout:t,onChange:n}))),Object(o.createElement)(_,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:r}=e;return null!=r&&r.allowSwitching?null:Object(o.createElement)(f.b,{group:"block",__experimentalShareWithChildBlocks:!0},Object(o.createElement)(k,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:r,layout:c,style:l}=e;const{orientation:i="horizontal"}=c,a=null!==Object(m.a)("spacing.blockGap"),s=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=g[c.justifyContent]||g.left,d=v.includes(c.flexWrap)?c.flexWrap:"wrap",b=`\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tjustify-content: ${u};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${O[c.justifyContent]||O.left};\n\t\t`;return Object(o.createElement)("style",null,`\n\t\t\t\t${p(r)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${a?s:"0.5em"};\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\t${"horizontal"===i?b:f}\n\t\t\t\t}\n\n\t\t\t\t${p(r,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function k(e){let{layout:t,onChange:n,isToolbar:s=!1}=e;const{justifyContent:u="left",orientation:d="horizontal"}=t,p=e=>{n({...t,justifyContent:e})},m=["left","center","right"];if("horizontal"===d&&m.push("space-between"),s)return Object(o.createElement)(h.a,{allowedControls:m,value:u,onChange:p,popoverProps:{position:"bottom right",isAlternate:!0}});const f=[{value:"left",icon:c.a,label:Object(r.__)("Justify items left")},{value:"center",icon:l.a,label:Object(r.__)("Justify items center")},{value:"right",icon:i.a,label:Object(r.__)("Justify items right")}];return"horizontal"===d&&f.push({value:"space-between",icon:a.a,label:Object(r.__)("Space between items")}),Object(o.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},Object(o.createElement)("legend",null,Object(r.__)("Justification")),Object(o.createElement)("div",null,f.map(e=>{let{value:t,icon:n,label:r}=e;return Object(o.createElement)(b.Button,{key:t,label:r,icon:n,isPressed:u===t,onClick:()=>p(t)})})))}function _(e){let{layout:t,onChange:n}=e;const{flexWrap:c="wrap"}=t;return Object(o.createElement)(b.ToggleControl,{label:Object(r.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===c})}function y(e){let{layout:t,onChange:n}=e;const{orientation:c="horizontal"}=t;return Object(o.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},Object(o.createElement)("legend",null,Object(r.__)("Orientation")),Object(o.createElement)(b.Button,{label:"horizontal",icon:u,isPressed:"horizontal"===c,onClick:()=>n({...t,orientation:"horizontal"})}),Object(o.createElement)(b.Button,{label:"vertical",icon:d,isPressed:"vertical"===c,onClick:()=>n({...t,orientation:"vertical"})}))}var E=n("iClF"),C=n("EpZT"),S=n("beZb");const w=[{name:"default",label:Object(r.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:c,contentSize:l}=t,i=Object(b.__experimentalUseCustomUnits)({availableUnits:Object(m.a)("spacing.units")||["%","px","em","rem","vw"]});return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"block-editor-hooks__layout-controls"},Object(o.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},Object(o.createElement)(b.__experimentalUnitControl,{label:Object(r.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:l||c||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:i}),Object(o.createElement)(E.a,{icon:C.a})),Object(o.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},Object(o.createElement)(b.__experimentalUnitControl,{label:Object(r.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:c||l||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:i}),Object(o.createElement)(E.a,{icon:S.a}))),Object(o.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},Object(o.createElement)(b.Button,{variant:"secondary",isSmall:!0,disabled:!l&&!c,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},Object(r.__)("Reset"))),Object(o.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},Object(r.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t,n;let{selector:r,layout:c={},style:l}=e;const{contentSize:i,wideSize:a}=c,s=null!==Object(m.a)("spacing.blockGap"),u=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap )";let d=i||a?`\n\t\t\t\t\t${p(r,"> *")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${p(r,'> [data-align="wide"]')} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\n\t\t\t\t\t${p(r,'> [data-align="full"]')} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return d+=`\n\t\t\t${p(r,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${p(r,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\n\t\t`,s&&(d+=`\n\t\t\t\t${p(r,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${p(r,"> * + *")} {\n\t\t\t\t\tmargin-top: ${u};\n\t\t\t\t}\n\t\t\t`),Object(o.createElement)("style",null,d)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},c=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;c.test(t)&&(o.none=Object(r.sprintf)(Object(r.__)("Max %s wide"),t));c.test(n)&&(o.wide=Object(r.sprintf)(Object(r.__)("Max %s wide"),n));return o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map(e=>({name:e,info:t[e]}));const{contentSize:n,wideSize:o}=e,c=[{name:"left"},{name:"center"},{name:"right"}];return n&&c.unshift({name:"full"}),o&&c.unshift({name:"wide",info:t.wide}),c.unshift({name:"none",info:t.none}),c}},j];function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return w.find(t=>t.name===e)}function x(){return w}},"PS/H":function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return h}));var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("1ZqX"),i=n("tI+e"),a=n("K9lf"),s=n("l3Sj"),u=n("qrxh"),d=n("BhPs"),b=n("PKbb"),p=n("2z9l");const m=Object(o.createContext)();function f(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:r}=Object(l.useDispatch)(d.a),f=Object(o.useContext)(m),h=Object(o.useRef)(),{orientation:g,previousClientId:O,nextClientId:v,rootClientId:j,isInserterShown:k}=Object(l.useSelect)(e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:c,getPreviousBlockClientId:l,getNextBlockClientId:i}=e(d.a),a=r(),s=n(a.rootClientId);if(!s.length)return{};let u=s[a.index-1],b=s[a.index];for(;c(u);)u=l(u);for(;c(b);)b=i(b);return{previousClientId:u,nextClientId:b,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}},[]),_=Object(b.a)(O),y=Object(b.a)(v),E="vertical"===g,C=Object(o.useMemo)(()=>{if(!_&&!y)return{};const e=_?_.getBoundingClientRect():null,t=y?y.getBoundingClientRect():null;if(E)return{width:_?_.offsetWidth:y.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=Object(s.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:_?_.offsetHeight:y.offsetHeight}},[_,y]),S=Object(o.useCallback)(()=>{if(!_&&!y)return{};const{ownerDocument:e}=_||y,t=_?_.getBoundingClientRect():null,n=y?y.getBoundingClientRect():null;return E?Object(s.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:Object(s.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}},[_,y]),w=Object(p.a)(n),I=Object(a.useReducedMotion)(),x=c()("block-editor-block-list__insertion-point","is-"+g);const B=_&&y&&k,T={start:{...E?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...E?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{...E?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},P={start:{scale:I?1:0},rest:{scale:1,transition:{delay:.2}}};return Object(o.createElement)(i.Popover,{ref:w,noArrow:!0,animate:!1,getAnchorRect:S,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:v+"--"+j},Object(o.createElement)(i.__unstableMotion.div,{layout:!I,initial:I?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:h,tabIndex:-1,onClick:function(e){e.target===h.current&&v&&r(v,-1)},onFocus:function(e){e.target!==h.current&&(f.current=!0)},className:c()(x,{"is-with-inserter":B}),style:C},Object(o.createElement)(i.__unstableMotion.div,{variants:T,className:"block-editor-block-list__insertion-point-indicator"}),B&&Object(o.createElement)(i.__unstableMotion.div,{variants:P,className:c()("block-editor-block-list__insertion-point-inserter")},Object(o.createElement)(u.a,{position:"bottom center",clientId:v,rootClientId:j,__experimentalIsQuick:!0,onToggle:e=>{f.current=e},onSelectOrClose:()=>{f.current=!1}}))))}function h(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:r}=e;const c=Object(l.useSelect)(e=>e(d.a).isBlockInsertionPointVisible(),[]);return Object(o.createElement)(m.Provider,{value:Object(o.useRef)(!1)},c&&Object(o.createElement)(f,{__unstablePopoverSlot:n,__unstableContentRef:r}),t)}},Q2Xw:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("TSYQ"),r=n.n(o),c=n("1ZqX"),l=n("HSyU"),i=n("BhPs");function a(e){return Object(c.useSelect)(t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:c,isBlockMultiSelected:a,getBlockName:s,getSettings:u,hasSelectedInnerBlock:d,isTyping:b,__experimentalGetActiveBlockIdByBlockNames:p}=t(i.a),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=u(),h=n(e),g=c(e),O=s(e),v=d(e,!0),j=p(m);return r()({"is-selected":g,"is-highlighted":o(e),"is-multi-selected":a(e),"is-reusable":Object(l.isReusableBlock)(Object(l.getBlockType)(O)),"is-dragging":h,"has-child-selected":v,"has-active-entity":j,"is-active-entity":j===e,"remove-outline":g&&f&&b()})},[e])}},Q4Sy:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));t.a=c},"QP/w":function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("v5LD");t.a=function(e){const t=Object(l.a)("typography.fontSizes"),n=!Object(l.a)("typography.customFontSize");return Object(r.createElement)(c.FontSizePicker,Object(o.a)({},e,{fontSizes:t,disableCustomFontSizes:n}))}},REKd:function(e,t,n){"use strict";n.d(t,"b",(function(){return O}));var o=n("GRId"),r=n("YLtl"),c=n("TSYQ"),l=n.n(c),i=n("K9lf"),a=n("1ZqX"),s=n("/QNa"),u=n("tI+e"),d=n("VyCT");function b(e){let{onClick:t}=e;return Object(o.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},Object(o.createElement)(u.Disabled,null,Object(o.createElement)(d.c,null)))}var p=n("hHnB"),m=n("KyyN"),f=n("BhPs");let h;var g=function(e){let{viewportWidth:t,__experimentalPadding:n}=e;const[r,{width:c}]=Object(i.useResizeObserver)(),[l,{height:s}]=Object(i.useResizeObserver)(),b=Object(a.useSelect)(e=>e(f.a).getSettings().styles,[]),g=Object(o.useMemo)(()=>b?[...b,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:b,[b]);h=h||Object(i.pure)(d.c);const O=c/t;return Object(o.createElement)("div",{className:"block-editor-block-preview__container"},r,Object(o.createElement)(u.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${O})`,height:s*O,maxHeight:s>2e3?2e3*O:void 0}},Object(o.createElement)(p.a,{head:Object(o.createElement)(m.a,{styles:g}),contentRef:Object(i.useRefEffect)(e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:s,pointerEvents:"none",maxHeight:2e3}},l,Object(o.createElement)(h,{renderAppender:!1}))))};t.a=Object(o.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:c=1200,__experimentalLive:l=!1,__experimentalOnClick:i}=e;const u=Object(a.useSelect)(e=>e(f.a).getSettings(),[]),d=Object(o.useMemo)(()=>{const e={...u};return e.__experimentalBlockPatterns=[],e},[u]),p=Object(o.useMemo)(()=>Object(r.castArray)(t),[t]);return t&&0!==t.length?Object(o.createElement)(s.a,{value:p,settings:d},l?Object(o.createElement)(b,{onClick:i}):Object(o.createElement)(g,{viewportWidth:c,__experimentalPadding:n})):null}));function O(e){let{blocks:t,props:n={},__experimentalLayout:c}=e;const u=Object(a.useSelect)(e=>e(f.a).getSettings(),[]),b=Object(i.__experimentalUseDisabled)(),p=Object(i.useMergeRefs)([n.ref,b]),m=Object(o.useMemo)(()=>({...u,__experimentalBlockPatterns:[]}),[u]),h=Object(o.useMemo)(()=>Object(r.castArray)(t),[t]),g=Object(o.createElement)(s.a,{value:h,settings:m},Object(o.createElement)(d.a,{renderAppender:!1,__experimentalLayout:c}));return{...n,ref:p,className:l()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?g:null}}},RMJe:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=c},Rk8H:function(e,t,n){var o=n("jTPX");e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var c=e.nodeName,l=document.createElement(c);l.innerHTML=" ","TEXTAREA"===c.toUpperCase()&&l.setAttribute("rows","1");var i=o(e,"font-size");l.style.fontSize=i,l.style.padding="0px",l.style.border="0px";var a=document.body;a.appendChild(l),n=l.offsetHeight,a.removeChild(l)}return n}},RxS6:function(e,t){e.exports=window.wp.keycodes},SVSp:function(e,t){e.exports=window.wp.shortcode},TSYQ:function(e,t,n){var o; +*/o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&p()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.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",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:p}),a()}function a(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(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 d(){if(0!==e.scrollHeight){var o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r{const{ownerDocument:a}=i,{defaultView:s}=a;if(!n||e){if(!o||e)return;const t=s.getSelection();if(t.rangeCount&&!t.isCollapsed){const e=r.current,{startContainer:n,endContainer:o}=t.getRangeAt(0);!e||e.contains(n)&&e.contains(o)||t.removeAllRanges()}return}const{length:u}=t;if(u<2)return;if(!c.current||!l.current)return;i.focus();const d=s.getSelection(),b=a.createRange(),m=p(c.current,"start"),f=p(l.current,"end");var h,g;h=i,g=!1,Array.from(h.querySelectorAll(".rich-text")).forEach(e=>{g?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}),b.setStartBefore(m),b.setEndAfter(f),d.removeAllRanges(),d.addRange(b)},[n,e,t,o])}var h=n("1CF3"),g=n("RxS6");function O(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}var v=n("OL6h");function j(e,t,n,o){let r,c=h.focus.focusable.find(n);return t&&(c=Object(u.reverse)(c)),c=c.slice(c.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),Object(u.find)(c,(function(e){if(!h.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function k(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:c,getLastMultiSelectedBlockClientId:l,getSettings:a,hasMultiSelection:u}=Object(i.useSelect)(d.a),{multiSelect:b,selectBlock:p}=Object(i.useDispatch)(d.a);return Object(s.useRefEffect)(i=>{let s;function d(){s=null}function m(c){const l=e(),i=t(),a=n(),s=o(a||l),u=r(a||l),d=c?s:u;d&&(i===d?p(d):b(i||l,d))}function f(e){const t=c(),n=l(),o=e?t:n;o&&p(o)}function O(t){const{keyCode:c,target:l}=t,d=c===g.UP,b=c===g.DOWN,p=c===g.LEFT,O=c===g.RIGHT,k=d||p,_=p||O,y=d||b,E=_||y,C=t.shiftKey,S=C||t.ctrlKey||t.altKey||t.metaKey,w=y?h.isVerticalEdge:h.isHorizontalEdge,{ownerDocument:I}=i,{defaultView:x}=I;if(u()){if(E){(C?m:f)(k),t.preventDefault()}return}if(y?s||(s=Object(h.computeCaretRect)(x)):s=null,t.defaultPrevented)return;if(!E)return;if(!function(e,t,n){if((t===g.UP||t===g.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(l,c,S))return;const B=Object(h.isRTL)(l)?!k:k,{keepCaretInsideBlock:T}=a(),P=e();if(C){const e=n(),c=o(e||P),a=r(e||P);(k&&c||!k&&a)&&function(e,t){const n=j(e,t,i);return!n||!Object(v.b)(e,n)}(l,k)&&w(l,k)&&(m(k),t.preventDefault())}else if(y&&Object(h.isVerticalEdge)(l,k)&&!T){const e=j(l,k,i,!0);e&&(Object(h.placeCaretAtVerticalEdge)(e,k,s),t.preventDefault())}else if(_&&x.getSelection().isCollapsed&&Object(h.isHorizontalEdge)(l,B)&&!T){const e=j(l,B,i);Object(h.placeCaretAtHorizontalEdge)(e,k),t.preventDefault()}}return i.addEventListener("mousedown",d),i.addEventListener("keydown",O),()=>{i.removeEventListener("mousedown",d),i.removeEventListener("keydown",O)}},[])}var _=n("hF7m");function y(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=Object(i.useSelect)(d.a),{multiSelect:o}=Object(i.useDispatch)(d.a),r=Object(_.__unstableUseShortcutEventMatch)();return Object(s.useRefEffect)(c=>{function l(c){if(!r("core/block-editor/select-all",c))return;if(!Object(h.isEntirelySelected)(c.target))return;const l=t(),[i]=l,a=n(i);let s=e(a);l.length===s.length&&(s=e(n(a)));const d=Object(u.first)(s),b=Object(u.last)(s);d!==b&&(o(d,b),c.preventDefault())}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l)}},[])}function E(){const[e,t,n]=function(){const e=Object(r.useRef)(),t=Object(r.useRef)(),n=Object(r.useRef)(),o=Object(r.useRef)(),{hasMultiSelection:c,getSelectedBlockClientId:l,getBlockCount:a}=Object(i.useSelect)(d.a),{setNavigationMode:u}=Object(i.useDispatch)(d.a),b=Object(i.useSelect)(e=>e(d.a).isNavigationMode(),[])?void 0:"0",p=Object(r.useRef)();function m(t){if(p.current)p.current=null;else if(c())e.current.focus();else if(l())o.current.focus();else{u(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";h.focus.tabbable[n](t.target).focus()}}const f=Object(r.createElement)("div",{ref:t,tabIndex:b,onFocus:m}),v=Object(r.createElement)("div",{ref:n,tabIndex:b,onFocus:m}),j=Object(s.useRefEffect)(r=>{function i(e){if(e.defaultPrevented)return;if(e.keyCode===g.ESCAPE&&!c())return e.preventDefault(),void u(!0);if(e.keyCode!==g.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!c()&&!l())return void(e.target===r&&u(!0));if(O(e.target)&&O(h.focus.tabbable[i](e.target)))return;const a=o?t:n;p.current=!0,a.current.focus({preventScroll:!0})}function s(e){o.current=e.target;const{ownerDocument:t}=r;e.relatedTarget||t.activeElement!==t.body||0!==a()||r.focus()}function d(o){var r;if(o.keyCode!==g.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const c=o.shiftKey?"findPrevious":"findNext",l=h.focus.tabbable[c](o.target);l!==t.current&&l!==n.current||(o.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:b}=r,{defaultView:m}=b;return m.addEventListener("keydown",d),r.addEventListener("keydown",i),r.addEventListener("focusout",s),()=>{m.removeEventListener("keydown",d),r.removeEventListener("keydown",i),r.removeEventListener("focusout",s)}},[]);return[f,Object(s.useMergeRefs)([e,j]),v]}(),o=Object(i.useSelect)(e=>e(d.a).hasMultiSelection(),[]);return[e,Object(s.useMergeRefs)([t,f(),y(),k(),Object(s.useRefEffect)(e=>{if(e.tabIndex=-1,o)return e.setAttribute("aria-label",Object(a.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}},[o])]),n]}t.a=Object(r.forwardRef)((function(e,t){let{children:n,...c}=e;const[i,a,u]=E();return Object(r.createElement)(r.Fragment,null,i,Object(r.createElement)("div",Object(o.a)({},c,{ref:Object(s.useMergeRefs)([a,t]),className:l()(c.className,"block-editor-writing-flow")}),n),u)}))},Tqx9:function(e,t){e.exports=window.wp.primitives},U1WI:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("1eGn");t.a=function(e){let{clientIds:t,...n}=e;return Object(r.createElement)(c.ToolbarGroup,null,Object(r.createElement)(c.ToolbarItem,null,e=>Object(r.createElement)(l.a,Object(o.a)({clientIds:t,toggleProps:e},n))))}},VKE3:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));t.a=c},VrEk:function(e,t,n){"use strict";var o=n("tI+e");const r={default:Object(o.createSlotFill)("InspectorControls"),advanced:Object(o.createSlotFill)("InspectorAdvancedControls"),dimensions:Object(o.createSlotFill)("InspectorControlsDimensions"),typography:Object(o.createSlotFill)("InspectorControlsTypography")};t.a=r},VyCT:function(e,t,n){"use strict";n.d(t,"b",(function(){return x})),n.d(t,"c",(function(){return T})),n.d(t,"a",(function(){return R}));var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("1ZqX"),i=n("K9lf"),a=n("jBNB"),s=n("YLtl"),u=n("HSyU"),d=n("5L8O"),b=n("I5Hl"),p=n("BhPs");var m=Object(l.withSelect)((e,t)=>{let{rootClientId:n}=t;const{getBlockOrder:o,canInsertBlockType:r,getTemplateLock:c,getSelectedBlockClientId:l}=e(p.a);return{isLocked:!!c(n),blockClientIds:o(n),canInsertDefaultBlock:r(Object(u.getDefaultBlockName)(),n),selectedBlockClientId:l()}})((function(e){let t,{blockClientIds:n,rootClientId:r,canInsertDefaultBlock:l,isLocked:i,renderAppender:a,className:u,selectedBlockClientId:p,tagName:m="div"}=e;if(i||!1===a)return null;if(a)t=Object(o.createElement)(a,null);else{const e=!r,c=p===r,i=p&&!n.includes(p);if(!e&&!c&&(!p||i))return null;t=l?Object(o.createElement)(d.a,{rootClientId:r,lastBlockClientId:Object(s.last)(n)}):Object(o.createElement)(b.b,{rootClientId:r,className:"block-list-appender__toggle"})}return Object(o.createElement)(m,{tabIndex:-1,className:c()("block-list-appender wp-block",u),"data-block":!0},t)})),f=n("PS/H");function h(){const e=Object(o.useContext)(f.a),t=Object(l.useSelect)(e=>e(p.a).getSettings().hasReducedUI,[]),{getBlockListSettings:n,getBlockRootClientId:r,getBlockIndex:c,isBlockInsertionPointVisible:a,isMultiSelecting:s,getSelectedBlockClientIds:u,getTemplateLock:d}=Object(l.useSelect)(p.a),{showInsertionPoint:b,hideInsertionPoint:m}=Object(l.useDispatch)(p.a);return Object(i.useRefEffect)(o=>{if(!t)return o.addEventListener("mousemove",r),()=>{o.removeEventListener("mousemove",r)};function r(t){var o,r;if(e.current)return;if(s())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(a()&&m());let l;if(!t.target.classList.contains("is-root-container")){l=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(d(l))return;const i=(null===(o=n(l))||void 0===o?void 0:o.orientation)||"vertical",p=t.target.getBoundingClientRect(),f=t.clientY-p.top,h=t.clientX-p.left;let g=Array.from(t.target.children).find(e=>e.classList.contains("wp-block")&&"vertical"===i&&e.offsetTop>f||e.classList.contains("wp-block")&&"horizontal"===i&&e.offsetLeft>h);if(!g)return;if(!g.id&&(g=g.firstElementChild,!g))return;if(null===(r=g.parentElement)||void 0===r?void 0:r.closest(".block-editor-block-content-overlay.overlay-active"))return;const O=g.id.slice("block-".length);if(!O)return;if(u().includes(O))return;const v=g.getBoundingClientRect();if("horizontal"===i&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{setTimeout(()=>e(Date.now()),0)}:window.requestIdleCallback||window.requestAnimationFrame,O="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;var v=n("w8sn"),j=n("tI+e"),k=n("NMb1"),_=n.n(k),y=n("xCFn");function E(e){let{children:t}=e;const n=Object(o.useContext)(f.a),r=Object(o.useContext)(j.Disabled.Context);return n||r?t:(_()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools"}),Object(o.createElement)(f.b,{__unstablePopoverSlot:"block-toolbar"},Object(o.createElement)(y.a,{__unstablePopoverSlot:"block-toolbar"}),t))}var C=n("zQI6"),S=n("p3NJ"),w=n("ur0x");const I=Object(o.createContext)(),x=Object(o.createContext)();function B(e){let{className:t,...n}=e;const[r,a]=Object(o.useState)(),s=Object(i.useViewportMatch)("medium"),{isOutlineMode:u,isFocusMode:d,isNavigationMode:b}=Object(l.useSelect)(e=>{const{getSettings:t,isNavigationMode:n}=e(p.a),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}},[]),m=Object(S.b)({ref:Object(i.useMergeRefs)([Object(C.b)(),h(),a]),className:c()("is-root-container",t,{"is-outline-mode":u,"is-focus-mode":d&&s,"is-navigate-mode":b})},n);return Object(o.createElement)(I.Provider,{value:r},Object(o.createElement)("div",m))}function T(e){return function(){const e=Object(l.useSelect)(e=>e(p.a).getSettings().__experimentalBlockPatterns,[]);Object(o.useEffect)(()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||(Object(l.select)(p.a).__experimentalGetParsedPattern(e[n].name),t=g(o))};return t=g(o),()=>O(t)},[e])}(),Object(o.createElement)(E,null,Object(o.createElement)(w.a,{value:w.b},Object(o.createElement)(B,e)))}function P(e){let{placeholder:t,rootClientId:n,renderAppender:r,__experimentalAppenderTagName:c,__experimentalLayout:i=v.c}=e;const[s,u]=Object(o.useState)(new Set),d=Object(o.useMemo)(()=>{const{IntersectionObserver:e}=window;if(e)return new e(e=>{u(t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n})})},[u]),{order:b,selectedBlocks:f}=Object(l.useSelect)(e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(p.a);return{order:t(n),selectedBlocks:o()}},[n]);return Object(o.createElement)(v.a,{value:i},Object(o.createElement)(x.Provider,{value:d},b.map(e=>Object(o.createElement)(l.AsyncModeProvider,{key:e,value:!s.has(e)&&!f.includes(e)},Object(o.createElement)(a.b,{rootClientId:n,clientId:e})))),b.length<1&&t,Object(o.createElement)(m,{tagName:c,rootClientId:n,renderAppender:r}))}function R(e){return Object(o.createElement)(l.AsyncModeProvider,{value:!1},Object(o.createElement)(P,e))}T.__unstableElementContext=I},WbBG:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},Wg7J:function(e,t,n){"use strict";var o=n("GRId"),r=n("YLtl"),c=n("l3Sj"),l=n("tI+e"),i=n("K9lf"),a=n("gdqT"),s=n("6ZVF"),u=n("Fmc1"),d=n("mlss"),b=n("mdLt"),p=n("LolH"),m=n("AORF"),f=n("nQUx"),h=n("+G0a"),g=n("pOGT"),O=n("wiT/");const v=[];t.a=function(e){let{filterValue:t,onSelect:n,onHover:j,rootClientId:k,clientId:_,isAppender:y,__experimentalInsertionIndex:E,maxBlockPatterns:C,maxBlockTypes:S,showBlockDirectory:w=!1,isDraggable:I=!0,shouldFocusBlock:x=!0}=e;const B=Object(i.useDebounce)(a.speak,500),[T,P]=Object(m.a)({onSelect:n,rootClientId:k,clientId:_,isAppender:y,insertionIndex:E,shouldFocusBlock:x}),[R,N,M,L]=Object(h.a)(T,P),[A,,D]=Object(f.a)(P,T),F=Object(o.useMemo)(()=>{const e=Object(g.a)(Object(r.orderBy)(R,["frecency"],["desc"]),N,M,t);return void 0!==S?e.slice(0,S):e},[t,R,N,M,S]),z=Object(o.useMemo)(()=>{const e=Object(g.b)(A,t);return void 0!==C?e.slice(0,C):e},[t,A,C]);Object(o.useEffect)(()=>{if(!t)return;const e=F.length+z.length,n=Object(c.sprintf)(Object(c._n)("%d result found.","%d results found.",e),e);B(n)},[t,B]);const H=Object(i.useAsyncList)(F,{step:9}),V=Object(i.useAsyncList)(H.length===F.length?z:v),G=!Object(r.isEmpty)(F)||!Object(r.isEmpty)(z);return Object(o.createElement)(O.a,null,!w&&!G&&Object(o.createElement)(p.a,null),!!F.length&&Object(o.createElement)(b.a,{title:Object(o.createElement)(l.VisuallyHidden,null,Object(c.__)("Blocks"))},Object(o.createElement)(s.a,{items:H,onSelect:L,onHover:j,label:Object(c.__)("Blocks"),isDraggable:I})),!!F.length&&!!z.length&&Object(o.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),!!z.length&&Object(o.createElement)(b.a,{title:Object(o.createElement)(l.VisuallyHidden,null,Object(c.__)("Block Patterns"))},Object(o.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},Object(o.createElement)(u.a,{shownPatterns:V,blockPatterns:z,onClickPattern:D,isDraggable:I}))),w&&Object(o.createElement)(d.a.Slot,{fillProps:{onSelect:L,onHover:j,filterValue:t,hasItems:G,rootClientId:T}},e=>e.length?e:G?null:Object(o.createElement)(p.a,null)))}},Wy3j:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("wx14");function i(e){return[...e].sort((t,n)=>e.filter(e=>e===n).length-e.filter(e=>e===t).length).shift()}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map(e=>Object(r.__experimentalParseUnit)(e)),n=t.map(e=>e[0]),o=t.map(e=>e[1]),c=n.every(e=>e===n[0])?n[0]:"",l=i(o),a=0===c||c?`${c}${l}`:null;return a}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=a(e),n=isNaN(parseFloat(t));return n}function u(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter(e=>!!e||0===e).length}function d(e){let{onChange:t,values:n,...i}=e;const d=a(n),b=u(n)&&s(n),p=b?Object(c.__)("Mixed"):null;return Object(o.createElement)(r.__experimentalUnitControl,Object(l.a)({},i,{"aria-label":Object(c.__)("Border radius"),disableUnits:b,isOnly:!0,value:d,onChange:t,placeholder:p}))}const b={topLeft:Object(c.__)("Top left"),topRight:Object(c.__)("Top right"),bottomLeft:Object(c.__)("Bottom left"),bottomRight:Object(c.__)("Bottom right")};function p(e){let{onChange:t,values:n,...c}=e;const i="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return Object(o.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(b).map(e=>{let[n,a]=e;return Object(o.createElement)(r.__experimentalUnitControl,Object(l.a)({},c,{key:n,"aria-label":a,value:i[n],onChange:(s=n,e=>{t&&t({...i,[s]:e||void 0})})}));var s}))}var m=n("Bpkj"),f=n("Mp0b");function h(e){let{isLinked:t,...n}=e;const i=t?Object(c.__)("Unlink Radii"):Object(c.__)("Link Radii");return Object(o.createElement)(r.Tooltip,{text:i},Object(o.createElement)(r.Button,Object(l.a)({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?m.a:f.a,iconSize:16,"aria-label":i})))}var g=n("v5LD");const O={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},v={px:100,em:20,rem:20};function j(e){let{onChange:t,values:n}=e;const[l,b]=Object(o.useState)(!u(n)||!s(n)),m=Object(r.__experimentalUseCustomUnits)({availableUnits:Object(g.a)("spacing.units")||["px","em","rem"]}),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=Object(r.__experimentalParseUnit)(e);return t||"px"}const t=Object.values(e).map(e=>{const[,t]=Object(r.__experimentalParseUnit)(e);return t});return i(t)||"px"}(n),j=m&&m.find(e=>e.value===f),k=(null==j?void 0:j.step)||1,[_]=Object(r.__experimentalParseUnit)(a(n));return Object(o.createElement)("fieldset",{className:"components-border-radius-control"},Object(o.createElement)("legend",null,Object(c.__)("Radius")),Object(o.createElement)("div",{className:"components-border-radius-control__wrapper"},l?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(d,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,unit:f,units:m}),Object(o.createElement)(r.RangeControl,{className:"components-border-radius-control__range-control",value:_,min:0,max:v[f],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${f}`:void 0)},step:k})):Object(o.createElement)(p,{min:0,onChange:t,values:n||O,units:m}),Object(o.createElement)(h,{onClick:()=>b(!l),isLinked:l})))}},XNw2:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));t.a=c},XgzB:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));t.a=c},Xkls:function(e,t,n){"use strict";var o=n("+DUQ"),r=n("GRId"),c=n("K9lf"),l=n("1CF3");const i=e=>e+1,a=e=>({top:e.offsetTop,left:e.offsetLeft});t.a=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:s,triggerAnimationOnChange:u}=e;const d=Object(r.useRef)(),b=Object(c.useReducedMotion)()||!s,[p,m]=Object(r.useReducer)(i,0),[f,h]=Object(r.useReducer)(i,0),[g,O]=Object(r.useState)({x:0,y:0}),v=Object(r.useMemo)(()=>d.current?a(d.current):null,[u]),j=Object(r.useMemo)(()=>{if(!n||!d.current)return()=>{};const e=Object(l.getScrollContainer)(d.current);if(!e)return()=>{};const t=d.current.getBoundingClientRect();return()=>{const n=d.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}},[u,n]);function k(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===k.x&&r===k.y||(!function(e){let{x:n,y:o}=e;if(!d.current)return;const r=0===n&&0===o;d.current.style.transformOrigin=r?"":"center",d.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,d.current.style.zIndex=!t||r?"":"1",j()}({x:o,y:r}),k.x=o,k.y=r)}return Object(r.useLayoutEffect)(()=>{p&&h()},[p]),Object(r.useLayoutEffect)(()=>{if(!v)return;if(b)return void j();d.current.style.transform="";const e=a(d.current);m(),O({x:Math.round(v.left-e.left),y:Math.round(v.top-e.top)})},[u]),k.x=0,k.y=0,Object(o.useSpring)({from:{x:g.x,y:g.y},to:{x:0,y:0},reset:p!==f,config:{mass:5,tension:2e3,friction:200},immediate:b,onChange:k}),d}},YLtl:function(e,t){e.exports=window.lodash},YZt4:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("HSyU"),c=n("BhPs");function l(e){return Object(o.useSelect)(t=>{const n=t(c.a).getBlockName(e),o=Object(r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return Object(r.getBlockDefaultClassName)(n)},[e])}},Z23Y:function(e,t){e.exports=window.wp.warning},ZAjO:function(e,t,n){"use strict";var o=n("GRId"),r=n("HSyU"),c=n("tI+e"),l=n("1ZqX"),i=n("q3tz"),a=n("1CF3");var s=n("BhPs");t.a=e=>{let{children:t,clientIds:n,cloneClassname:u,onDragStart:d,onDragEnd:b}=e;const{srcRootClientId:p,isDraggable:m,icon:f}=Object(l.useSelect)(e=>{var t;const{getBlockRootClientId:o,getTemplateLock:c,getBlockName:l}=e(s.a),i=o(n[0]),a=i?c(i):null,u=l(n[0]);return{srcRootClientId:i,isDraggable:"all"!==a,icon:null===(t=Object(r.getBlockType)(u))||void 0===t?void 0:t.icon}},[n]),h=Object(o.useRef)(!1),[g,O,v]=function(){const e=Object(o.useRef)(null),t=Object(o.useRef)(null),n=Object(o.useRef)(null),r=Object(o.useRef)(null);return Object(o.useEffect)(()=>()=>{r.current&&(clearInterval(r.current),r.current=null)},[]),[Object(o.useCallback)(o=>{e.current=o.clientY,n.current=Object(a.getScrollContainer)(o.target),r.current=setInterval(()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}},25)},[]),Object(o.useCallback)(o=>{if(!n.current)return;const r=n.current.offsetHeight,c=e.current-n.current.offsetTop,l=o.clientY-n.current.offsetTop;if(o.clientY>c){const e=Math.max(r-c-50,0),n=Math.max(l-c-50,0)/e;t.current=25*n}else if(o.clientY{e.current=null,n.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}(),{startDraggingBlocks:j,stopDraggingBlocks:k}=Object(l.useDispatch)(s.a);if(Object(o.useEffect)(()=>()=>{h.current&&k()},[]),!m)return t({isDraggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:p};return Object(o.createElement)(c.Draggable,{cloneClassname:u,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{j(n),h.current=!0,g(e),d&&d()},onDragOver:O,onDragEnd:()=>{k(),h.current=!1,v(),b&&b()},__experimentalDragComponent:Object(o.createElement)(i.a,{count:n.length,icon:f})},e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})})}},Zzu2:function(e,t,n){"use strict";var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("tI+e"),i=n("l3Sj"),a=n("Tqx9");var s=Object(o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(a.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));t.a=function(e){let{className:t,actions:n,children:r,secondaryActions:a}=e;return Object(o.createElement)("div",{className:c()(t,"block-editor-warning")},Object(o.createElement)("div",{className:"block-editor-warning__contents"},Object(o.createElement)("p",{className:"block-editor-warning__message"},r),(o.Children.count(n)>0||a)&&Object(o.createElement)("div",{className:"block-editor-warning__actions"},o.Children.count(n)>0&&o.Children.map(n,(e,t)=>Object(o.createElement)("span",{key:t,className:"block-editor-warning__action"},e)),a&&Object(o.createElement)(l.DropdownMenu,{className:"block-editor-warning__secondary",icon:s,label:Object(i.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},()=>Object(o.createElement)(l.MenuGroup,null,a.map((e,t)=>Object(o.createElement)(l.MenuItem,{onClick:e.onClick,key:t},e.title)))))))}},abaT:function(e,t,n){"use strict";t.a=function(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"},o={};for(var r in n)o[n[r]]=r;var c={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,l,i=o[this.toHex()];if(i)return i;if(null==t?void 0:t.closest){var a=this.toRgb(),s=1/0,u="black";if(!c.length)for(var d in n)c[d]=new e(n[d]).toRgb();for(var b in n){var p=(r=a,l=c[b],Math.pow(r.r-l.r,2)+Math.pow(r.g-l.g,2)+Math.pow(r.b-l.b,2));p{if(t){const n=Object(o.find)(e,{slug:t});if(n)return n}return{color:n}},a=(e,t)=>Object(o.find)(e,{color:t});function s(e,t){if(e&&t)return`has-${Object(o.kebabCase)(t)}-${e}`}function u(e,t){const n=Object(r.a)(t);return Object(o.maxBy)(e,e=>{let{color:t}=e;return n.contrast(t)}).color}},beZb:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));t.a=c},btIw:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(o.createElement)(r.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));t.a=c},c1Zz:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("GRId"),r=n("tI+e"),c=n("1ZqX"),l=n("BhPs"),i=n("715p");function a(e){let{children:t,group:n,label:a}=e;const{attributes:s,clientIds:u,panelId:d}=Object(c.useSelect)(e=>{const{getBlockAttributes:t,getMultiSelectedBlockClientIds:n,getSelectedBlockClientId:o,hasMultiSelection:r}=e(l.a),c=o();if(r()){const e=n(),o=e.reduce((e,n)=>(e[n]=t(n),e),{});return{panelId:c,clientIds:e,attributes:o}}return{panelId:c,clientIds:[c],attributes:{[c]:t(c)}}},[]),{updateBlockAttributes:b}=Object(c.useDispatch)(l.a);return Object(o.createElement)(r.__experimentalToolsPanel,{className:n+"-block-support-panel",label:a,resetAll:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={};u.forEach(n=>{const{style:o}=s[n];let r={style:o};e.forEach(e=>{r={...r,...e(r)}}),r={...r,style:Object(i.a)(r.style)},t[n]=r}),b(u,t,!0)},key:d,panelId:d,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0},t)}},cDcd:function(e,t){e.exports=window.React},cDhi:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var o=n("GRId");const r=Object(o.createContext)();function c(e){let{children:t}=e;const n=Object(o.useMemo)(()=>({refs:new Map,callbacks:new Map}),[]);return Object(o.createElement)(r.Provider,{value:n},t)}},cGtP:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));t.a=c},cjQ8:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));t.a=c},dchM:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("tI+e"),a=n("hMaJ");function s(e){let t,{colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:u,__experimentalHasMultipleOrigins:d,__experimentalIsRenderedInSidebar:b,enableAlpha:p,settings:m}=e;return b&&(t="bottom left"),Object(r.createElement)(i.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map((e,m)=>Object(r.createElement)(i.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:c}=t;return Object(r.createElement)(i.__experimentalItem,{onClick:c,className:l()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},Object(r.createElement)(i.__experimentalHStack,{justify:"flex-start"},Object(r.createElement)(i.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),Object(r.createElement)(i.FlexItem,null,e.label)))},renderContent:()=>Object(r.createElement)(a.a,Object(o.a)({showTitle:!1,colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:u,__experimentalHasMultipleOrigins:d,__experimentalIsRenderedInSidebar:b,enableAlpha:p},e))})))}},dfZa:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return k})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return h})),n.d(t,"g",(function(){return a})),n.d(t,"h",(function(){return i}));var o=n("nEW0"),r=n("cDcd");const c=Symbol.for("Animated:node"),l=e=>e&&e[c],i=(e,t)=>Object(o.h)(e,c,t),a=e=>e&&e[c]&&e[c].getPayload();class s{constructor(){this.payload=void 0,i(this,this)}getPayload(){return this.payload||[]}}class u extends s{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,o.s.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new u(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return o.s.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(){const{done:e}=this;this.done=!1,o.s.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class d extends u{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Object(o.f)({output:[e,e]})}static create(e){return new d(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(o.s.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=Object(o.f)({output:[this.getValue(),e]})),this._value=0,super.reset()}}const b={dependencies:null};class p extends s{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Object(o.l)(this.source,(n,r)=>{var l;(l=n)&&l[c]===l?t[r]=n.getValue(e):Object(o.r)(n)?t[r]=Object(o.q)(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Object(o.k)(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return Object(o.l)(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){b.dependencies&&Object(o.r)(e)&&b.dependencies.add(e);const t=a(e);t&&Object(o.k)(t,e=>this.add(e))}}class m extends p{constructor(e){super(e)}static create(e){return new m(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((t,n)=>t.setValue(e[n])).some(Boolean):(super.setValue(e.map(f)),!0)}}function f(e){return(Object(o.t)(e)?d:u).create(e)}function h(e){const t=l(e);return t?t.constructor:o.s.arr(e)?m:Object(o.t)(e)?d:u}function g(){return(g=Object.assign||function(e){for(var t=1;t{const n=!o.s.fun(e)||e.prototype&&e.prototype.isReactComponent;return Object(r.forwardRef)((c,l)=>{const i=Object(r.useRef)(null),a=n&&Object(r.useCallback)(e=>{i.current=function(e,t){e&&(o.s.fun(e)?e(t):e.current=t);return t}(l,e)},[l]),[s,u]=function(e,t){const n=new Set;b.dependencies=n,e.style&&(e=g({},e,{style:t.createAnimatedStyle(e.style)}));return e=new p(e),b.dependencies=null,[e,n]}(c,t),d=Object(o.z)(),m=()=>{const e=i.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&d()},f=new v(m,u),h=Object(r.useRef)();Object(o.A)(()=>{const e=h.current;h.current=f,Object(o.k)(u,e=>Object(o.c)(e,f)),e&&(Object(o.k)(e.deps,t=>Object(o.x)(t,e)),o.w.cancel(e.update))}),Object(r.useEffect)(m,[]),Object(o.C)(()=>()=>{const e=h.current;Object(o.k)(e.deps,t=>Object(o.x)(t,e))});const O=t.getComponentProps(s.getValue());return r.createElement(e,g({},O,{ref:a}))})};class v{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&o.w.write(this.update)}}const j=Symbol.for("AnimatedComponent"),k=(e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new p(e)),getComponentProps:r=(e=>e)}={})=>{const c={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},l=e=>{const t=_(e)||"Anonymous";return(e=o.s.str(e)?l[e]||(l[e]=O(e,c)):e[j]||(e[j]=O(e,c))).displayName=`Animated(${t})`,e};return Object(o.l)(e,(t,n)=>{o.s.arr(e)&&(n=_(t)),l[n]=l(t)}),{animated:l}},_=e=>o.s.str(e)?e:e&&o.s.str(e.displayName)?e.displayName:o.s.fun(e)&&e.name||null},eGrx:function(e,t){var n=e.exports=function(e){return new o(e)};function o(e){this.value=e}function r(e,t,n){var o=[],r=[],i=!0;return function e(d){var b=n?c(d):d,p={},m=!0,f={node:b,node_:d,path:[].concat(o),parent:r[r.length-1],parents:r,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(m=!1)},delete:function(e){delete f.parent.node[f.key],e&&(m=!1)},remove:function(e){a(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(m=!1)},keys:null,before:function(e){p.before=e},after:function(e){p.after=e},pre:function(e){p.pre=e},post:function(e){p.post=e},stop:function(){i=!1},block:function(){m=!1}};if(!i)return f;function h(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=l(f.node)),f.isLeaf=0==f.keys.length;for(var e=0;ee.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var h=f();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+10?!0===i?o.scrollTop(t,k.top+_.top):!1===i?o.scrollTop(t,k.top+y.top):_.top<0?o.scrollTop(t,k.top+_.top):o.scrollTop(t,k.top+y.top):l||((i=void 0===i||!!i)?o.scrollTop(t,k.top+_.top):o.scrollTop(t,k.top+y.top)),r&&(_.left<0||y.left>0?!0===s?o.scrollLeft(t,k.left+_.left):!1===s?o.scrollLeft(t,k.left+y.left):_.left<0?o.scrollLeft(t,k.left+_.left):o.scrollLeft(t,k.left+y.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+_.left):o.scrollLeft(t,k.left+y.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;tt},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||o},webkit:function(){return v()||r},safari:function(){return b.webkit()},chrome:function(){return v()||l},windows:function(){return v()||a},osx:function(){return v()||s},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||h},nativeApp:function(){return v()||f},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},7939:function(e,t,n){"use strict";var o,r=n(3110);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")) /** * Checks if an event is supported in the current execution environment. * @@ -23,4 +23,19 @@ this.wp=this.wp||{},this.wp.blockEditor=function(e){var t={};function n(o){if(t[ * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT - */,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,c=n in document;if(!c){var l=document.createElement("div");l.setAttribute(n,"return;"),c="function"==typeof l[n]}return!c&&o&&"wheel"===e&&(c=document.implementation.hasFeature("Events.wheel","3.0")),c}},f8JO:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("wC17"),i=n("BhPs");function a(e){let{clientId:t}=e;const{attributes:n,name:a,reusableBlockTitle:s}=Object(r.useSelect)(e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(i.a),l=n(t);if(!l)return{};const a=Object(c.isReusableBlock)(Object(c.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:a&&r(o(t).ref)}},[t]),u=Object(l.a)(t);if(!a||!u)return null;const d=Object(c.getBlockType)(a),b=d?Object(c.__experimentalGetBlockLabel)(d,n):null,p=s||b;return p&&p!==d.title?Object(o.truncate)(p,{length:35}):u.title}},fHnH:function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return T}));var o={grad:.9,turn:360,rad:360/(2*Math.PI)},r=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},l=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},i=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},a=function(e){return{r:l(e.r,0,255),g:l(e.g,0,255),b:l(e.b,0,255),a:l(e.a)}},s=function(e){return{r:c(e.r),g:c(e.g),b:c(e.b),a:c(e.a,3)}},u=/^#([0-9a-f]{3,8})$/i,d=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},b=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,c=Math.max(t,n,o),l=c-Math.min(t,n,o),i=l?c===t?(n-o)/l:c===n?2+(o-t)/l:4+(t-n)/l:0;return{h:60*(i<0?i+6:i),s:c?l/c*100:0,v:c/255*100,a:r}},p=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var c=Math.floor(t),l=o*(1-n),i=o*(1-(t-c)*n),a=o*(1-(1-t+c)*n),s=c%6;return{r:255*[o,i,l,l,a,o][s],g:255*[a,o,o,i,l,l][s],b:255*[l,l,a,o,o,i][s],a:r}},m=function(e){return{h:i(e.h),s:l(e.s,0,100),l:l(e.l,0,100),a:l(e.a)}},f=function(e){return{h:c(e.h),s:c(e.s),l:c(e.l),a:c(e.a,3)}},h=function(e){return p((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},g=function(e){return{h:(t=b(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},O=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,j=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,k=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_={string:[[function(e){var t=u.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=j.exec(e)||k.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({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=O.exec(e)||v.exec(e);if(!t)return null;var n,r,c=m({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(o[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return h(c)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,c=e.a,l=void 0===c?1:c;return r(t)&&r(n)&&r(o)?a({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,c=e.a,l=void 0===c?1:c;if(!r(t)||!r(n)||!r(o))return null;var i=m({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return h(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,c=e.a,a=void 0===c?1:c;if(!r(t)||!r(n)||!r(o))return null;var s=function(e){return{h:i(e.h),s:l(e.s,0,100),v:l(e.v,0,100),a:l(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(a)});return p(s)},"hsv"]]},y=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=s(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?d(c(255*r)):"","#"+d(t)+d(n)+d(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return s(this.rgba)},e.prototype.toRgbString=function(){return t=(e=s(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return f(g(this.rgba))},e.prototype.toHslString=function(){return t=(e=f(g(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=b(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 x({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),x(C(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),x(C(this.rgba,-e))},e.prototype.grayscale=function(){return x(C(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),x(w(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),x(w(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?x({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=g(this.rgba);return"number"==typeof e?x({h:e,s:t.s,l:t.l,a:t.a}):c(t.h)},e.prototype.isEqual=function(e){return this.toHex()===x(e).toHex()},e}(),x=function(e){return e instanceof I?e:new I(e)},B=[],T=function(e){e.forEach((function(e){B.indexOf(e)<0&&(e(I,_),B.push(e))}))}},fOYa:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("tI+e"),i=n("HSyU"),a=n("1ZqX");var s={default:Object(l.createSlotFill)("BlockControls"),block:Object(l.createSlotFill)("BlockControlsBlock"),inline:Object(l.createSlotFill)("BlockFormatControls"),other:Object(l.createSlotFill)("BlockControlsOther"),parent:Object(l.createSlotFill)("BlockControlsParent")},u=n("BhPs"),d=n("ur0x"),b=n("HgtZ");function p(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:p=!1}=e;const m=function(e,t){const n=Object(b.a)(),{clientId:o}=Object(d.c)(),r=Object(a.useSelect)(e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(u.a),{hasBlockSupport:c}=e(i.store);return t&&c(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)},[t,o]);var c;return n?null===(c=s[e])||void 0===c?void 0:c.Fill:r?s.parent.Fill:null}(t,p);return m?Object(r.createElement)(l.__experimentalStyleProvider,{document:document},Object(r.createElement)(m,null,e=>{const i=Object(c.isEmpty)(e)?null:e;return Object(r.createElement)(l.__experimentalToolbarContext.Provider,{value:i},"default"===t&&Object(r.createElement)(l.ToolbarGroup,{controls:n}),o)})):null}function m(e){let{group:t="default",...n}=e;const c=Object(r.useContext)(l.__experimentalToolbarContext),i=s[t].Slot,a=Object(l.__experimentalUseSlot)(i.__unstableName);return Boolean(a.fills&&a.fills.length)?"default"===t?Object(r.createElement)(i,Object(o.a)({},n,{bubblesVirtually:!0,fillProps:c})):Object(r.createElement)(l.ToolbarGroup,null,Object(r.createElement)(i,Object(o.a)({},n,{bubblesVirtually:!0,fillProps:c}))):null}const f=p;f.Slot=m;const h=e=>Object(r.createElement)(p,Object(o.a)({group:"inline"},e));h.Slot=e=>Object(r.createElement)(m,Object(o.a)({group:"inline"},e));t.b=f},fPbg:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));t.a=c},faye:function(e,t){e.exports=window.ReactDOM},felP:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("1CF3"),r=n("RxS6"),c=n("1ZqX"),l=n("K9lf"),i=n("BhPs");function a(e){const t=Object(c.useSelect)(t=>t(i.a).isBlockSelected(e),[e]),{getBlockRootClientId:n,getBlockIndex:a}=Object(c.useSelect)(i.a),{insertDefaultBlock:s,removeBlock:u}=Object(c.useDispatch)(i.a);return Object(l.useRefEffect)(c=>{if(t)return c.addEventListener("keydown",l),c.addEventListener("dragstart",i),()=>{c.removeEventListener("keydown",l),c.removeEventListener("dragstart",i)};function l(t){const{keyCode:l,target:i}=t;l!==r.ENTER&&l!==r.BACKSPACE&&l!==r.DELETE||i!==c||Object(o.isTextField)(i)||(t.preventDefault(),l===r.ENTER?s({},n(e),a(e)+1):u(e))}function i(e){e.preventDefault()}},[e,t,n,a,s,u])}},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},hF7m:function(e,t){e.exports=window.wp.keyboardShortcuts},hHnB:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("l3Sj"),a=n("K9lf"),s=n("tI+e"),u=n("zQI6"),d=n("TVFh");function b(e){return Object(r.useMemo)(()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)},[e])}t.a=Object(r.forwardRef)((function(e,t){var n,c;let{contentRef:p,children:m,head:f,tabIndex:h=0,...g}=e;const[,O]=Object(r.useReducer)(()=>({})),[v,j]=Object(r.useState)(),[k,_]=Object(r.useState)([]),y=b(null===(n=window.__editorAssets)||void 0===n?void 0:n.styles),E=b(null===(c=window.__editorAssets)||void 0===c?void 0:c.scripts),C=Object(u.b)(),[S,w,I]=Object(d.b)(),x=Object(a.useRefEffect)(e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],c={};for(const t in e)c[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();c.clientX+=e.left,c.clientY+=e.top}const l=new r(e.type,c);!n.dispatchEvent(l)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),j(t),C(r),_(Array.from(n.body.classList).filter(e=>e.startsWith("admin-color-")||"wp-embed-responsive"===e)),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",()=>{t()})},[]),B=Object(a.useRefEffect)(e=>{E.reduce((t,n)=>t.then(()=>async function(e,t){let{id:n,src:o}=t;return new Promise((t,r)=>{const c=e.ownerDocument.createElement("script");c.id=n,o?(c.src=o,c.onload=()=>t(),c.onerror=()=>r()):t(),e.appendChild(c)})}(e,n)),Promise.resolve()).finally(()=>{O()})},[]),T=Object(a.useMergeRefs)([p,C,w]);return Object(r.useEffect)(()=>{var e;v&&(e=v,Array.from(document.styleSheets).forEach(t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find(e=>{let{selectorText:t}=e;return t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))})&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}}))},[v]),f=Object(r.createElement)(r.Fragment,null,Object(r.createElement)("style",null,"body{margin:0}"),y.map(e=>{let{tagName:t,href:n,id:o,rel:c,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?Object(r.createElement)(a,{id:o,key:o},i):Object(r.createElement)(a,{href:n,id:o,rel:c,media:l,key:o})}),f),Object(r.createElement)(r.Fragment,null,h>=0&&S,Object(r.createElement)("iframe",Object(o.a)({},g,{ref:Object(a.useMergeRefs)([t,x]),tabIndex:h,title:Object(i.__)("Editor canvas")}),v&&Object(r.createPortal)(Object(r.createElement)(r.Fragment,null,Object(r.createElement)("head",{ref:B},f),Object(r.createElement)("body",{ref:T,className:l()("editor-styles-wrapper",...k)},Object(r.createElement)(s.__experimentalStyleProvider,{document:v},m))),v.documentElement)),h>=0&&I)}))},hMaJ:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("tI+e"),s=n("l3Sj"),u=n("v5LD");const d=["colors","disableCustomColors","gradients","disableCustomGradients"];function b(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,className:b,label:p,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:g,clearable:O,showTitle:v=!0,enableAlpha:j}=e;const k=m&&(!Object(i.isEmpty)(t)||!o),_=f&&(!Object(i.isEmpty)(n)||!c),[y,E]=Object(r.useState)(g?"gradient":!!k&&"color");return k||_?Object(r.createElement)(a.BaseControl,{className:l()("block-editor-color-gradient-control",b)},Object(r.createElement)("fieldset",null,Object(r.createElement)(a.__experimentalVStack,{spacing:1},v&&Object(r.createElement)("legend",null,Object(r.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},Object(r.createElement)(a.BaseControl.VisualLabel,null,p))),k&&_&&Object(r.createElement)(a.__experimentalToggleGroupControl,{value:y,onChange:E,label:Object(s.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},Object(r.createElement)(a.__experimentalToggleGroupControlOption,{value:"color",label:Object(s.__)("Solid")}),Object(r.createElement)(a.__experimentalToggleGroupControlOption,{value:"gradient",label:Object(s.__)("Gradient")})),("color"===y||!_)&&Object(r.createElement)(a.ColorPalette,{value:h,onChange:_?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,clearable:O,enableAlpha:j}),("gradient"===y||!k)&&Object(r.createElement)(a.GradientPicker,{value:g,onChange:k?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,clearable:O})))):null}function p(e){const t={};return t.colors=Object(u.a)("color.palette"),t.gradients=Object(u.a)("color.gradients"),t.disableCustomColors=!Object(u.a)("color.custom"),t.disableCustomGradients=!Object(u.a)("color.customGradient"),Object(r.createElement)(b,Object(o.a)({},t,e))}t.a=function(e){return Object(i.every)(d,t=>e.hasOwnProperty(t))?Object(r.createElement)(b,e):Object(r.createElement)(p,e)}},hw9B:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("1ZqX"),r=n("K9lf"),c=n("BhPs"),l=n("OL6h");function i(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach(e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")})}function a(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:a,selectBlock:s}=Object(o.useDispatch)(c.a),{isSelectionEnabled:u,isBlockSelected:d,getBlockParents:b,getBlockSelectionStart:p,hasMultiSelection:m}=Object(o.useSelect)(c.a);return Object(r.useRefEffect)(o=>{const{ownerDocument:r}=o,{defaultView:c}=r;let f,h;function g(t){let{isSelectionEnd:n}=t;const r=c.getSelection();if(!r.rangeCount||r.isCollapsed)return void i(o,!0);const u=Object(l.a)(r.focusNode);if(e===u){if(s(e),n&&(i(o,!0),r.rangeCount)){const{commonAncestorContainer:e}=r.getRangeAt(0);f.contains(e)&&f.focus()}}else{const t=[...b(e),e],n=[...b(u),u],o=Math.min(t.length,n.length)-1;a(t[o],n[o])}}function O(){r.removeEventListener("selectionchange",g),c.removeEventListener("mouseup",O),h=c.requestAnimationFrame(()=>{g({isSelectionEnd:!0}),n()})}function v(n){let{buttons:l}=n;1===l&&u()&&d(e)&&(f=r.activeElement,t(),r.addEventListener("selectionchange",g),c.addEventListener("mouseup",O),i(o,!1))}function j(t){if(u()&&0===t.button)if(t.shiftKey){const n=p(),r=b(n);if(n&&n!==e&&(null==r||!r.includes(e))){const c=[...r,n],l=[...b(e),e],s=Math.min(c.length,l.length)-1,u=c[s],d=l[s];u!==d&&(i(o,!1),a(u,d),t.preventDefault())}}else m()&&s(e)}return o.addEventListener("mousedown",j),o.addEventListener("mouseleave",v),()=>{o.removeEventListener("mousedown",j),o.removeEventListener("mouseleave",v),r.removeEventListener("selectionchange",g),c.removeEventListener("mouseup",O),c.cancelAnimationFrame(h)}},[e,t,n,a,s,u,d,b])}},iA5R:function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.diffChars=function(e,t,n){return r.diff(e,t,n)},t.characterDiff=void 0;var r=new(((o=n("smQA"))&&o.__esModule?o:{default:o}).default);t.characterDiff=r},iClF:function(e,t,n){"use strict";var o=n("GRId");t.a=function(e){let{icon:t,size:n=24,...r}=e;return Object(o.cloneElement)(t,{width:n,height:n,...r})}},j6zP:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("q3tz");t.a=e=>{let{isEnabled:t,blocks:n,icon:l,children:i}=e;const a={type:"inserter",blocks:n};return Object(o.createElement)(r.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:a,__experimentalDragComponent:Object(o.createElement)(c.a,{count:n.length,icon:l})},e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return i({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})})}},jB5C:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t=1;tObject(i.getSaveContent)(e.name,e.attributes,e.innerBlocks)).join(""));var d;const b=(m=t.originalContent,g=u,Object(f.diffChars)(m,g).map((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return Object(o.createElement)("span",{key:t,className:n},e.value)}));var m,g;return Object(o.createElement)("div",{className:"block-editor-block-compare__wrapper"},Object(o.createElement)(h,{title:Object(p.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:Object(p.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),Object(o.createElement)(h,{title:Object(p.__)("After Conversion"),className:"block-editor-block-compare__converted",action:r,actionText:s,rawContent:b,renderedContent:u}))},O=n("BhPs");const v=e=>Object(i.rawHandler)({HTML:e.originalContent});var j=Object(u.compose)([Object(s.withSelect)((e,t)=>{let{clientId:n}=t;return{block:e(O.a).getBlock(n)}}),Object(s.withDispatch)((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(O.a);return{convertToClassic(){o(n.clientId,(e=>Object(i.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>Object(i.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,v(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return Object(i.createBlock)(t,n,o)})(n))}}})])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:r,attemptBlockRecovery:c,block:l}=e;const s=!!Object(i.getBlockType)("core/html"),[u,d]=Object(o.useState)(!1),b=Object(o.useCallback)(()=>d(!0),[]),f=Object(o.useCallback)(()=>d(!1),[]),h=Object(o.useMemo)(()=>[{title:Object(p._x)("Resolve","imperative verb"),onClick:b},s&&{title:Object(p.__)("Convert to HTML"),onClick:t},{title:Object(p.__)("Convert to Classic Block"),onClick:r}].filter(Boolean),[b,t,r]);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(m.a,{actions:[Object(o.createElement)(a.Button,{key:"recover",onClick:c,variant:"primary"},Object(p.__)("Attempt Block Recovery"))],secondaryActions:h},Object(p.__)("This block contains unexpected or invalid content.")),u&&Object(o.createElement)(a.Modal,{title:Object(p.__)("Resolve Block"),onRequestClose:f,className:"block-editor-block-compare"},Object(o.createElement)(g,{block:l,onKeep:t,onConvert:n,convertor:v,convertButtonText:Object(p.__)("Convert to Blocks")})))}));const k=Object(o.createElement)(m.a,{className:"block-editor-block-list__block-crash-warning"},Object(p.__)("This block has encountered an error and cannot be previewed."));var _=()=>k;class y extends o.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var E=y,C=n("O6Fj"),S=n.n(C);var w=function(e){let{clientId:t}=e;const[n,r]=Object(o.useState)(""),c=Object(s.useSelect)(e=>e(O.a).getBlock(t),[t]),{updateBlock:l}=Object(s.useDispatch)(O.a);return Object(o.useEffect)(()=>{r(Object(i.getBlockContent)(c))},[c]),Object(o.createElement)(S.a,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=Object(i.getBlockType)(c.name);if(!e)return;const o=Object(i.getBlockAttributes)(e,n,c.attributes),a=n||Object(i.getSaveContent)(e,o),s=!n||Object(i.isValidBlockContent)(e,o,a);l(t,{attributes:o,originalContent:a,isValid:s}),n||r({content:a})},onChange:e=>r(e.target.value)})},I=n("nlh6");const x=Object(o.createContext)();function B(e){let{children:t,isHtml:n,...r}=e;return Object(o.createElement)("div",Object(I.a)(r,{__unstableIsHtml:n}),t)}const T=Object(s.withSelect)((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:c,isSelectionEnabled:l,getTemplateLock:i,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:s,canMoveBlock:u}=e(O.a),d=a(n),b=r(n),p=i(o),m=s(n,o),f=u(n,o),{name:h,attributes:g,isValid:v}=d||{};return{mode:c(n),isSelectionEnabled:l(),isLocked:!!p,canRemove:m,canMove:f,block:d,name:h,attributes:g,isValid:v,isSelected:b}}),P=Object(s.withDispatch)((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:r,insertBlocks:c,mergeBlocks:l,replaceBlocks:a,toggleSelection:s,__unstableMarkLastChangeAsPersistent:u}=e(O.a);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(O.a),c=n(),{clientId:l}=t,i=c.length?c:[l];r(i,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;c(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(O.a),i=l(n);c(e,i+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:c}=o(O.a);if(e){const e=c(n);e&&l(n,e)}else{const e=r(n);e&&l(e,n)}},onReplace(e,n,o){e.length&&!Object(i.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){s(e)}}});t.b=Object(u.compose)(u.pure,T,P,Object(u.ifCondition)(e=>{let{block:t}=e;return!!t}),Object(a.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:r,clientId:a,isSelected:u,isSelectionEnabled:p,className:m,name:f,isValid:h,attributes:g,wrapperProps:v,setAttributes:k,onReplace:y,onInsertBlocksAfter:C,onMerge:S,toggleSelection:I}=e;const{removeBlock:T}=Object(s.useDispatch)(O.a),P=Object(o.useCallback)(()=>T(a),[a]);let R=Object(o.createElement)(b.a,{name:f,isSelected:u,attributes:g,setAttributes:k,insertBlocksAfter:n?void 0:C,onReplace:r?y:void 0,onRemove:r?P:void 0,mergeBlocks:r?S:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:I});const N=Object(i.getBlockType)(f);null!=N&&N.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(v,N.getEditWrapperProps(g)));const M=v&&!!v["data-align"];let L;if(M&&(R=Object(o.createElement)("div",{className:"wp-block","data-align":v["data-align"]},R)),h)L="html"===t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{style:{display:"none"}},R),Object(o.createElement)(B,{isHtml:!0},Object(o.createElement)(w,{clientId:a}))):(null==N?void 0:N.apiVersion)>1?R:Object(o.createElement)(B,v,R);else{const e=Object(i.getSaveContent)(N,g);L=Object(o.createElement)(B,{className:"has-warning"},Object(o.createElement)(j,{clientId:a}),Object(o.createElement)(o.RawHTML,null,Object(d.safeHTML)(e)))}const A={clientId:a,className:m,wrapperProps:Object(l.omit)(v,["data-align"]),isAligned:M},D=Object(o.useMemo)(()=>A,Object.values(A));return Object(o.createElement)(x.Provider,{value:D},Object(o.createElement)(E,{fallback:Object(o.createElement)(B,{className:"has-warning"},Object(o.createElement)(_,null))},L))}))},jTPX:function(e,t){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},jrfk:function(e,t){var n,o,r,c,l,i,a,s,u,d,b,p,m,f,h,g=!1;function O(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),O=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),d=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),h=/Mobile/i.exec(e),b=!!/Win64/.exec(e),t){(n=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(n=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);i=v?parseFloat(v[1])+4:n,o=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,(c=t[4]?parseFloat(t[4]):NaN)?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=t&&t[1]?parseFloat(t[1]):NaN):l=NaN}else n=o=r=l=c=NaN;if(O){if(O[1]){var j=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!j||parseFloat(j[1].replace("_","."))}else a=!1;s=!!O[2],u=!!O[3]}else a=s=u=!1}}var v={ie:function(){return O()||n},ieCompatibilityMode:function(){return O()||i>n},ie64:function(){return v.ie()&&b},firefox:function(){return O()||o},opera:function(){return O()||r},webkit:function(){return O()||c},safari:function(){return v.webkit()},chrome:function(){return O()||l},windows:function(){return O()||s},osx:function(){return O()||a},linux:function(){return O()||u},iphone:function(){return O()||p},mobile:function(){return O()||p||m||d||h},nativeApp:function(){return O()||f},android:function(){return O()||d},ipad:function(){return O()||m}};e.exports=v},jwne:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=(n("Z23Y"),n("c1Zz")),i=n("asom"),a=n("VrEk");function s(t){var n;let{__experimentalGroup:s="default",bubblesVirtually:u=!0,label:d,...b}=t;const p=null===(n=a.a[s])||void 0===n?void 0:n.Slot,m=Object(c.__experimentalUseSlot)(null==p?void 0:p.__unstableName);if(!p||!m)return void 0!==e&&e.env,null;return Boolean(m.fills&&m.fills.length)?d?Object(r.createElement)(l.a,{group:s,label:d},Object(r.createElement)(i.a,Object(o.a)({},b,{bubblesVirtually:u,Slot:p}))):Object(r.createElement)(p,Object(o.a)({},b,{bubblesVirtually:u})):null}}).call(this,n("8oxB"))},kBLm:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("1ZqX"),r=n("K9lf"),c=n("BhPs");function l(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function i(){const e=Object(o.useSelect)(e=>{const{isNavigationMode:t,getSettings:n}=e(c.a);return t()||n().outlineMode},[]);return Object(r.useRefEffect)(t=>{if(e)return t.addEventListener("mouseout",l),t.addEventListener("mouseover",l),()=>{t.removeEventListener("mouseout",l),t.removeEventListener("mouseover",l),t.classList.remove("is-hovered")}},[e])}},kVRd:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n("GRId"),r=n("tI+e"),c=n("Tqx9");var l=Object(o.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(c.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),i=n("Crq9"),a=n("l3Sj");const s=[{name:Object(a.__)("Underline"),value:"underline",icon:l},{name:Object(a.__)("Strikethrough"),value:"line-through",icon:i.a}];function u(e){let{value:t,onChange:n}=e;return Object(o.createElement)("fieldset",{className:"block-editor-text-decoration-control"},Object(o.createElement)("legend",null,Object(a.__)("Decoration")),Object(o.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},s.map(e=>Object(o.createElement)(r.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name}))))}},kWXm:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));t.a=c},kaUp:function(e,t){},kmrn:function(e,t,n){"use strict";n.d(t,"useSpring",(function(){return ke}));var o=n("nEW0");n.d(t,"Globals",(function(){return o.b}));var r=n("cDcd"),c=n("dfZa");n("kaUp"),n("v8Ku");function l(){return(l=Object.assign||function(e){for(var t=1;t!0===e||!!(t&&e&&(o.s.fun(e)?e(t):Object(o.y)(e).includes(t))),s=(e,t)=>o.s.obj(e)?t&&e[t]:e,u=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,d=e=>e,b=(e,t=d)=>{let n=p;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const r={};for(const c of n){const n=t(e[c],c);o.s.und(n)||(r[c]=n)}return r},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],m={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 f(e){const t=function(e){const t={};let n=0;if(Object(o.l)(e,(e,o)=>{m[o]||(t[o]=e,n++)}),n)return t}(e);if(t){const n={to:t};return Object(o.l)(e,(e,o)=>o in t||(n[o]=e)),n}return l({},e)}function h(e){return e=Object(o.q)(e),o.s.arr(e)?e.map(h):Object(o.t)(e)?o.b.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function g(e){for(const t in e)return!0;return!1}function O(e){return o.s.fun(e)||o.s.arr(e)&&o.s.obj(e[0])}function v(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function j(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const k=1.70158,_=1.525*k,y=2*Math.PI/3,E=2*Math.PI/4.5,C=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},S=l({},{tension:170,friction:26},{mass:1,damping:1,easing:{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=>2.70158*e*e*e-k*e*e,easeOutBack:e=>1+2.70158*Math.pow(e-1,3)+k*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-_)/2:(Math.pow(2*e-2,2)*((_+1)*(2*e-2)+_)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*y),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*y)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*E)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*E)/2+1,easeInBounce:e=>1-C(1-e),easeOutBounce:C,easeInOutBounce:e=>e<.5?(1-C(1-2*e))/2:(1+C(2*e-1))/2}.linear,clamp:!1});class w{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,S)}}function I(e,t){if(o.s.und(t.decay)){const n=!o.s.und(t.tension)||!o.s.und(t.friction);!n&&o.s.und(t.frequency)&&o.s.und(t.damping)&&o.s.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const x=[];class B{constructor(){this.changed=!1,this.values=x,this.toValues=null,this.fromValues=x,this.to=void 0,this.from=void 0,this.config=new w,this.immediate=!1}}function T(e,{key:t,props:n,defaultProps:r,state:c,actions:s}){return new Promise((u,d)=>{var b;let p,m,f=a(null!=(b=n.cancel)?b:null==r?void 0:r.cancel,t);if(f)O();else{o.s.und(n.pause)||(c.paused=a(n.pause,t));let e=null==r?void 0:r.pause;!0!==e&&(e=c.paused||a(e,t)),p=i(n.delay||0,t),e?(c.resumeQueue.add(g),s.pause()):(s.resume(),g())}function h(){c.resumeQueue.add(g),c.timeouts.delete(m),m.cancel(),p=m.time-o.w.now()}function g(){p>0&&!o.b.skipAnimation?(c.delayed=!0,m=o.w.setTimeout(O,p),c.pauseQueue.add(h),c.timeouts.add(m)):O()}function O(){c.delayed&&(c.delayed=!1),c.pauseQueue.delete(h),c.timeouts.delete(m),e<=(c.cancelId||0)&&(f=!0);try{s.start(l({},n,{callId:e,cancel:f}),u)}catch(e){d(e)}}})}const P=(e,t)=>1==t.length?t[0]:t.some(e=>e.cancelled)?M(e.get()):t.every(e=>e.noop)?R(e.get()):N(e.get(),t.every(e=>e.finished)),R=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),N=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),M=e=>({value:e,cancelled:!0,finished:!1});function L(e,t,n,r){const{callId:c,parentId:i,onRest:a}=t,{asyncTo:s,promise:u}=n;return i||e!==s||t.reset?n.promise=(async()=>{n.asyncId=c,n.asyncTo=e;const d=b(t,(e,t)=>"onRest"===t?void 0:e);let p,m;const f=new Promise((e,t)=>(p=e,m=t)),h=e=>{const t=c<=(n.cancelId||0)&&M(r)||c!==n.asyncId&&N(r,!1);if(t)throw e.result=t,m(e),e},g=(e,t)=>{const i=new D,a=new F;return(async()=>{if(o.b.skipAnimation)throw A(n),a.result=N(r,!1),m(a),a;h(i);const s=o.s.obj(e)?l({},e):l({},t,{to:e});s.parentId=c,Object(o.l)(d,(e,t)=>{o.s.und(s[t])&&(s[t]=e)});const u=await r.start(s);return h(i),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),u})()};let O;if(o.b.skipAnimation)return A(n),N(r,!1);try{let t;t=o.s.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,r.stop.bind(r))),await Promise.all([t.then(p),f]),O=N(r.get(),!0,!1)}catch(e){if(e instanceof D)O=e.result;else{if(!(e instanceof F))throw e;O=e.result}}finally{c==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?u:void 0)}return o.s.fun(a)&&o.w.batchedUpdates(()=>{a(O,r,r.item)}),O})():u}function A(e,t){Object(o.m)(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class D extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const z=e=>e instanceof V;let H=1;class V extends o.a{constructor(...e){super(...e),this.id=H++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Object(c.e)(this);return e&&e.getValue()}to(...e){return o.b.to(this,e)}interpolate(...e){return Object(o.j)(),o.b.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){Object(o.d)(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||o.o.sort(this),Object(o.d)(this,{type:"priority",parent:this,priority:e})}}const G=Symbol.for("SpringPhase"),U=e=>(1&e[G])>0,W=e=>(2&e[G])>0,q=e=>(4&e[G])>0,K=(e,t)=>t?e[G]|=3:e[G]&=-3,Y=(e,t)=>t?e[G]|=4:e[G]&=-5;class $ extends V{constructor(e,t){if(super(),this.key=void 0,this.animation=new B,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!o.s.und(e)||!o.s.und(t)){const n=o.s.obj(e)?l({},e):l({},t,{from:e});o.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(W(this)||this._state.asyncTo)||q(this)}get goal(){return Object(o.q)(this.animation.to)}get velocity(){const e=Object(c.e)(this);return e instanceof c.c?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return U(this)}get isAnimating(){return W(this)}get isPaused(){return q(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{config:l,toValues:i}=r;const a=Object(c.g)(r.to);!a&&Object(o.r)(r.to)&&(i=Object(o.y)(Object(o.q)(r.to))),r.values.forEach((s,u)=>{if(s.done)return;const d=s.constructor==c.b?1:a?a[u].lastPosition:i[u];let b=r.immediate,p=d;if(!b){if(p=s.lastPosition,l.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=r.fromValues[u],c=null!=s.v0?s.v0:s.v0=o.s.arr(l.velocity)?l.velocity[u]:l.velocity;let i;if(o.s.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);p=n+c/(1-e)*(1-o),b=Math.abs(s.lastPosition-p)<.1,i=c*o}else{i=null==s.lastVelocity?c:s.lastVelocity;const t=l.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),r=l.restVelocity||t/10,a=l.clamp?0:l.bounce,u=!o.s.und(a),m=n==d?s.v0>0:nr,f||(b=Math.abs(d-p)<=t,!b));++e){u&&(h=p==d||p>d==m,h&&(i=-i*a,p=d));i+=(1e-6*-l.tension*(p-d)+.001*-l.friction*i)/l.mass*g,p+=i*g}}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,s.durationProgress>0&&(s.elapsedTime=l.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),p=n+l.easing(o)*(d-n),i=(p-s.lastPosition)/e,b=1==o}s.lastVelocity=i,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),b=!0)}a&&!a[u].done&&(b=!1),b?s.done=!0:t=!1,s.setValue(p,l.round)&&(n=!0)});const s=Object(c.e)(this),u=s.getValue();if(t){const e=Object(o.q)(r.to);u===e&&!n||l.decay?n&&l.decay&&this._onChange(u):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(u)}set(e){return o.w.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(W(this)){const{to:e,config:t}=this.animation;o.w.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 o.s.und(e)?(n=this.queue||[],this.queue=[]):n=[o.s.obj(e)?e:l({},t,{to:e})],Promise.all(n.map(e=>this._update(e))).then(e=>P(this,e))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),A(this._state,e&&this._lastCallId),o.w.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){const t=this.key||"";let{to:n,from:r}=e;n=o.s.obj(n)?n[t]:n,(null==n||O(n))&&(n=void 0),r=o.s.obj(r)?r[t]:r,null==r&&(r=void 0);const l={to:n,from:r};return U(this)||(e.reverse&&([n,r]=[r,n]),r=Object(o.q)(r),o.s.und(r)?Object(c.e)(this)||this._set(n):this._set(r)),l}_update(e,t){let n=l({},e);const{key:r,defaultProps:c}=this;n.default&&Object.assign(c,b(n,(e,t)=>/^on/.test(t)?s(e,r):e)),ne(this,n,"onProps"),oe(this,"onProps",n,this);const i=this._prepareNode(n);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?");const a=this._state;return T(++this._lastCallId,{key:r,props:n,defaultProps:c,state:a,actions:{pause:()=>{q(this)||(Y(this,!0),Object(o.n)(a.pauseQueue),oe(this,"onPause",N(this,Z(this,this.animation.to)),this))},resume:()=>{q(this)&&(Y(this,!1),W(this)&&this._resume(),Object(o.n)(a.resumeQueue),oe(this,"onResume",N(this,Z(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=X(n);if(e)return this._update(e,!0)}return e})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(M(this));const r=!o.s.und(e.to),s=!o.s.und(e.from);if(r||s){if(!(t.callId>this._lastToId))return n(M(this));this._lastToId=t.callId}const{key:u,defaultProps:d,animation:b}=this,{to:p,from:m}=b;let{to:f=p,from:g=m}=e;!s||r||t.default&&!o.s.und(f)||(f=g),t.reverse&&([f,g]=[g,f]);const v=!Object(o.u)(g,m);v&&(b.from=g),g=Object(o.q)(g);const j=!Object(o.u)(f,p);j&&this._focus(f);const k=O(t.to),{config:_}=b,{decay:y,velocity:E}=_;(r||s)&&(_.velocity=0),t.config&&!k&&function(e,t,n){n&&(I(n=l({},n),t),t=l({},n,t)),I(e,t),Object.assign(e,t);for(const t in S)null==e[t]&&(e[t]=S[t]);let{mass:r,frequency:c,damping:i}=e;o.s.und(c)||(c<.01&&(c=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/c,2)*r,e.friction=4*Math.PI*i*r/c)}(_,i(t.config,u),t.config!==d.config?i(d.config,u):void 0);let C=Object(c.e)(this);if(!C||o.s.und(f))return n(N(this,!0));const w=o.s.und(t.reset)?s&&!t.default:!o.s.und(g)&&a(t.reset,u),x=w?g:this.get(),B=h(f),T=o.s.num(B)||o.s.arr(B)||Object(o.t)(B),P=!k&&(!T||a(d.immediate||t.immediate,u));if(j){const e=Object(c.f)(f);if(e!==C.constructor){if(!P)throw Error(`Cannot animate between ${C.constructor.name} and ${e.name}, as the "to" prop suggests`);C=this._set(B)}}const A=C.constructor;let D=Object(o.r)(f),F=!1;if(!D){const e=w||!U(this)&&v;(j||e)&&(F=Object(o.u)(h(x),B),D=!F),(Object(o.u)(b.immediate,P)||P)&&Object(o.u)(_.decay,y)&&Object(o.u)(_.velocity,E)||(D=!0)}if(F&&W(this)&&(b.changed&&!w?D=!0:D||this._stop(p)),!k&&((D||Object(o.r)(p))&&(b.values=C.getPayload(),b.toValues=Object(o.r)(f)?null:A==c.b?[1]:Object(o.y)(B)),b.immediate!=P&&(b.immediate=P,P||w||this._set(p)),D)){const{onRest:e}=b;Object(o.k)(te,e=>ne(this,t,e));const r=N(this,Z(this,p));Object(o.n)(this._pendingCalls,r),this._pendingCalls.add(n),b.changed&&o.w.batchedUpdates(()=>{b.changed=!w,null==e||e(r,this),w?i(d.onRest,r):null==b.onStart||b.onStart(r,this)})}w&&this._set(x),k?n(L(t.to,t,this._state,this)):D?this._start():W(this)&&!j?this._pendingCalls.add(n):n(R(x))}_focus(e){const t=this.animation;e!==t.to&&(Object(o.p)(this)&&this._detach(),t.to=e,Object(o.p)(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Object(o.r)(t)&&(Object(o.c)(t,this),z(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Object(o.r)(e)&&Object(o.x)(e,this)}_set(e,t=!0){const n=Object(o.q)(e);if(!o.s.und(n)){const e=Object(c.e)(this);if(!e||!Object(o.u)(n,e.getValue())){const r=Object(c.f)(n);e&&e.constructor==r?e.setValue(n):Object(c.h)(this,r.create(n)),e&&o.w.batchedUpdates(()=>{this._onChange(n,t)})}}return Object(c.e)(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,oe(this,"onStart",N(this,Z(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),i(this.animation.onChange,e,this)),i(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Object(c.e)(this).reset(Object(o.q)(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),W(this)||(K(this,!0),q(this)||this._resume())}_resume(){o.b.skipAnimation?this.finish():o.o.start(this)}_stop(e,t){if(W(this)){K(this,!1);const n=this.animation;Object(o.k)(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(o.d)(this,{type:"idle",parent:this});const r=t?M(this.get()):N(this.get(),Z(this,null!=e?e:n.to));Object(o.n)(this._pendingCalls,r),n.changed&&(n.changed=!1,oe(this,"onRest",r,this))}}}function Z(e,t){const n=h(t),r=h(e.get());return Object(o.u)(r,n)}function X(e,t=e.loop,n=e.to){let o=i(t);if(o){const r=!0!==o&&f(o),c=(r||e).reverse,i=!r||r.reset;return Q(l({},e,{loop:t,default:!1,pause:void 0,to:!c||O(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Q(e){const{to:t,from:n}=e=f(e),r=new Set;return o.s.obj(t)&&ee(t,r),o.s.obj(n)&&ee(n,r),e.keys=r.size?Array.from(r):null,e}function J(e){const t=Q(e);return o.s.und(t.default)&&(t.default=b(t)),t}function ee(e,t){Object(o.l)(e,(e,n)=>null!=e&&t.add(n))}const te=["onStart","onRest","onChange","onPause","onResume"];function ne(e,t,n){e.animation[n]=t[n]!==u(t,n)?s(t[n],e.key):void 0}function oe(e,t,...n){var o,r,c,l;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(c=(l=e.defaultProps)[t])||c.call(l,...n)}const re=["onStart","onChange","onRest"];let ce=1;class le{constructor(e,t){this.id=ce++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(l({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(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];o.s.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Q(e)),this}start(e){let{queue:t}=this;return e?t=Object(o.y)(e).map(Q):this.queue=[],this._flush?this._flush(this,t):(be(this,t),ie(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Object(o.k)(Object(o.y)(t),t=>n[t].stop(!!e))}else A(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(o.s.und(e))this.start({pause:!0});else{const t=this.springs;Object(o.k)(Object(o.y)(e),e=>t[e].pause())}return this}resume(e){if(o.s.und(e))this.start({pause:!1});else{const t=this.springs;Object(o.k)(Object(o.y)(e),e=>t[e].resume())}return this}each(e){Object(o.l)(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,c=this._changed.size>0;(r&&!this._started||c&&!this._started)&&(this._started=!0,Object(o.m)(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));const l=!r&&this._started,i=c||l&&n.size?this.get():null;c&&t.size&&Object(o.m)(t,([e,t])=>{t.value=i,e(t,this,this._item)}),l&&(this._started=!1,Object(o.m)(n,([e,t])=>{t.value=i,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)}o.w.onFrame(this._onFrame)}}function ie(e,t){return Promise.all(t.map(t=>async function e(t,n,r){const{keys:c,to:l,from:i,loop:a,onRest:s,onResolve:d}=n,b=o.s.obj(n.default)&&n.default;a&&(n.loop=!1);!1===l&&(n.to=null);!1===i&&(n.from=null);const p=o.s.arr(l)||o.s.fun(l)?l:void 0;p?(n.to=void 0,n.onRest=void 0,b&&(b.onRest=void 0)):Object(o.k)(re,e=>{const r=n[e];if(o.s.fun(r)){const o=t._events[e];n[e]=({finished:e,cancelled:t})=>{const n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},b&&(b[e]=n[e])}});const m=t._state;n.pause===!m.paused?(m.paused=n.pause,Object(o.n)(n.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(n.pause=!0);const f=(c||Object.keys(t.springs)).map(e=>t.springs[e].start(n)),h=!0===n.cancel||!0===u(n,"cancel");(p||h&&m.asyncId)&&f.push(T(++t._lastAsyncId,{props:n,state:m,actions:{pause:o.v,resume:o.v,start(e,n){h?(A(m,t._lastAsyncId),n(M(t))):(e.onRest=s,n(L(p,e,m,t)))}}}));m.paused&&await new Promise(e=>{m.resumeQueue.add(e)});const g=P(t,await Promise.all(f));if(a&&g.finished&&(!r||!g.noop)){const o=X(n,a,l);if(o)return be(t,[o]),e(t,o,!0)}d&&o.w.batchedUpdates(()=>d(g,t,t.item));return g}(e,t))).then(t=>P(e,t))}function ae(e,t){const n=l({},e.springs);return t&&Object(o.k)(Object(o.y)(t),e=>{o.s.und(e.keys)&&(e=Q(e)),o.s.obj(e.to)||(e=l({},e,{to:void 0})),de(n,e,e=>ue(e))}),se(e,n),n}function se(e,t){Object(o.l)(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,Object(o.c)(t,e))})}function ue(e,t){const n=new $;return n.key=e,t&&Object(o.c)(n,t),n}function de(e,t,n){t.keys&&Object(o.k)(t.keys,o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)})}function be(e,t){Object(o.k)(t,t=>{de(e.springs,t,t=>ue(t,e))})}function pe(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const me=["children"],fe=e=>{let{children:t}=e,n=pe(e,me);const c=Object(r.useContext)(he),l=n.pause||!!c.pause,i=n.immediate||!!c.immediate;n=Object(o.B)(()=>({pause:l,immediate:i}),[l,i]);const{Provider:a}=he;return r.createElement(a,{value:n},t)},he=(ge=fe,Oe={},Object.assign(ge,r.createContext(Oe)),ge.Provider._context=ge,ge.Consumer._context=ge,ge);var ge,Oe;fe.Provider=he.Provider,fe.Consumer=he.Consumer;const ve=()=>{const e=[],t=function(t){Object(o.i)();const r=[];return Object(o.k)(e,(e,c)=>{if(o.s.und(t))r.push(e.start());else{const o=n(t,e,c);o&&r.push(e.start(o))}}),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Object(o.k)(e,e=>e.pause(...arguments)),this},t.resume=function(){return Object(o.k)(e,e=>e.resume(...arguments)),this},t.set=function(t){Object(o.k)(e,e=>e.set(t))},t.start=function(t){const n=[];return Object(o.k)(e,(e,r)=>{if(o.s.und(t))n.push(e.start());else{const o=this._getProps(t,e,r);o&&n.push(e.start(o))}}),n},t.stop=function(){return Object(o.k)(e,e=>e.stop(...arguments)),this},t.update=function(t){return Object(o.k)(e,(e,n)=>e.update(this._getProps(t,e,n))),this};const n=function(e,t,n){return o.s.fun(e)?e(n,t):e};return t._getProps=n,t};function je(e,t,n){const c=o.s.fun(t)&&t;c&&!n&&(n=[]);const i=Object(r.useMemo)(()=>c||3==arguments.length?ve():void 0,[]),a=Object(r.useRef)(0),s=Object(o.z)(),u=Object(r.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){const n=ae(e,t);return a.current>0&&!u.queue.length&&!Object.keys(n).some(t=>!e.springs[t])?ie(e,t):new Promise(o=>{se(e,n),u.queue.push(()=>{o(ie(e,t))}),s()})}}),[]),d=Object(r.useRef)([...u.ctrls]),b=[],p=Object(o.D)(e)||0;function m(e,n){for(let o=e;o{Object(o.k)(d.current.slice(e,p),e=>{v(e,i),e.stop(!0)}),d.current.length=e,m(p,e)},[e]),Object(r.useMemo)(()=>{m(0,Math.min(p,e))},n);const f=d.current.map((e,t)=>ae(e,b[t])),h=Object(r.useContext)(fe),O=Object(o.D)(h),k=h!==O&&g(h);Object(o.A)(()=>{a.current++,u.ctrls=d.current;const{queue:e}=u;e.length&&(u.queue=[],Object(o.k)(e,e=>e())),Object(o.k)(d.current,(e,t)=>{null==i||i.add(e),k&&e.start({default:h});const n=b[t];n&&(j(e,n.ref),e.ref?e.queue.push(n):e.start(n))})}),Object(o.C)(()=>()=>{Object(o.k)(u.ctrls,e=>e.stop(!0))});const _=f.map(e=>l({},e));return i?[_,i]:_}function ke(e,t){const n=o.s.fun(e),[[r],c]=je(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[r,c]:r}let _e;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(_e||(_e={}));class ye extends V{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Object(o.f)(...t);const n=this._get(),r=Object(c.f)(n);Object(c.h)(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Object(o.u)(t,n)||(Object(c.e)(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ce(this._active)&&Se(this)}_get(){const e=o.s.arr(this.source)?this.source.map(o.q):Object(o.y)(Object(o.q)(this.source));return this.calc(...e)}_start(){this.idle&&!Ce(this._active)&&(this.idle=!1,Object(o.k)(Object(c.g)(this),e=>{e.done=!1}),o.b.skipAnimation?(o.w.batchedUpdates(()=>this.advance()),Se(this)):o.o.start(this))}_attach(){let e=1;Object(o.k)(Object(o.y)(this.source),t=>{Object(o.r)(t)&&Object(o.c)(t,this),z(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Object(o.k)(Object(o.y)(this.source),e=>{Object(o.r)(e)&&Object(o.x)(e,this)}),this._active.clear(),Se(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=Object(o.y)(this.source).reduce((e,t)=>Math.max(e,(z(t)?t.priority:0)+1),0))}}function Ee(e){return!1!==e.idle}function Ce(e){return!e.size||Array.from(e).every(Ee)}function Se(e){e.idle||(e.idle=!0,Object(o.k)(Object(c.g)(e),e=>{e.done=!0}),Object(o.d)(e,{type:"idle",parent:e}))}o.b.assign({createStringInterpolator:o.g,to:(e,t)=>new ye(e,t)});o.o.advance},l3Sj:function(e,t){e.exports=window.wp.i18n},lJLt:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var o=n("l3Sj");const r={insertUsage:{}},c={alignWide:!1,supportsLayout:!0,colors:[{name:Object(o.__)("Black"),slug:"black",color:"#000000"},{name:Object(o.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:Object(o.__)("White"),slug:"white",color:"#ffffff"},{name:Object(o.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:Object(o.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:Object(o.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:Object(o.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:Object(o.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:Object(o.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:Object(o.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:Object(o.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:Object(o.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:Object(o._x)("Small","font size name"),size:13,slug:"small"},{name:Object(o._x)("Normal","font size name"),size:16,slug:"normal"},{name:Object(o._x)("Medium","font size name"),size:20,slug:"medium"},{name:Object(o._x)("Large","font size name"),size:36,slug:"large"},{name:Object(o._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:Object(o.__)("Thumbnail")},{slug:"medium",name:Object(o.__)("Medium")},{slug:"large",name:Object(o.__)("Large")},{slug:"full",name:Object(o.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__unstableGalleryWithImageBlocks:!1,gradients:[{name:Object(o.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:Object(o.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:Object(o.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:Object(o.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:Object(o.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:Object(o.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:Object(o.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:Object(o.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:Object(o.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:Object(o.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:Object(o.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:Object(o.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}]}},mdLt:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e");t.a=function(e){let{title:t,icon:n,children:c}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"block-editor-inserter__panel-header"},Object(o.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),Object(o.createElement)(r.Icon,{icon:n})),Object(o.createElement)("div",{className:"block-editor-inserter__panel-content"},c))}},mlss:function(e,t,n){"use strict";var o=n("tI+e");const{Fill:r,Slot:c}=Object(o.createSlotFill)("__unstableInserterMenuExtension");r.Slot=c,t.a=r},nEW0:function(e,t,n){"use strict";n.d(t,"w",(function(){return r})),n.d(t,"a",(function(){return ve})),n.d(t,"b",(function(){return A})),n.d(t,"c",(function(){return ke})),n.d(t,"d",(function(){return Oe})),n.d(t,"e",(function(){return K})),n.d(t,"f",(function(){return de})),n.d(t,"g",(function(){return Re})),n.d(t,"h",(function(){return y})),n.d(t,"i",(function(){return Fe})),n.d(t,"j",(function(){return Ae})),n.d(t,"k",(function(){return S})),n.d(t,"l",(function(){return w})),n.d(t,"m",(function(){return x})),n.d(t,"n",(function(){return B})),n.d(t,"o",(function(){return V})),n.d(t,"p",(function(){return ge})),n.d(t,"q",(function(){return he})),n.d(t,"r",(function(){return fe})),n.d(t,"s",(function(){return E})),n.d(t,"t",(function(){return ze})),n.d(t,"u",(function(){return C})),n.d(t,"v",(function(){return _})),n.d(t,"x",(function(){return _e})),n.d(t,"y",(function(){return I})),n.d(t,"z",(function(){return Ge})),n.d(t,"A",(function(){return Ke})),n.d(t,"B",(function(){return We})),n.d(t,"C",(function(){return He})),n.d(t,"D",(function(){return qe}));let o=v();const r=e=>f(e,o);let c=v();r.write=e=>f(e,c);let l=v();r.onStart=e=>f(e,l);let i=v();r.onFrame=e=>f(e,i);let a=v();r.onFinish=e=>f(e,a);let s=[];r.setTimeout=(e,t)=>{let n=r.now()+t,o=()=>{let e=s.findIndex(e=>e.cancel==o);~e&&s.splice(e,1),p-=~e?1:0},c={time:n,handler:e,cancel:o};return s.splice(u(n),0,c),p+=1,h(),c};let u=e=>~(~s.findIndex(t=>t.time>e)||~s.length);r.cancel=e=>{l.delete(e),i.delete(e),o.delete(e),c.delete(e),a.delete(e)},r.sync=e=>{m=!0,r.batchedUpdates(e),m=!1},r.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,r.onStart(n)}return o.handler=e,o.cancel=()=>{l.delete(n),t=null},o};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};r.use=e=>d=e,r.now="undefined"!=typeof performance?()=>performance.now():Date.now,r.batchedUpdates=e=>e(),r.catch=console.error,r.frameLoop="always",r.advance=()=>{"demand"!==r.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):O()};let b=-1,p=0,m=!1;function f(e,t){m?(t.delete(e),e(0)):(t.add(e),h())}function h(){b<0&&(b=0,"demand"!==r.frameLoop&&d(g))}function g(){~b&&(d(g),r.batchedUpdates(O))}function O(){let e=b;b=r.now();let t=u(b);t&&(j(s.splice(0,t),e=>e.handler()),p-=t),l.flush(),o.flush(e?Math.min(64,b-e):16.667),i.flush(),c.flush(),a.flush(),p||(b=-1)}function v(){let e=new Set,t=e;return{add(n){p+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(p-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,p-=t.size,j(t,t=>t(n)&&e.add(t)),p+=e.size,t=e)}}}function j(e,t){e.forEach(e=>{try{t(e)}catch(e){r.catch(e)}})}var k=n("cDcd");function _(){}const y=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),E={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 C(e,t){if(E.arr(e)){if(!E.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function w(e,t,n){if(E.arr(e))for(let o=0;oE.und(e)?[]:E.arr(e)?e:[e];function x(e,t){if(e.size){const n=Array.from(e);e.clear(),S(n,t)}}const B=(e,...t)=>x(e,e=>e(...t)),T=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let P,R,N=null,M=!1,L=_;var A=Object.freeze({__proto__:null,get createStringInterpolator(){return P},get to(){return R},get colors(){return N},get skipAnimation(){return M},get willAdvance(){return L},assign:e=>{e.to&&(R=e.to),e.now&&(r.now=e.now),void 0!==e.colors&&(N=e.colors),null!=e.skipAnimation&&(M=e.skipAnimation),e.createStringInterpolator&&(P=e.createStringInterpolator),e.requestAnimationFrame&&r.use(e.requestAnimationFrame),e.batchedUpdates&&(r.batchedUpdates=e.batchedUpdates),e.willAdvance&&(L=e.willAdvance),e.frameLoop&&(r.frameLoop=e.frameLoop)}});const D=new Set;let F=[],z=[],H=0;const V={get idle(){return!D.size&&!F.length},start(e){H>e.priority?(D.add(e),r.onStart(G)):(U(e),r(q))},advance:q,sort(e){if(H)r.onFrame(()=>V.sort(e));else{const t=F.indexOf(e);~t&&(F.splice(t,1),W(e))}},clear(){F=[],D.clear()}};function G(){D.forEach(U),D.clear(),r(q)}function U(e){F.includes(e)||W(e)}function W(e){F.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(F,t=>t.priority>e.priority),0,e)}function q(e){const t=z;for(let n=0;n0}const K={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},Y="[-+]?\\d*\\.?\\d+";function $(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Z=new RegExp("rgb"+$(Y,Y,Y)),X=new RegExp("rgba"+$(Y,Y,Y,Y)),Q=new RegExp("hsl"+$(Y,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),J=new RegExp("hsla"+$(Y,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Y)),ee=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,te=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ne=/^#([0-9a-fA-F]{6})$/,oe=/^#([0-9a-fA-F]{8})$/;function re(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 ce(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,c=re(r,o,e+1/3),l=re(r,o,e),i=re(r,o,e-1/3);return Math.round(255*c)<<24|Math.round(255*l)<<16|Math.round(255*i)<<8}function le(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ie(e){return(parseFloat(e)%360+360)%360/360}function ae(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function se(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function ue(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ne.exec(e))?parseInt(t[1]+"ff",16)>>>0:N&&void 0!==N[e]?N[e]:(t=Z.exec(e))?(le(t[1])<<24|le(t[2])<<16|le(t[3])<<8|255)>>>0:(t=X.exec(e))?(le(t[1])<<24|le(t[2])<<16|le(t[3])<<8|ae(t[4]))>>>0:(t=ee.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=oe.exec(e))?parseInt(t[1],16)>>>0:(t=te.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Q.exec(e))?(255|ce(ie(t[1]),se(t[2]),se(t[3])))>>>0:(t=J.exec(e))?(ce(ie(t[1]),se(t[2]),se(t[3]))|ae(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})`)}const de=(e,t,n)=>{if(E.fun(e))return e;if(E.arr(e))return de({range:e,output:t,extrapolate:n});if(E.str(e.output[0]))return P(e);const o=e,r=o.output,c=o.range||[0,1],l=o.extrapolateLeft||o.extrapolate||"extend",i=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,c);return function(e,t,n,o,r,c,l,i,a){let s=a?a(e):e;if(sn){if("identity"===i)return s;"clamp"===i&&(s=n)}if(o===r)return o;if(t===n)return e<=t?o:r;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=c(s),o===-1/0?s=-s:r===1/0?s+=o:s=s*(r-o)+o;return s}(e,c[t],c[t+1],r[t],r[t+1],a,l,i,o.map)}};function be(){return(be=Object.assign||function(e){for(var t=1;tBoolean(e&&e[pe]),he=e=>e&&e[pe]?e[pe]():e,ge=e=>e[me]||null;function Oe(e,t){let n=e[me];n&&n.forEach(e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)})}class ve{constructor(e){if(this[pe]=void 0,this[me]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");je(this,e)}}const je=(e,t)=>ye(e,pe,t);function ke(e,t){if(e[pe]){let n=e[me];n||ye(e,me,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function _e(e,t){let n=e[me];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[me]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ye=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ee=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ce=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Se=new RegExp(`(${Ee.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ie=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,xe=e=>{const[t,n]=Be(e);if(!t||T())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){const t=window.getComputedStyle(document.documentElement).getPropertyValue(n);return t||e}return n&&Ie.test(n)?xe(n):n||e},Be=e=>{const t=Ie.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Te;const Pe=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Re=e=>{Te||(Te=N?new RegExp(`(${Object.keys(N).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(e=>he(e).replace(Ie,xe).replace(Ce,ue).replace(Te,ue)),n=t.map(e=>e.match(Ee).map(Number)),o=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=>de(be({},e,{output:t})));return e=>{var n;const r=!Se.test(t[0])&&(null==(n=t.find(e=>Se.test(e)))?void 0:n.replace(Ee,""));let c=0;return t[0].replace(Ee,()=>`${o[c++](e)}${r||""}`).replace(we,Pe)}},Ne="react-spring: ",Me=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(Ne+"once requires a function parameter");return(...e)=>{n||(t(...e),n=!0)}},Le=Me(console.warn);function Ae(){Le(Ne+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const De=Me(console.warn);function Fe(){De(Ne+'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions')}function ze(e){return E.str(e)&&("#"==e[0]||/\d/.test(e)||!T()&&Ie.test(e)||e in(N||{}))}const He=e=>Object(k.useEffect)(e,Ve),Ve=[];function Ge(){const e=Object(k.useState)()[1],t=Object(k.useState)(Ue)[0];return He(t.unmount),()=>{t.current&&e({})}}function Ue(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function We(e,t){const[n]=Object(k.useState)(()=>({inputs:t,result:e()})),o=Object(k.useRef)(),r=o.current;let c=r;if(c){Boolean(t&&c.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=c,r==n&&(n.inputs=n.result=void 0)},[c]),c.result}function qe(e){const t=Object(k.useRef)();return Object(k.useEffect)(()=>{t.current=e}),t.current}const Ke="undefined"!=typeof window&&window.document&&window.document.createElement?k.useLayoutEffect:k.useEffect},nQUx:function(e,t,n){"use strict";var o=n("YLtl"),r=n("GRId"),c=n("HSyU"),l=n("1ZqX"),i=n("l3Sj"),a=n("onLe"),s=n("BhPs");t.a=(e,t)=>{const{patternCategories:n,patterns:u}=Object(l.useSelect)(e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(s.a);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}},[t]),{createSuccessNotice:d}=Object(l.useDispatch)(a.store);return[u,n,Object(r.useCallback)((t,n)=>{e(Object(o.map)(n,e=>Object(c.cloneBlock)(e)),t.name),d(Object(i.sprintf)(Object(i.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})},[])]}},nlh6:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return w}));var o=n("TSYQ"),r=n.n(o),c=n("GRId"),l=n("l3Sj"),i=n("HSyU"),a=n("K9lf"),s=n("1ZqX"),u=(n("Z23Y"),n("Xkls")),d=n("jBNB"),b=n("z+q2"),p=n("kBLm"),m=n("ur0x"),f=n("Q2Xw"),h=n("YZt4"),g=n("ERVc"),O=n("+6d5"),v=n("6jxZ"),j=n("felP"),k=n("JDWi"),_=n("G4zt"),y=n("PKbb"),E=n("hw9B"),C=n("rHRV"),S=n("BhPs");function w(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:w,wrapperProps:I={},isAligned:x}=Object(c.useContext)(d.a),{index:B,mode:T,name:P,blockApiVersion:R,blockTitle:N,isPartOfSelection:M,adjustScrolling:L,enableAnimation:A}=Object(s.useSelect)(e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:r,isTyping:c,getGlobalBlockCount:l,isBlockSelected:a,isBlockMultiSelected:s,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(S.a),b=a(o),p=s(o)||u(o),m=r(o),f=Object(i.getBlockType)(m);return{index:t(o),mode:n(o),name:m,blockApiVersion:(null==f?void 0:f.apiVersion)||1,blockTitle:null==f?void 0:f.title,isPartOfSelection:b||p,adjustScrolling:b||d(o),enableAnimation:!c()&&l()<=200}},[o]),D=Object(l.sprintf)(Object(l.__)("Block: %s"),N),F="html"!==T||n?"":"-visual",z=Object(a.useMergeRefs)([t.ref,Object(b.a)(o),Object(_.a)(o),Object(y.c)(o),Object(v.a)(o),Object(E.a)(o),Object(j.a)(o),Object(k.a)(o),Object(p.a)(),Object(C.a)(),Object(u.a)({isSelected:M,adjustScrolling:L,enableAnimation:A,triggerAnimationOnChange:B})]),H=Object(m.c)();return R<2&&o===H.clientId&&void 0!==e&&e.env,{...I,...t,ref:z,id:`block-${o}${F}`,tabIndex:0,role:"document","aria-label":D,"data-block":o,"data-type":P,"data-title":N,className:r()(r()("block-editor-block-list__block",{"wp-block":!x}),w,t.className,I.className,Object(f.a)(o),Object(h.a)(o),Object(g.a)(o),Object(O.a)(o)),style:{...I.style,...t.style}}}w.save=i.__unstableGetBlockProps}).call(this,n("8oxB"))},o97j:function(e,t,n){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=r},onLe:function(e,t){e.exports=window.wp.notices},p3NJ:function(e,t,n){"use strict";n.d(t,"b",(function(){return R}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("K9lf"),a=n("1ZqX"),s=n("HSyU"),u=n("I5Hl"),d=n("ur0x");var b=Object(i.createHigherOrderComponent)(e=>t=>{const{clientId:n}=Object(d.c)();return Object(r.createElement)(e,Object(o.a)({},t,{clientId:n}))},"withClientId");var p=b(e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:c,isToggle:i}=e;return Object(r.createElement)(u.b,{className:l()({"block-list-appender__toggle":i}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:c})}),m=n("YLtl"),f=n("5L8O"),h=n("BhPs");var g=Object(i.compose)([b,Object(a.withSelect)((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(h.a),r=o(n);return{lastBlockClientId:Object(m.last)(r)}})])(e=>{let{clientId:t,lastBlockClientId:n}=e;return Object(r.createElement)(f.a,{rootClientId:t,lastBlockClientId:n})}),O=n("rl8x"),v=n.n(O),j=n("PPMp");const k=new WeakMap;var _=n("VyCT"),y=n("uoCR"),E=n("JGYp"),C=n("l3Sj"),S=n("/lNF"),w=n("vIlp");function I(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=Object(C.isRTL)();let c,l;return e.forEach((e,n)=>{const i=e.getBoundingClientRect(),[a,s]=Object(w.a)(t,i,o);if(void 0===l||a0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=Object(r.useState)(null),o=Object(a.useSelect)(t=>{const{getTemplateLock:n}=t(h.a);return"all"===n(e)},[e]),{getBlockListSettings:c}=Object(a.useSelect)(h.a),{showInsertionPoint:l,hideInsertionPoint:s}=Object(a.useDispatch)(h.a),u=Object(S.a)(e,t),d=Object(i.useThrottle)(Object(r.useCallback)((t,o)=>{var r;const i=I(Array.from(o.children).filter(e=>e.classList.contains("wp-block")),{x:t.clientX,y:t.clientY},null===(r=c(e))||void 0===r?void 0:r.orientation);n(void 0===i?0:i),null!==i&&l(e,i)},[]),200);return Object(i.__experimentalUseDropZone)({isDisabled:o,onDrop:u,onDragOver(e){d(e,e.currentTarget)},onDragLeave(){d.cancel(),s(),n(null)},onDragEnd(){d.cancel(),s(),n(null)}})}function B(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:c,template:l,templateLock:i,wrapperRef:u,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:b,__experimentalAppenderTagName:p,renderAppender:f,orientation:g,placeholder:O,__experimentalLayout:E}=e;!function(e,t,n,o,c,l,i,s){const{updateBlockListSettings:u}=Object(a.useDispatch)(h.a),{blockListSettings:d,parentLock:b}=Object(a.useSelect)(t=>{const n=t(h.a).getBlockRootClientId(e);return{blockListSettings:t(h.a).getBlockListSettings(e),parentLock:t(h.a).getTemplateLock(n)}},[e]),p=Object(r.useMemo)(()=>t,t);Object(r.useLayoutEffect)(()=>{const t={allowedBlocks:p,templateLock:void 0===c?b:c};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Object(j.a)(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),v()(d,t)||u(e,t)},[e,d,p,n,o,c,b,l,i,u,s])}(t,n,o,c,i,b,g,E),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:c}=Object(a.useSelect)(h.a),{replaceInnerBlocks:l}=Object(a.useDispatch)(h.a),i=Object(a.useSelect)(t=>t(h.a).getBlocks(e),[e]),u=Object(r.useRef)(null);Object(r.useLayoutEffect)(()=>{if(0===i.length||"all"===n){if(!Object(m.isEqual)(t,u.current)){u.current=t;const n=Object(s.synchronizeBlocksWithTemplate)(i,t);Object(m.isEqual)(n,i)||l(e,n,0===i.length&&o&&0!==n.length,c())}}},[i,t,n,e])}(t,l,i,d);const C=Object(a.useSelect)(e=>{const n=e(h.a).getBlock(t),o=Object(s.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){k.has(t)||k.set(t,new WeakMap);const n=k.get(t);if(!n.has(e)){const o=Object(m.mapValues)(t.providesContext,t=>e[t]);n.set(e,o)}return n.get(e)}(n.attributes,o)},[t]);return Object(r.createElement)(y.a,{value:C},Object(r.createElement)(_.a,{rootClientId:t,renderAppender:f,__experimentalAppenderTagName:p,__experimentalLayout:E,wrapperRef:u,placeholder:O}))}function T(e){return Object(E.a)(e),Object(r.createElement)(B,e)}const P=Object(r.forwardRef)((e,t)=>{const n=R({ref:t},e);return Object(r.createElement)("div",{className:"block-editor-inner-blocks"},Object(r.createElement)("div",n))});function R(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Object(d.c)(),c=Object(i.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:u,hasOverlay:b}=Object(a.useSelect)(e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:o,hasSelectedInnerBlock:r,isNavigationMode:l}=e(h.a),i=t(n),a=l()||c;return{__experimentalCaptureToolbars:e(s.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!o(n)&&!r(n,!0)&&a}},[n,c]),p=Object(i.useMergeRefs)([e.ref,x({rootClientId:n})]),m={__experimentalCaptureToolbars:u,...t},f=m.value&&m.onChange?T:B;return{...e,ref:p,className:l()(e.className,"block-editor-block-list__layout",{"has-overlay":b}),children:n?Object(r.createElement)(f,Object(o.a)({},m,{clientId:n})):Object(r.createElement)(_.a,t)}}R.save=s.__unstableGetInnerBlocksProps,P.DefaultBlockAppender=g,P.ButtonBlockAppender=p,P.Content=()=>R.save().children;t.a=P},pOGT:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var o=n("YLtl");const r=e=>e.name||"",c=e=>e.title,l=e=>e.description||"",i=e=>e.keywords||[],a=e=>e.category,s=()=>null;function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Object(o.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(o.words)(u(e))},b=(e,t)=>Object(o.differenceWith)(e,d(t),(e,t)=>t.includes(e)),p=(e,t,n,r)=>{if(0===d(r).length)return e;return m(e,r,{getCategory:e=>{var n;return null===(n=Object(o.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}})},m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=d(t);if(0===o.length)return e;const r=e.map(e=>[e,f(e,t,n)]).filter(e=>{let[,t]=e;return t>0});return r.sort((e,t)=>{let[,n]=e,[,o]=t;return o-n}),r.map(e=>{let[t]=e;return t})};function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:d=r,getTitle:p=c,getDescription:m=l,getKeywords:f=i,getCategory:h=a,getCollection:g=s}=n,O=d(e),v=p(e),j=m(e),k=f(e),_=h(e),y=g(e),E=u(t),C=u(v);let S=0;if(E===C)S+=30;else if(C.startsWith(E))S+=20;else{const e=[O,v,j,...k,_,y].join(" "),t=Object(o.words)(E);0===b(t,e).length&&(S+=10)}return 0!==S&&O.startsWith("core/")&&S++,S}},pPDe:function(e,t,n){"use strict";var o,r;function c(e){return[e]}function l(){var e={clear:function(){e.head=null}};return e}function i(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o{})}=e;const{replaceBlocks:p}=Object(i.useDispatch)(s.a);return n||o?Object(r.createElement)(r.Fragment,null,n&&Object(r.createElement)(l.MenuItem,{onClick:()=>{(()=>{const e=Object(a.switchToBlockType)(c,d);e&&p(t,e)})(),b()}},Object(u._x)("Group","verb")),o&&Object(r.createElement)(l.MenuItem,{onClick:()=>{(()=>{const e=c[0].innerBlocks;e.length&&p(t,e)})(),b()}},Object(u._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}const{Fill:b,Slot:p}=Object(l.createSlotFill)("BlockSettingsMenuControls");function m(e){let{...t}=e;return Object(r.createElement)(l.__experimentalStyleProvider,{document:document},Object(r.createElement)(b,t))}m.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:u,selectedClientIds:b}=Object(i.useSelect)(e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o}=e(s.a),r=null!==n?n:o();return{selectedBlocks:Object(c.map)(Object(c.compact)(t(r)),e=>e.name),selectedClientIds:r}},[n]),m=function(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=Object(i.useSelect)(e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:c}=e(s.a),{getGroupingBlockName:l}=e(a.store),i=c(),u=l(),d=r(u,null!=i&&i.length?n(i[0]):void 0),b=o(i),p=1===b.length&&(null===(t=b[0])||void 0===t?void 0:t.name)===u;return{clientIds:i,isGroupable:d&&b.length&&!p,isUngroupable:p&&!!b[0].innerBlocks.length,blocksSelection:b,groupingBlockName:u}},[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}(),{isGroupable:f,isUngroupable:h}=m,g=f||h;return Object(r.createElement)(p,{fillProps:{...t,selectedBlocks:u,selectedClientIds:b}},e=>{if((null==e?void 0:e.length)>0||g)return Object(r.createElement)(l.MenuGroup,null,e,Object(r.createElement)(d,Object(o.a)({},m,{onClose:null==t?void 0:t.onClose})))})};t.a=m},pY5h:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("v5LD");function r(){return{disableCustomColors:!Object(o.a)("color.custom"),disableCustomGradients:!Object(o.a)("color.customGradient")}}},plpT:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));t.a=c},q3tz:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("GRId"),r=n("l3Sj"),c=n("tI+e"),l=n("xN+R"),i=n("7SSY");function a(e){let{count:t,icon:n}=e;return Object(o.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},Object(o.createElement)("div",{className:"block-editor-block-draggable-chip"},Object(o.createElement)(c.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},Object(o.createElement)(c.FlexItem,null,n?Object(o.createElement)(i.a,{icon:n}):Object(r.sprintf)(Object(r._n)("%d block","%d blocks",t),t)),Object(o.createElement)(c.FlexItem,null,Object(o.createElement)(i.a,{icon:l.a})))))}},qRz9:function(e,t){e.exports=window.wp.richText},qrxh:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("TSYQ"),i=n.n(l),a=n("gdqT"),s=n("l3Sj"),u=n("tI+e"),d=n("1ZqX"),b=n("K9lf"),p=n("HSyU"),m=n("Q4Sy"),f=n("xZzQ"),h=n("Wg7J"),g=n("AORF"),O=n("nQUx"),v=n("+G0a"),j=n("BhPs");function k(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:c}=e;const[l,a]=Object(r.useState)(""),[b,p]=Object(g.a)({onSelect:t,rootClientId:n,clientId:o,isAppender:c}),[m]=Object(v.a)(b,p),[f]=Object(O.a)(p,b),k=f.length&&!!l,_=k&&f.length>6||m.length>6,{setInserterIsOpened:y,insertionIndex:E}=Object(d.useSelect)(e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(j.a),c=n(o);return{setInserterIsOpened:t().__experimentalSetIsInserterOpened,insertionIndex:-1===c?r():c}},[o,n]);Object(r.useEffect)(()=>{y&&y(!1)},[y]);return Object(r.createElement)("div",{className:i()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":y})},_&&Object(r.createElement)(u.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{a(e)},label:Object(s.__)("Search for blocks and patterns"),placeholder:Object(s.__)("Search")}),Object(r.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},Object(r.createElement)(h.a,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:c,maxBlockPatterns:k?2:0,maxBlockTypes:6,isDraggable:!1})),y&&Object(r.createElement)(u.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{y({rootClientId:n,insertionIndex:E,filterValue:l})},"aria-label":Object(s.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},Object(s.__)("Browse all")))}const _=e=>{let t,{onToggle:n,disabled:c,isOpen:l,blockTitle:i,hasSingleBlockType:a,toggleProps:d={}}=e;t=a?Object(s.sprintf)(Object(s._x)("Add %s","directly add the only allowed block"),i):Object(s._x)("Add block","Generic label for block inserter button");const{onClick:b,...p}=d;return Object(r.createElement)(u.Button,Object(o.a)({icon:m.a,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),b&&b(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&l,disabled:c},p))};class y extends r.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:c,directInsertBlock:l,toggleProps:i,hasItems:a,renderToggle:s=_}=this.props;return s({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:c,directInsertBlock:l,toggleProps:i})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:c,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?Object(r.createElement)(k,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:c}):Object(r.createElement)(f.a,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:c,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:c,onSelectOrClose:l}=this.props;return t||null!=n&&n.length?this.renderToggle({onToggle:o}):Object(r.createElement)(u.Dropdown,{className:"block-editor-inserter",contentClassName:i()("block-editor-inserter__popover",{"is-quick":c}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:Object(s.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}t.a=Object(b.compose)([Object(d.withSelect)((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:r,hasInserterItems:l,__experimentalGetAllowedBlocks:i,__experimentalGetDirectInsertBlock:a}=e(j.a),{getBlockVariations:s}=e(p.store);o=o||r(n)||void 0;const u=i(o),d=a(o),b=1===Object(c.size)(u)&&0===Object(c.size)(s(u[0].name,"inserter"));let m=!1;return b&&(m=u[0]),{hasItems:l(o),hasSingleBlockType:b,blockTitle:m?m.title:"",allowedBlockType:m,directInsertBlock:d,rootClientId:o}}),Object(d.withDispatch)((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:c,hasSingleBlockType:l,allowedBlockType:i,directInsertBlock:u,onSelectOrClose:d}=t;if(!(l||null!=u&&u.length))return;const{insertBlock:b}=e(j.a);b(null!=u&&u.length?Object(p.createBlock)(...u):Object(p.createBlock)(i.name),function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:i}=o(j.a);if(r)return e(r);const a=t();return!c&&a&&i(a)===n?e(a)+1:l(n).length}(),n),d&&d();const m=Object(s.sprintf)(Object(s.__)("%s block added"),i.title);Object(a.speak)(m)}}}),Object(b.ifCondition)(e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r})])(y)},rH4q:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));t.a=c},rHRV:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("K9lf"),r=n("GRId"),c=n("VyCT");function l(){const e=Object(r.useContext)(c.b);return Object(o.useRefEffect)(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}},rl8x:function(e,t){e.exports=window.wp.isShallowEqual},rmEH:function(e,t){e.exports=window.wp.htmlEntities},smQA:function(e,t,n){"use strict";function o(){}function r(e,t,n,o,r){for(var c=0,l=t.length,i=0,a=0;ce.length?n:e})),s.value=e.join(d)}else s.value=e.join(n.slice(i,i+s.count));i+=s.count,s.added||(a+=s.count)}}var b=t[l-1];return l>1&&"string"==typeof b.value&&(b.added||b.removed)&&e.equals("",b.value)&&(t[l-2].value+=b.value,t.pop()),t}function c(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,o.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var l=this;function i(e){return o?(setTimeout((function(){o(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,s=e.length,u=1,d=a+s,b=[{newPos:-1,components:[]}],p=this.extractCommon(b[0],t,e,0);if(b[0].newPos+1>=a&&p+1>=s)return i([{value:this.join(t),count:t.length}]);function m(){for(var n=-1*u;n<=u;n+=2){var o=void 0,d=b[n-1],p=b[n+1],m=(p?p.newPos:0)-n;d&&(b[n-1]=void 0);var f=d&&d.newPos+1=a&&m+1>=s)return i(r(l,o.components,t,e,l.useLongestToken));b[n]=o}else b[n]=void 0}u++}if(o)!function e(){setTimeout((function(){if(u>d)return o();m()||e()}),0)}();else for(;u<=d;){var f=m();if(f)return f}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,c=n.length,l=e.newPos,i=l-o,a=0;l+11&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?m.filter(t=>e.includes(t)):!0===e?[...m]:[],!o||!0===e&&!n?Object(s.without)(t,...f):t}const g=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n}=t,r=h(Object(o.getBlockSupport)(n,"align"),Object(o.hasBlockSupport)(n,"alignWide",!0)),c=Object(p.a)(r).map(e=>{let{name:t}=e;return t});return Object(l.createElement)(l.Fragment,null,!!c.length&&Object(l.createElement)(d.b,{group:"block",__experimentalShareWithChildBlocks:!0},Object(l.createElement)(b.a,{value:t.attributes.align,onChange:e=>{if(!e){var n,r;const c=Object(o.getBlockType)(t.name);(null==c||null===(n=c.attributes)||void 0===n||null===(r=n.align)||void 0===r?void 0:r.default)&&(e="")}t.setAttributes({align:e})},controls:c})),Object(l.createElement)(e,t))},"withToolbarControls"),O=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n,attributes:r}=t,{align:i}=r,a=h(Object(o.getBlockSupport)(n,"align"),Object(o.hasBlockSupport)(n,"alignWide",!0)),s=Object(p.a)(a);if(void 0===i)return Object(l.createElement)(e,t);let u=t.wrapperProps;return s.some(e=>e.name===i)&&(u={...u,"data-align":i}),Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:u}))});Object(r.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return Object(s.has)(e.attributes,["align","type"])||Object(o.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...m,""]}}),e})),Object(r.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",O),Object(r.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",g),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:r}=n;return h(Object(o.getBlockSupport)(t,"align"),Object(o.hasBlockSupport)(t,"alignWide",!0)).includes(r)&&(e.className=a()("align"+r,e.className)),e})),Object(r.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return Object(s.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var v=n("tI+e"),j=n("l3Sj"),k=n("1oY3");const _=/[\s#]/g;const y=Object(u.createHigherOrderComponent)(e=>t=>{if(Object(o.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===l.Platform.OS,o=Object(l.createElement)(v.TextControl,{className:"html-anchor-control",label:Object(j.__)("HTML anchor"),help:Object(l.createElement)(l.Fragment,null,Object(j.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&Object(l.createElement)(v.ExternalLink,{href:Object(j.__)("https://wordpress.org/support/article/page-jumps/")},Object(j.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:Object(j.__)("Add an anchor"),onChange:e=>{e=e.replace(_,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),n&&Object(l.createElement)(k.b,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{title:Object(j.__)("Heading settings")},o)))}return Object(l.createElement)(e,t)},"withInspectorControl");Object(r.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return Object(s.has)(e.attributes,["anchor","type"])||Object(o.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),Object(r.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",y),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return Object(o.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const E=Object(u.createHigherOrderComponent)(e=>t=>Object(o.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),Object(l.createElement)(k.b,{__experimentalGroup:"advanced"},Object(l.createElement)(v.TextControl,{autoComplete:"off",label:Object(j.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:Object(j.__)("Separate multiple classes with spaces.")}))):Object(l.createElement)(e,t),"withInspectorControl");Object(r.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return Object(o.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),Object(r.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",E),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return Object(o.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=a()(e.className,n.className)),e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Object(o.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=Object(s.uniq)([Object(o.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=Object(o.getBlockDefaultClassName)(t.name)),e}));var C=n("VyCT"),S=n("v5LD"),w=n("dchM"),I=n("0LBR"),x=n("bVpQ"),B=n("715p");const T=[];function P(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Object(I.a)(),i=r.colors.reduce((e,t)=>e.concat(t.colors),[]),[a,s]=Object(l.useState)(()=>{var e,o;return null===(e=Object(x.b)(i,t,null==n||null===(o=n.border)||void 0===o?void 0:o.color))||void 0===e?void 0:e.color}),u=[{label:Object(j.__)("Color"),onColorChange:e=>{s(e);const t=Object(x.c)(i,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},c=null!=t&&t.slug?t.slug:void 0;o({style:Object(B.a)(r),borderColor:c})},colorValue:a,clearable:!1}];return Object(l.createElement)(w.a,Object(c.a)({settings:u,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function R(e,t,n){var o;if(!H(t,"color")||V(t))return e;const{borderColor:r,style:c}=n,l=Object(x.a)("border-color",r),i=a()(e.className,{"has-border-color":r||(null==c||null===(o=c.border)||void 0===o?void 0:o.color),[l]:!!l});return e.className=i||void 0,e}const N=Object(u.createHigherOrderComponent)(e=>t=>{var n,o;const{name:r,attributes:i}=t,{borderColor:a}=i,s=Object(S.a)("color.palette")||T;if(!H(r,"color")||V(r))return Object(l.createElement)(e,t);const u={borderColor:a?null===(n=Object(x.b)(s,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:d}))});Object(r.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return H(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",R),Object(r.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!H(e,"color")||V(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),R(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",N);var M=n("Wy3j");function L(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(M.a,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Object(B.a)(t)),o({style:t})}})}var A=n("2YCo");const D=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(A.a,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:Object(B.a)(t)})}})},F=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:c,style:i}=(null==n?void 0:n.border)||{},[a,s]=Object(l.useState)(),[u,d]=Object(l.useState)();Object(l.useEffect)(()=>{"none"!==i&&s(i)},[i]),Object(l.useEffect)(()=>{(t||c)&&d({name:t||void 0,color:c||void 0})},[t,c]);const b=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["px","em","rem"]});return Object(l.createElement)(v.__experimentalUnitControl,{value:r,label:Object(j.__)("Width"),min:0,onChange:e=>{let r={...n,border:{...null==n?void 0:n.border,width:e}},c=t;const l=0===parseFloat(e);l&&(c=void 0,r.border.color=void 0,r.border.style="none"),l||"none"!==i||(r.border.style=a),l||void 0!==t||(c=null==u?void 0:u.name,r.border.color=null==u?void 0:u.color),void 0!==e&&""!==e||(r=Object(B.a)(r)),o({borderColor:c,style:r})},units:b})};function z(e){const t=G(e),n=H(e.name),o=Object(S.a)("border.color")&&H(e.name,"color"),r=Object(S.a)("border.radius")&&H(e.name,"radius"),c=Object(S.a)("border.style")&&H(e.name,"style"),i=Object(S.a)("border.width")&&H(e.name,"width");return t||!n?null:Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{className:"block-editor-hooks__border-controls",title:Object(j.__)("Border"),initialOpen:!1},(i||c)&&Object(l.createElement)("div",{className:"block-editor-hooks__border-controls-row"},i&&Object(l.createElement)(F,e),c&&Object(l.createElement)(D,e)),o&&Object(l.createElement)(P,e),r&&Object(l.createElement)(L,e)))}function H(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==l.Platform.OS)return!1;const n=Object(o.getBlockSupport)(e,"__experimentalBorder");return!0===n||("any"===t?!!(null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style):!(null==n||!n[t]))}function V(e){const t=Object(o.getBlockSupport)(e,"__experimentalBorder");return null==t?void 0:t.__experimentalSkipSerialization}const G=()=>[!Object(S.a)("border.color"),!Object(S.a)("border.radius"),!Object(S.a)("border.style"),!Object(S.a)("border.width")].every(Boolean);var U=n("Cn0l"),W=n("yU1v"),q=n("6c9H"),K=n("PKbb");function Y(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function $(e){let{settings:t,clientId:n,enableContrastChecking:o=!0,showTitle:r=!0}=e;const[c,i]=Object(l.useState)(),[a,s]=Object(l.useState)(),u=Object(K.b)(n);return Object(l.useEffect)(()=>{if(!o)return;if(!u.current)return;s(Y(u.current).color);let e=u.current,t=Y(e).backgroundColor;for(;"rgba(0, 0, 0, 0)"===t&&e.parentNode&&e.parentNode.nodeType===e.parentNode.ELEMENT_NODE;)e=e.parentNode,t=Y(e).backgroundColor;i(t)}),Object(l.createElement)(k.b,null,Object(l.createElement)(W.a,{title:Object(j.__)("Color"),initialOpen:!1,settings:t,showTitle:r,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},o&&Object(l.createElement)(q.a,{backgroundColor:c,textColor:a})))}const Z=e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},X=e=>{const t=Object(o.getBlockSupport)(e,"color");return null==t?void 0:t.__experimentalSkipSerialization},Q=e=>{const t=Object(o.getBlockSupport)(e,"color");return Object(s.isObject)(t)&&!!t.gradients};function J(e,t,n){var o,r,c,l,i,s;if(!Z(t)||X(t))return e;const u=Q(t),{backgroundColor:d,textColor:b,gradient:p,style:m}=n,f=Object(x.a)("background-color",d),h=Object(U.a)(p),g=Object(x.a)("color",b),O=a()(e.className,g,h,{[f]:!(u&&null!=m&&null!==(o=m.color)&&void 0!==o&&o.gradient||!f),"has-text-color":b||(null==m||null===(r=m.color)||void 0===r?void 0:r.text),"has-background":d||(null==m||null===(c=m.color)||void 0===c?void 0:c.background)||u&&(p||(null==m||null===(l=m.color)||void 0===l?void 0:l.gradient)),"has-link-color":null==m||null===(i=m.elements)||void 0===i||null===(s=i.link)||void 0===s?void 0:s.color});return e.className=O||void 0,e}const ee=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Object(x.b)(e,n[1]).color:t};function te(e){var t,n,r,c,i,a,u,d,b;const{name:p,attributes:m}=e,f=Object(S.a)("color.palette.custom"),h=Object(S.a)("color.palette.theme"),g=Object(S.a)("color.palette.default"),O=Object(l.useMemo)(()=>[...f||[],...h||[],...g||[]],[f,h,g]),v=Object(S.a)("color.gradients.custom"),k=Object(S.a)("color.gradients.theme"),_=Object(S.a)("color.gradients.default"),y=Object(l.useMemo)(()=>[...v||[],...k||[],..._||[]],[v,k,_]),E=Object(S.a)("color.custom"),C=Object(S.a)("color.customGradient"),w=Object(S.a)("color.background"),I=Object(S.a)("color.link"),T=Object(S.a)("color.text"),P=E||!h||(null==h?void 0:h.length)>0,R=C||!k||(null==k?void 0:k.length)>0,N=Object(l.useRef)(m);if(Object(l.useEffect)(()=>{N.current=m},[m]),!Z(p))return null;const M=(e=>{if("web"!==l.Platform.OS)return!1;const t=Object(o.getBlockSupport)(e,"color");return Object(s.isObject)(t)&&!!t.link})(p)&&I&&P,L=(e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&!1!==t.text})(p)&&T&&P,A=(e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&!1!==t.background})(p)&&w&&P,D=Q(p)&&R;if(!(M||L||A||D))return null;const{style:F,textColor:z,backgroundColor:H,gradient:V}=m;let G;if(D&&V)G=Object(U.e)(y,V);else if(D){var W;G=null==F||null===(W=F.color)||void 0===W?void 0:W.gradient}const q=t=>n=>{var o,r;const c=Object(x.c)(O,n),l=t+"Color",i={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=c&&c.slug?void 0:n}},a=null!=c&&c.slug?c.slug:void 0,s={style:Object(B.a)(i),[l]:a};e.setAttributes(s),N.current={...N.current,...s}};return Object(l.createElement)($,{enableContrastChecking:!("web"!==l.Platform.OS||V||null!=F&&null!==(t=F.color)&&void 0!==t&&t.gradient),clientId:e.clientId,settings:[...L?[{label:Object(j.__)("Text"),onColorChange:q("text"),colorValue:Object(x.b)(O,z,null==F||null===(n=F.color)||void 0===n?void 0:n.text).color}]:[],...A||D?[{label:Object(j.__)("Background"),onColorChange:A?q("background"):void 0,colorValue:Object(x.b)(O,H,null==F||null===(r=F.color)||void 0===r?void 0:r.background).color,gradientValue:G,onGradientChange:D?t=>{const n=Object(U.d)(y,t);let o;if(n){var r,c,l;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(c=N.current)||void 0===c||null===(l=c.style)||void 0===l?void 0:l.color,gradient:void 0}};o={style:Object(B.a)(e),gradient:n}}else{var i,a,s;const e={...null===(i=N.current)||void 0===i?void 0:i.style,color:{...null===(a=N.current)||void 0===a||null===(s=a.style)||void 0===s?void 0:s.color,gradient:t}};o={style:Object(B.a)(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0}]:[],...M?[{label:Object(j.__)("Link"),onColorChange:t=>{const n=Object(x.c)(O,t),o=null!=n&&n.slug?"var:preset|color|"+n.slug:t,r=Object(B.a)(function(e,t,n){return Object(s.setWith)(e?Object(s.clone)(e):{},t,n,s.clone)}(F,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:ee(O,null==F||null===(c=F.elements)||void 0===c||null===(i=c.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==F||null===(u=F.elements)||void 0===u||null===(d=u.link)||void 0===d||null===(b=d.color)||void 0===b||!b.text)}]:[]]})}const ne=Object(u.createHigherOrderComponent)(e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:i,textColor:a}=r,s=Object(S.a)("color.palette.custom")||[],u=Object(S.a)("color.palette.theme")||[],d=Object(S.a)("color.palette.default")||[],b=Object(l.useMemo)(()=>[...s||[],...u||[],...d||[]],[s,u,d]);if(!Z(o)||X(o))return Object(l.createElement)(e,t);const p={};var m,f;a&&(p.color=null===(m=Object(x.b)(b,a))||void 0===m?void 0:m.color);i&&(p.backgroundColor=null===(f=Object(x.b)(b,i))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...p,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:h}))});Object(r.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Z(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Q(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",J),Object(r.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Z(e)||X(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),J(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ne);var oe=n("Bo0k"),re=n("weEX");function ce(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(re.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:Object(B.a)(t)})}})}function le(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("typography.lineHeight");return!Object(o.hasBlockSupport)(e,"typography.lineHeight")||t}function ie(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,c=!ae(e),i=!se(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,s=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return Object(l.createElement)(oe.a,{onChange:e=>{r({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:c,hasFontWeights:i,value:{fontStyle:a,fontWeight:s}})}function ae(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(o.hasBlockSupport)(e,"typography.__experimentalFontStyle"),n=Object(S.a)("typography.fontStyle");return!t||!n}function se(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(o.hasBlockSupport)(e,"typography.__experimentalFontWeight"),n=Object(S.a)("typography.fontWeight");return!t||!n}function ue(e){const t=ae(e),n=se(e);return t&&n}var de=n("BLeD"),be=n.n(de),pe=n("GKUk");const me="typography.__experimentalFontFamily";function fe(e,t,n){if(!Object(o.hasBlockSupport)(t,me))return e;if(Object(o.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const r=new be.a(e.className);r.add(`has-${Object(s.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const c=r.value;return e.className=c||void 0,e}function he(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Object(S.a)("typography.fontFamilies"),c=null===(t=Object(s.find)(r,e=>{let{slug:t}=e;return o===t}))||void 0===t?void 0:t.fontFamily;return Object(l.createElement)(pe.a,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:c,onChange:function(e){const t=Object(s.find)(r,t=>{let{fontFamily:n}=t;return n===e});n({fontFamily:null==t?void 0:t.slug})}})}function ge(e){let{name:t}=e;const n=Object(S.a)("typography.fontFamilies");return!n||0===n.length||!Object(o.hasBlockSupport)(t,me)}Object(r.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Object(o.hasBlockSupport)(e,me)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",fe),Object(r.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!Object(o.hasBlockSupport)(e,me))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),fe(o,e,n)},e}));var Oe=n("NMUH"),ve=n("QP/w");function je(e,t,n){if(!Object(o.hasBlockSupport)(t,"typography.fontSize"))return e;if(Object(o.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const r=new be.a(e.className);r.add(Object(Oe.b)(n.fontSize));const c=r.value;return e.className=c||void 0,e}function ke(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:c}=e,i=Object(S.a)("typography.fontSizes"),a=Object(Oe.a)(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return Object(l.createElement)(ve.a,{onChange:e=>{const t=Object(Oe.c)(i,e).slug;c({style:Object(B.a)({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1})}function _e(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(S.a)("typography.fontSizes"),n=!(null==t||!t.length);return!Object(o.hasBlockSupport)(e,"typography.fontSize")||!n}const ye=Object(u.createHigherOrderComponent)(e=>t=>{var n,r;const c=Object(S.a)("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:s},wrapperProps:u}=t;if(!Object(o.hasBlockSupport)(i,"typography.fontSize")||Object(o.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=s&&null!==(n=s.typography)&&void 0!==n&&n.fontSize)return Object(l.createElement)(e,t);const d=Object(Oe.a)(c,a,null==s||null===(r=s.typography)||void 0===r?void 0:r.fontSize).size,b={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return Object(l.createElement)(e,b)},"withFontSizeInlineStyles");Object(r.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Object(o.hasBlockSupport)(e,"typography.fontSize")?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",je),Object(r.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!Object(o.hasBlockSupport)(e,"typography.fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),je(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ye);var Ee=n("kVRd");function Ce(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(Ee.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Se(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalTextDecoration"),n=Object(S.a)("typography.textDecoration");return t||!n}var we=n("/Hvg");function Ie(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(we.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function xe(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalTextTransform"),n=Object(S.a)("typography.textTransform");return t||!n}var Be=n("xBDm");function Te(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(Be.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:!1})}function Pe(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalLetterSpacing"),n=Object(S.a)("typography.letterSpacing");return t||!n}const Re=["typography.lineHeight","typography.fontSize","typography.__experimentalFontStyle","typography.__experimentalFontWeight",me,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function Ne(e){const{clientId:t}=e,n=ge(e),r=_e(e),c=ue(e),i=le(e),a=Se(e),s=xe(e),u=Pe(e),d=!ae(e),b=!se(e),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[ue(e),_e(e),le(e),ge(e),Se(e),xe(e),Pe(e)];return t.filter(Boolean).length===t.length}(e),m=Me(e.name);if(p||!m)return null;const f=Object(o.getBlockSupport)(e.name,["typography","__experimentalDefaultControls"]),h=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return Object(l.createElement)(k.b,{__experimentalGroup:"typography"},!n&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:Object(j.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},Object(l.createElement)(he,e)),!r&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:Object(j.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==f?void 0:f.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},Object(l.createElement)(ke,e)),!c&&Object(l.createElement)(v.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Object(oe.b)(d,b),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},Object(l.createElement)(ie,e)),!i&&Object(l.createElement)(v.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:Object(j.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.lineHeight,resetAllFilter:h("lineHeight"),panelId:t},Object(l.createElement)(ce,e)),!a&&Object(l.createElement)(v.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:Object(j.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textDecoration,resetAllFilter:h("textDecoration"),panelId:t},Object(l.createElement)(Ce,e)),!s&&Object(l.createElement)(v.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:Object(j.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textTransform,resetAllFilter:h("textTransform"),panelId:t},Object(l.createElement)(Ie,e)),!u&&Object(l.createElement)(v.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:Object(j.__)("Letter-spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==f?void 0:f.letterSpacing,resetAllFilter:h("letterSpacing"),panelId:t},Object(l.createElement)(Te,e)))}const Me=e=>Re.some(t=>Object(o.hasBlockSupport)(e,t));function Le(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.blockGap)}function Ae(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.blockGap");return!Le(e)||t}function De(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Object(K.b)(n);if(Ae(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalUnitControl,{label:Object(j.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:Object(B.a)(n)});const c=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var l;i.current&&c&&(null===(l=i.current.parentNode)||void 0===l||l.replaceChild(i.current,i.current))},units:c,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Fe(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.margin)}function ze(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.margin"),n=!Xe(e,"margin");return!Fe(e)||t||n}function He(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Ze(n,"margin"),a=i&&i.some(e=>Ke.includes(e));if(ze(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Object(B.a)(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Object(B.a)(t)})},label:Object(j.__)("Margin"),sides:i,units:c,allowReset:!1,splitOnAxis:a})),native:null})}function Ve(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.padding)}function Ge(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.padding"),n=!Xe(e,"padding");return!Ve(e)||t||n}function Ue(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Ze(n,"padding"),a=i&&i.some(e=>Ke.includes(e));if(Ge(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Object(B.a)(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Object(B.a)(t)})},label:Object(j.__)("Padding"),sides:i,units:c,allowReset:!1,splitOnAxis:a})),native:null})}const We="spacing",qe=["top","right","bottom","left"],Ke=["vertical","horizontal"];function Ye(e){const t=Ae(e),n=Ge(e),r=ze(e),c=$e(e),i=function(e){if("web"!==l.Platform.OS)return!1;return Le(e)||Ve(e)||Fe(e)}(e.name);if(c||!i)return null;const a=Object(o.getBlockSupport)(e.name,[We,"__experimentalDefaultControls"]),s=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return Object(l.createElement)(k.b,{__experimentalGroup:"dimensions"},!n&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:Object(j.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:s("padding"),isShownByDefault:null==a?void 0:a.padding,panelId:e.clientId},Object(l.createElement)(Ue,e)),!r&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:Object(j.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:s("margin"),isShownByDefault:null==a?void 0:a.margin,panelId:e.clientId},Object(l.createElement)(He,e)),!t&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:Object(j.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:s("blockGap"),isShownByDefault:null==a?void 0:a.blockGap,panelId:e.clientId},Object(l.createElement)(De,e)))}const $e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ae(e),n=Ge(e),o=ze(e);return t&&n&&o};function Ze(e,t){const n=Object(o.getBlockSupport)(e,We);if(n&&"boolean"!=typeof n[t])return n[t]}function Xe(e,t){const n=Ze(e,t);return!(n&&n.some(e=>qe.includes(e))&&n.some(e=>Ke.includes(e)))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}var Qe=n("HgtZ");const Je=[...Re,"__experimentalBorder","color",We],et=e=>Je.some(t=>Object(o.hasBlockSupport)(e,t));function tt(e){if(Object(s.startsWith)(e,"var:")){return`var(--wp--${e.slice("var:".length).split("|").join("--")})`}return e}function nt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return Object.keys(o.__EXPERIMENTAL_STYLE_PROPERTY).forEach(r=>{const c=o.__EXPERIMENTAL_STYLE_PROPERTY[r].value,l=o.__EXPERIMENTAL_STYLE_PROPERTY[r].properties;if(Object(s.has)(e,c)&&"elements"!==Object(s.first)(c)){const o=Object(s.get)(e,c);l&&!Object(s.isString)(o)?Object.entries(l).forEach(e=>{const[t,r]=e,c=Object(s.get)(o,[r]);c&&(n[t]=tt(c))}):t.includes(c.join("."))||(n[r]=tt(Object(s.get)(e,c)))}}),n}const ot={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":["color"],"typography.__experimentalSkipSerialization":["typography"],[We+".__experimentalSkipSerialization"]:["spacing"]},rt={...ot,[""+We]:["spacing.blockGap"]};function ct(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rt;if(!et(t))return e;let{style:c}=n;return Object(s.forEach)(r,(e,n)=>{Object(o.getBlockSupport)(t,n)&&(c=Object(s.omit)(c,e))}),e.style={...nt(c),...e.style},e}const lt=Object(u.createHigherOrderComponent)(e=>t=>{const n=Object(Qe.a)();return Object(l.createElement)(l.Fragment,null,n&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(te,t),Object(l.createElement)(Ne,t),Object(l.createElement)(z,t),Object(l.createElement)(Ye,t)),Object(l.createElement)(e,t))},"withToolbarControls"),it=Object(u.createHigherOrderComponent)(e=>t=>{var n,r;const i=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,d="wp-elements-"+Object(u.useInstanceId)(e),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(s.map)(t,(t,n)=>{const r=nt(t);return Object(s.isEmpty)(r)?"":[`.${e} ${o.__EXPERIMENTAL_ELEMENTS[n]}{`,...Object(s.map)(r,(e,t)=>`\t${Object(s.kebabCase)(t)}: ${e};`),"}"].join("\n")}).join("\n")}(d,null===(r=t.attributes.style)||void 0===r?void 0:r.elements),p=Object(l.useContext)(C.c.__unstableElementContext);return Object(l.createElement)(l.Fragment,null,i&&p&&Object(l.createPortal)(Object(l.createElement)("style",{dangerouslySetInnerHTML:{__html:b}}),p),Object(l.createElement)(e,Object(c.a)({},t,{className:i?a()(t.className,d):t.className})))});Object(r.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return et(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",ct),Object(r.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!et(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ct(o,e,n,ot)},e})),Object(r.addFilter)("editor.BlockEdit","core/style/with-block-controls",lt),Object(r.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",it);var at=n("fHnH"),st=n("abaT"),ut=n("1uGa");const dt=[];function bt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const n=Object(at.a)(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)}),t}function pt(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},Object(l.createElement)("defs",null,Object(l.createElement)("filter",{id:n},Object(l.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),Object(l.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},Object(l.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),Object(l.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),Object(l.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),Object(l.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),Object(l.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),Object(l.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function mt(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,c=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=Object(S.a)("color.duotone")||dt,a=Object(S.a)("color.palette")||dt,s=!Object(S.a)("color.custom"),u=!Object(S.a)("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==i?void 0:i.length)&&u?null:Object(l.createElement)(d.b,{group:"block",__experimentalShareWithChildBlocks:!0},Object(l.createElement)(ut.a,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:s,value:c,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Object(at.b)([st.a]);const ft=Object(u.createHigherOrderComponent)(e=>t=>{const n=Object(o.hasBlockSupport)(t.name,"color.__experimentalDuotone");return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),n&&Object(l.createElement)(mt,t))},"withDuotoneControls");const ht=Object(u.createHigherOrderComponent)(e=>t=>{var n,r,i;const s=Object(o.getBlockSupport)(t.name,"color.__experimentalDuotone"),d=null==t||null===(n=t.attributes)||void 0===n||null===(r=n.style)||void 0===r||null===(i=r.color)||void 0===i?void 0:i.duotone;if(!s||!d)return Object(l.createElement)(e,t);const b="wp-duotone-"+Object(u.useInstanceId)(e),p=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach(e=>{o.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}(".editor-styles-wrapper ."+b,s),m=a()(null==t?void 0:t.className,b),f=Object(l.useContext)(C.c.__unstableElementContext);return Object(l.createElement)(l.Fragment,null,f&&Object(l.createPortal)(Object(l.createElement)(pt,{selector:p,id:b,values:bt(d)}),f),Object(l.createElement)(e,Object(c.a)({},t,{className:m})))},"withDuotoneStyles");Object(r.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Object(o.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),Object(r.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",ft),Object(r.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ht);var gt=n("1ZqX"),Ot=n("BhPs"),vt=n("w8sn"),jt=n("PPMp");function kt(e){let{setAttributes:t,attributes:n,name:r}=e;const{layout:c}=n,i=Object(S.a)("layout"),a=Object(gt.useSelect)(e=>{const{getSettings:t}=e(Ot.a);return t().supportsLayout},[]),s=Object(o.getBlockSupport)(r,"__experimentalLayout",{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:b=!0,default:p}=s;if(!d)return null;const m=c||p||{},{inherit:f=!1,type:h="default"}=m;if("default"===h&&!a)return null;const g=Object(jt.a)(h),O=e=>t({layout:e});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{title:Object(j.__)("Layout")},b&&!!i&&Object(l.createElement)(v.ToggleControl,{label:Object(j.__)("Inherit default layout"),checked:!!f,onChange:()=>t({layout:{inherit:!f}})}),!f&&u&&Object(l.createElement)(_t,{type:h,onChange:e=>t({layout:{type:e}})}),!f&&g&&Object(l.createElement)(g.inspectorControls,{layout:m,onChange:O,layoutBlockSupport:s}))),!f&&g&&Object(l.createElement)(g.toolBarControls,{layout:m,onChange:O,layoutBlockSupport:s}))}function _t(e){let{type:t,onChange:n}=e;return Object(l.createElement)(v.ButtonGroup,null,Object(jt.b)().map(e=>{let{name:o,label:r}=e;return Object(l.createElement)(v.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)}))}const yt=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n}=t;return[Object(o.hasBlockSupport)(n,"__experimentalLayout")&&Object(l.createElement)(kt,Object(c.a)({key:"layout"},t)),Object(l.createElement)(e,Object(c.a)({key:"edit"},t))]},"withInspectorControls"),Et=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n,attributes:r}=t,i=Object(o.hasBlockSupport)(n,"__experimentalLayout"),s=Object(u.useInstanceId)(e),d=Object(S.a)("layout")||{},b=Object(l.useContext)(C.c.__unstableElementContext),{layout:p}=r,{default:m}=Object(o.getBlockSupport)(n,"__experimentalLayout")||{},f=null!=p&&p.inherit?d:p||m||{},h=a()(null==t?void 0:t.className,{["wp-container-"+s]:i});return Object(l.createElement)(l.Fragment,null,i&&b&&Object(l.createPortal)(Object(l.createElement)(vt.b,{selector:".wp-container-"+s,layout:f,style:null==r?void 0:r.style}),b),Object(l.createElement)(e,Object(c.a)({},t,{className:h})))});Object(r.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return Object(s.has)(e.attributes,["layout","type"])||Object(o.hasBlockSupport)(e,"__experimentalLayout")&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),Object(r.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Et),Object(r.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",yt);const Ct=[];function St(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},c=Object(x.a)("border-color",n);return{className:a()({[c]:!!c,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:nt({border:r})}}function wt(e){const t=Object(S.a)("color.palette")||Ct,n=St(e);if(e.borderColor){const o=Object(x.b)(t,e.borderColor);n.style.borderColor=o.color}return n}function It(e){var t,n,o,r,c,l;const{backgroundColor:i,textColor:s,gradient:u,style:d}=e,b=Object(x.a)("background-color",i),p=Object(x.a)("color",s),m=Object(U.a)(u),f=m||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:a()(p,m,{[b]:!f&&!!b,"has-text-color":s||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":i||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(c=d.elements)||void 0===c||null===(l=c.link)||void 0===l?void 0:l.color})||void 0,style:nt({color:(null==d?void 0:d.color)||{}})}}const xt={};function Bt(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Object(S.a)("color.palette.custom")||[],c=Object(S.a)("color.palette.theme")||[],i=Object(S.a)("color.palette.default")||[],a=Object(S.a)("color.gradients")||xt,s=Object(l.useMemo)(()=>[...r||[],...c||[],...i||[]],[r,c,i]),u=Object(l.useMemo)(()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]],[a]),d=It(e);if(t){const e=Object(x.b)(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Object(U.e)(u,o)),n){const e=Object(x.b)(s,n);d.style.color=e.color}return d}function Tt(e){const{style:t}=e;return{style:nt({spacing:(null==t?void 0:t.spacing)||{}})}}function Pt(e){const[t,n]=Object(l.useState)(e);return Object(l.useEffect)(()=>{e&&n(e)},[e]),t}var Rt=n("14PQ"),Nt=n("BCrt"),Mt=n("lJLt")},uoCR:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n("GRId");const r=Object(o.createContext)({});function c(e){let{value:t,children:n}=e;const c=Object(o.useContext)(r),l=Object(o.useMemo)(()=>({...c,...t}),[c,t]);return Object(o.createElement)(r.Provider,{value:l,children:n})}t.b=r},ur0x:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return i}));var o=n("GRId");const r={name:"",isSelected:!1},c=Object(o.createContext)(r),{Provider:l}=c;function i(){return Object(o.useContext)(c)}},v5LD:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("ur0x"),i=n("BhPs");const a=["color","border","typography","spacing"],s={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},u={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function d(e){const{name:t}=Object(l.c)();return Object(r.useSelect)(n=>{var r;if(a.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(i.a).getSettings(),d=(e=>u[e]||e)(e),b="__experimentalFeatures."+d,p=`__experimentalFeatures.blocks.${t}.${d}`,m=null!==(r=Object(o.get)(l,p))&&void 0!==r?r:Object(o.get)(l,b);var f,h;if(void 0!==m)return c.__EXPERIMENTAL_PATHS_WITH_MERGE[d]?null!==(f=null!==(h=m.custom)&&void 0!==h?h:m.theme)&&void 0!==f?f:m.default:m;const g=s[d]?s[d](l):void 0;return void 0!==g?g:"typography.dropCap"===d||void 0},[t,e])}},v8Ku:function(e,t){},vIlp:function(e,t,n){"use strict";function o(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:c}=e,l=o?r:c,i=o?c:r,a=o?t.left:t.top,s=o?t.right:t.bottom,u=t[n];let d;return d=l>=a&&l<=s?l:l2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return c.forEach(c=>{const l=o(e,t,c);(void 0===n||lt=>{if("declaration"===t.type){const c=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};v(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+j(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=c,o.forEach(e=>{n=n.replace(e.source,e.newUrl)}),n)}}var n,o,r;return t};const _=/^(body|html|:root).*$/;var y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>{const o=n=>t.includes(n.trim())?n:n.match(_)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};t.a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object(o.map)(e,e=>{let{css:n,baseURL:o}=e;const c=[];return t&&c.push(y(t)),o&&c.push(k(o)),c.length?O(n,Object(r.compose)(c)):n})}},vtO0:function(e,t,n){"use strict";n.d(t,"a",(function(){return j})),n.d(t,"b",(function(){return k}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("l3Sj"),a=n("tI+e"),s=n("Tqx9");var u=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var d=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),b=n("EpZT");var p=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),m=n("beZb"),f=n("XNw2"),h=n("K/rC");const g={none:{icon:u,title:Object(i.__)("None")},left:{icon:d,title:Object(i.__)("Align left")},center:{icon:b.a,title:Object(i.__)("Align center")},right:{icon:p,title:Object(i.__)("Align right")},wide:{icon:m.a,title:Object(i.__)("Wide width")},full:{icon:f.a,title:Object(i.__)("Full width")}},O={isAlternate:!0};var v=function(e){let{value:t,onChange:n,controls:c,isToolbar:s,isCollapsed:u=!0}=e;const d=Object(h.a)(c);if(!!!d.length)return null;function b(e){n([t,"none"].includes(e)?void 0:e)}const p=g[t],m=g.none,f=s?a.ToolbarGroup:a.ToolbarDropdownMenu,v={popoverProps:O,icon:p?p.icon:m.icon,label:Object(i.__)("Align"),toggleProps:{describedBy:Object(i.__)("Change alignment")}},j=s||r.Platform.isNative?{isCollapsed:s?u:void 0,controls:d.map(e=>{let{name:n}=e;return{...g[n],isActive:t===n||!t&&"none"===n,role:u?"menuitemradio":void 0,onClick:()=>b(n)}})}:{children:e=>{let{onClose:n}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},d.map(e=>{let{name:o,info:c}=e;const{icon:i,title:s}=g[o],u=o===t||!t&&"none"===o;return Object(r.createElement)(a.MenuItem,{key:o,icon:i,iconPosition:"left",className:l()("components-dropdown-menu__menu-item",{"is-active":u}),isSelected:u,onClick:()=>{b(o),n()},role:"menuitemradio",info:c},s)})))}};return Object(r.createElement)(f,Object(o.a)({},v,j))};function j(e){return Object(r.createElement)(v,Object(o.a)({},e,{isToolbar:!1}))}function k(e){return Object(r.createElement)(v,Object(o.a)({},e,{isToolbar:!0}))}},w8sn:function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return u}));var o=n("wx14"),r=n("GRId"),c=n("PPMp");const l={type:"default"},i=Object(r.createContext)(l),a=i.Provider;function s(){return Object(r.useContext)(i)}function u(e){let{layout:t={},...n}=e;const l=Object(c.a)(t.type);return l?Object(r.createElement)(l.save,Object(o.a)({layout:t},n)):null}},w95h:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},wC17:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("HSyU"),c=n("BhPs");function l(e){return Object(o.useSelect)(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(c.a),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),a=n(e),s=l(a);if(!s)return null;const u=o(e),d=i(a,u),b={title:s.title,icon:s.icon,description:s.description,anchor:null==u?void 0:u.anchor};return d?{title:d.title||s.title,icon:d.icon||s.icon,description:d.description||s.description}:b},[e])}},wJiJ:function(e,t,n){e.exports=n("1K8p")},weEX:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("GRId"),r=n("l3Sj"),c=n("tI+e"),l=n("RxS6");function i(e){let{value:t,onChange:n}=e;const i=function(e){return void 0!==e&&""!==e}(t),a=i?t:"";return Object(o.createElement)("div",{className:"block-editor-line-height-control"},Object(o.createElement)(c.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==l.ZERO||i||(e.preventDefault(),n("0"))},onChange:e=>{if(i)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:Object(r.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:a,min:0}))}},"wiT/":function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("GOly");t.a=function(e){let{children:t}=e;const n=Object(r.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return Object(o.createElement)(c.a.Provider,{value:n},t)}},wx14:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t{var o;const{getBlock:r,getBlockIndex:c,hasBlockMovingClientId:l,getBlockListSettings:i}=e(j.a),a=c(t),{name:s,attributes:u}=r(t);return{index:a,name:s,attributes:u,blockMovingMode:l(),orientation:null===(o=i(n))||void 0===o?void 0:o.orientation}},[t,n]),{index:d,name:y,attributes:E,blockMovingMode:C,orientation:S}=u,{setNavigationMode:w,removeBlock:I}=Object(s.useDispatch)(j.a),x=Object(o.useRef)(),B=Object(i.getBlockType)(y),T=Object(i.__experimentalGetAccessibleBlockLabel)(B,E,d+1,S);Object(o.useEffect)(()=>{x.current.focus(),Object(h.speak)(T)},[T]);const{hasBlockMovingClientId:P,getBlockIndex:R,getBlockRootClientId:N,getClientIdsOfDescendants:M,getSelectedBlockClientId:L,getMultiSelectedBlocksEndClientId:A,getPreviousBlockClientId:D,getNextBlockClientId:F,isNavigationMode:z}=Object(s.useSelect)(j.a),{selectBlock:H,clearSelectedBlock:V,setBlockMovingClientId:G,moveBlockToPosition:U}=Object(s.useDispatch)(j.a),W=l()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!C}),q=Object(g.__)("Drag");return Object(o.createElement)("div",{className:W},Object(o.createElement)(a.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(v.a,{icon:null==c?void 0:c.icon,showColors:!0})),Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(k.a,{clientIds:[t]},e=>Object(o.createElement)(a.Button,Object(p.a)({icon:m.a,className:"block-selection-button_drag-handle","aria-hidden":"true",label:q,tabIndex:"-1"},e)))),Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(a.Button,{ref:x,onClick:()=>w(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===f.UP,c=n===f.DOWN,l=n===f.LEFT,i=n===f.RIGHT,a=n===f.TAB,s=n===f.ESCAPE,u=n===f.ENTER,d=n===f.SPACE,p=e.shiftKey;if(n===f.BACKSPACE||n===f.DELETE)return I(t),void e.preventDefault();const m=L(),h=A(),g=D(h||m),O=F(h||m),v=a&&p||o,j=a&&!p||c,k=l,_=i;let y;if(v)y=g;else if(j)y=O;else if(k){var E;y=null!==(E=N(m))&&void 0!==E?E:m}else if(_){var C;y=null!==(C=M([m])[0])&&void 0!==C?C:m}const S=P();if(s&&z()&&(V(),e.preventDefault()),s&&S&&!e.defaultPrevented&&(G(null),e.preventDefault()),(u||d)&&S){const e=N(S),t=N(m),n=R(S);let o=R(m);n{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(j.a);if(!n())return!1;const c=o();return r(c.rootClientId)[c.index]===t},[t]),B=Object(d.useViewportMatch)("medium"),[T,P]=Object(o.useState)(!1),[R,N]=Object(o.useState)(!1),{stopTyping:M}=Object(s.useDispatch)(j.a),L=!g&&!f&&c&&r,A=f,D=!f&&!k&&B&&!L&&!h&&(!g||O),F=!(f||D||k||c);Object(u.useShortcut)("core/block-editor/focus-toolbar",()=>{P(!0),M(!0)},{isDisabled:!F}),Object(o.useEffect)(()=>{D||P(!1)},[D]);const z=Object(o.useRef)(),H=Object(S.a)(t),V=Object(S.a)(_),G=Object(S.a)(i),U=Object(w.a)(m);if(!(A||D||T||L))return null;let W=H;if(!W)return null;i&&(W=G);let q=W;if(v){if(!V)return null;q={top:W,bottom:V}}const K=L?"top left right":"top right left",{ownerDocument:Y}=W,$=L?void 0:Y.defaultView.frameElement||Object(b.getScrollContainer)(W)||Y.body;return Object(o.createElement)(a.Popover,{ref:U,noArrow:!0,animate:!1,position:K,focusOnMount:!1,anchorRef:q,className:l()("block-editor-block-list__block-popover",{"is-insertion-point-visible":x}),__unstableStickyBoundaryElement:$,__unstableSlotName:p||null,__unstableBoundaryParent:!0,__unstableObserveElement:W,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==m?void 0:m.current},(D||T)&&Object(o.createElement)("div",{onFocus:function(){N(!0)},onBlur:function(){N(!1)},tabIndex:-1,className:l()("block-editor-block-list__block-popover-inserter",{"is-visible":R})},Object(o.createElement)(C.a,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(D||T)&&Object(o.createElement)(E.a,{focusOnMount:T,__experimentalInitialIndex:z.current,__experimentalOnIndexChange:e=>{z.current=e},key:t}),A&&Object(o.createElement)(y,{clientId:t,rootClientId:n,blockElement:W}),L&&Object(o.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},Object(o.createElement)(C.a,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function B(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:c,getBlockParents:l,__experimentalGetBlockListSettingsForBlocks:a}=e(j.a),s=t()||n();if(!s)return;const{name:u,attributes:d={},isValid:b}=c(s)||{},p=l(s),m=a(p),f=Object(r.find)(p,e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars});return{clientId:s,rootClientId:o(s),name:u,isValid:b,isEmptyDefaultBlock:u&&Object(i.isUnmodifiedDefaultBlock)({name:u,attributes:d}),capturingClientId:f}}function T(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const r=Object(s.useSelect)(B,[]);if(!r)return null;const{clientId:c,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:u,capturingClientId:d}=r;return i?Object(o.createElement)(x,{clientId:c,rootClientId:l,isValid:a,isEmptyDefaultBlock:u,capturingClientId:d,__unstablePopoverSlot:t,__unstableContentRef:n}):null}},"xN+R":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},Object(o.createElement)(r.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));t.a=c},xTGt:function(e,t){e.exports=window.wp.blob},xZzQ:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("1ZqX");const i=[Object(o.createInterpolateElement)(Object(c.__)("While writing, you can press / to quickly insert new blocks."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Indent a list by pressing space at the beginning of a line."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:Object(o.createElement)("kbd",null)}),Object(c.__)("Drag files into the editor to automatically insert media blocks."),Object(c.__)("Change a block's type by pressing the block icon on the toolbar.")];var a=function(){const[e]=Object(o.useState)(Math.floor(Math.random()*i.length));return Object(o.createElement)(r.Tip,null,i[e])},s=n("HSyU"),u=n("GvwK"),d=n("REKd");var b=function(e){var t,n;let{item:r}=e;const{name:l,title:i,icon:a,description:b,initialAttributes:p}=r,m=Object(s.getBlockType)(l),f=Object(s.isReusableBlock)(r);return Object(o.createElement)("div",{className:"block-editor-inserter__preview-container"},Object(o.createElement)("div",{className:"block-editor-inserter__preview"},f||null!=m&&m.example?Object(o.createElement)("div",{className:"block-editor-inserter__preview-content"},Object(o.createElement)(d.a,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=m.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:m.example?Object(s.getBlockFromExample)(r.name,{attributes:{...m.example.attributes,...p},innerBlocks:m.example.innerBlocks}):Object(s.createBlock)(l,p)})):Object(o.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},Object(c.__)("No Preview Available."))),!f&&Object(o.createElement)(u.a,{title:i,icon:a,description:b}))},p=n("YLtl"),m=n("K9lf"),f=n("6ZVF"),h=n("mdLt"),g=n("+G0a"),O=n("wiT/");const v=[];var j=function(e){let{rootClientId:t,onInsert:n,onHover:r,showMostUsedBlocks:l}=e;const[i,a,s,u]=Object(g.a)(t,n),d=Object(o.useMemo)(()=>Object(p.orderBy)(i,["frecency"],["desc"]).slice(0,6),[i]),b=Object(o.useMemo)(()=>i.filter(e=>!e.category),[i]),j=Object(o.useMemo)(()=>Object(p.flow)(e=>e.filter(e=>e.category&&"reusable"!==e.category),e=>Object(p.groupBy)(e,"category"))(i),[i]),k=Object(o.useMemo)(()=>{const e={...s};return Object.keys(s).forEach(t=>{e[t]=i.filter(e=>(e=>e.name.split("/")[0])(e)===t),0===e[t].length&&delete e[t]}),e},[i,s]);Object(o.useEffect)(()=>()=>r(null),[]);const _=Object(m.useAsyncList)(a),y=a.length===_.length,E=Object(o.useMemo)(()=>Object.entries(s),[s]),C=Object(m.useAsyncList)(y?E:v);return Object(o.createElement)(O.a,null,Object(o.createElement)("div",null,l&&!!d.length&&Object(o.createElement)(h.a,{title:Object(c._x)("Most used","blocks")},Object(o.createElement)(f.a,{items:d,onSelect:u,onHover:r,label:Object(c._x)("Most used","blocks")})),Object(p.map)(_,e=>{const t=j[e.slug];return t&&t.length?Object(o.createElement)(h.a,{key:e.slug,title:e.title,icon:e.icon},Object(o.createElement)(f.a,{items:t,onSelect:u,onHover:r,label:e.title})):null}),y&&b.length>0&&Object(o.createElement)(h.a,{className:"block-editor-inserter__uncategorized-blocks-panel",title:Object(c.__)("Uncategorized")},Object(o.createElement)(f.a,{items:b,onSelect:u,onHover:r,label:Object(c.__)("Uncategorized")})),Object(p.map)(C,e=>{let[t,n]=e;const c=k[t];return c&&c.length?Object(o.createElement)(h.a,{key:t,title:n.title,icon:n.icon},Object(o.createElement)(f.a,{items:c,onSelect:u,onHover:r,label:n.title})):null})))},k=n("TSYQ"),_=n.n(k);var y=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:l,openPatternExplorer:i}=e;const a=Object(m.useViewportMatch)("medium","<"),s=_()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return Object(o.createElement)(r.Flex,{justify:"space-between",align:"start",gap:"4",className:s},Object(o.createElement)(r.FlexItem,{isBlock:!0},Object(o.createElement)(r.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:Object(c.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{l(n.find(t=>e===t.name))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map(t=>e.push({value:t.name,label:t.label})),e})()})),!a&&Object(o.createElement)(r.FlexItem,null,Object(o.createElement)(r.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:Object(c.__)("Explore all patterns"),onClick:()=>i()},Object(c._x)("Explore","Label for showing all block patterns"))))},E=n("nQUx"),C=n("Fmc1");function S(e){let{selectedCategory:t,patternCategories:n,onClickCategory:c}=e;const l="block-editor-block-patterns-explorer__sidebar";return Object(o.createElement)("div",{className:l+"__categories-list"},n.map(e=>{let{name:n,label:i}=e;return Object(o.createElement)(r.Button,{key:n,label:i,className:l+"__categories-list__item",isPressed:t===n,onClick:()=>{c(n)}},i)}))}function w(e){let{filterValue:t,setFilterValue:n}=e;return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},Object(o.createElement)(r.SearchControl,{onChange:n,value:t,label:Object(c.__)("Search for patterns"),placeholder:Object(c.__)("Search")}))}var I=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r,filterValue:c,setFilterValue:l}=e;return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},Object(o.createElement)(w,{filterValue:c,setFilterValue:l}),!c&&Object(o.createElement)(S,{selectedCategory:t,patternCategories:n,onClickCategory:r}))},x=n("gdqT"),B=n("LolH"),T=n("AORF"),P=n("pOGT");function R(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?Object(o.createElement)(r.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},Object(c.sprintf)(Object(c._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var N=function(e){let{filterValue:t,selectedCategory:n,patternCategories:r}=e;const l=Object(m.useDebounce)(x.speak,500),[i,a]=Object(T.a)({shouldFocusBlock:!0}),[s,,u]=Object(E.a)(a,i),d=Object(o.useMemo)(()=>r.map(e=>e.name),[r]),b=Object(o.useMemo)(()=>t?Object(P.b)(s,t):s.filter(e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every(e=>!d.includes(e)):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}),[t,n,s]);Object(o.useEffect)(()=>{if(!t)return;const e=b.length,n=Object(c.sprintf)(Object(c._n)("%d result found.","%d results found.",e),e);l(n)},[t,l]);const p=Object(m.useAsyncList)(b,{step:2}),f=!(null==b||!b.length);return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&Object(o.createElement)(R,{filterValue:t,filteredBlockPatternsLength:b.length}),Object(o.createElement)(O.a,null,!f&&Object(o.createElement)(B.a,null),f&&Object(o.createElement)(C.a,{shownPatterns:p,blockPatterns:b,onClickPattern:u,isDraggable:!1})))};function M(e){let{initialCategory:t,patternCategories:n}=e;const[r,c]=Object(o.useState)(""),[l,i]=Object(o.useState)(null==t?void 0:t.name);return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer"},Object(o.createElement)(I,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:r,setFilterValue:c}),Object(o.createElement)(N,{filterValue:r,selectedCategory:l,patternCategories:n}))}var L=function(e){let{onModalClose:t,...n}=e;return Object(o.createElement)(r.Modal,{title:Object(c.__)("Patterns"),closeLabel:Object(c.__)("Close"),onRequestClose:t,isFullScreen:!0},Object(o.createElement)(M,n))};function A(e){let{rootClientId:t,onInsert:n,selectedCategory:r,populatedCategories:c}=e;const[l,,i]=Object(E.a)(n,t),a=Object(o.useCallback)(e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=c.reduce((e,t,n)=>{let{name:o}=t;return e[o]=n,e},{});return Math.min(...e.categories.map(e=>void 0!==n[e]?n[e]:1/0))},[c]),s=Object(o.useMemo)(()=>l.filter(e=>{var t;return"uncategorized"===r.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(r.name)}),[l,r]),u=Object(o.useMemo)(()=>s.sort((e,t)=>a(e)-a(t)),[s,a]),d=Object(m.useAsyncList)(u);return s.length?Object(o.createElement)("div",{className:"block-editor-inserter__panel-content"},Object(o.createElement)(C.a,{shownPatterns:d,blockPatterns:s,onClickPattern:i,label:r.label,orientation:"vertical",isDraggable:!0})):null}var D=function(e){let{rootClientId:t,onInsert:n,onClickCategory:r,selectedCategory:l}=e;const[i,a]=Object(o.useState)(!1),[s,u]=Object(E.a)(),d=Object(o.useCallback)(e=>!(!e.categories||!e.categories.length)&&e.categories.some(e=>u.some(t=>t.name===e)),[u]),b=Object(o.useMemo)(()=>{const e=u.filter(e=>s.some(t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})).sort((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0});return s.some(e=>!d(e))&&!e.find(e=>"uncategorized"===e.name)&&e.push({name:"uncategorized",label:Object(c._x)("Uncategorized")}),e},[s,u]),p=l||b[0];return Object(o.createElement)(o.Fragment,null,!i&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,{selectedCategory:p,patternCategories:b,onClickCategory:r,openPatternExplorer:()=>a(!0)}),Object(o.createElement)(A,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:b})),i&&Object(o.createElement)(L,{initialCategory:p,patternCategories:b,onModalClose:()=>a(!1)}))},F=n("Mmq9");function z(e){let{onHover:t,onInsert:n,rootClientId:r}=e;const[l,,,i]=Object(g.a)(r,n),a=Object(o.useMemo)(()=>l.filter(e=>{let{category:t}=e;return"reusable"===t}),[l]);return 0===a.length?Object(o.createElement)(B.a,null):Object(o.createElement)(h.a,{title:Object(c.__)("Reusable blocks")},Object(o.createElement)(f.a,{items:a,onSelect:i,onHover:t,label:Object(c.__)("Reusable blocks")}))}var H=function(e){let{rootClientId:t,onInsert:n,onHover:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(z,{onHover:r,onInsert:n,rootClientId:t}),Object(o.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},Object(o.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:Object(F.addQueryArgs)("edit.php",{post_type:"wp_block"})},Object(c.__)("Manage Reusable blocks"))))},V=n("Wg7J");const G={name:"blocks",title:Object(c.__)("Blocks")},U={name:"patterns",title:Object(c.__)("Patterns")},W={name:"reusable",title:Object(c.__)("Reusable")};var q=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:c=!1,onSelect:l}=e;const i=Object(o.useMemo)(()=>{const e=[G];return n&&e.push(U),c&&e.push(W),e},[G,n,U,c,W]);return Object(o.createElement)(r.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:l},t)},K=n("BhPs");t.a=function(e){let{rootClientId:t,clientId:n,isAppender:i,__experimentalInsertionIndex:s,onSelect:u,showInserterHelpPanel:d,showMostUsedBlocks:p,__experimentalFilterValue:m="",shouldFocusBlock:f=!0}=e;const[h,g]=Object(o.useState)(m),[O,v]=Object(o.useState)(null),[k,_]=Object(o.useState)(null),[y,E,C]=Object(T.a)({rootClientId:t,clientId:n,isAppender:i,insertionIndex:s,shouldFocusBlock:f}),{showPatterns:S,hasReusableBlocks:w}=Object(l.useSelect)(e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(K.a);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}},[y]),I=Object(o.useCallback)((e,t,n)=>{E(e,t,n),u()},[E,u]),x=Object(o.useCallback)((e,t)=>{E(e,{patternName:t}),u()},[E,u]),B=Object(o.useCallback)(e=>{C(!!e),v(e)},[C,v]),P=Object(o.useCallback)(e=>{_(e)},[_]),R=Object(o.useMemo)(()=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"block-editor-inserter__block-list"},Object(o.createElement)(j,{rootClientId:y,onInsert:I,onHover:B,showMostUsedBlocks:p})),d&&Object(o.createElement)("div",{className:"block-editor-inserter__tips"},Object(o.createElement)(r.VisuallyHidden,{as:"h2"},Object(c.__)("A tip for using the block editor")),Object(o.createElement)(a,null))),[y,I,B,h,p,d]),N=Object(o.useMemo)(()=>Object(o.createElement)(D,{rootClientId:y,onInsert:x,onClickCategory:P,selectedCategory:k}),[y,x,P,k]),M=Object(o.useMemo)(()=>Object(o.createElement)(H,{rootClientId:y,onInsert:I,onHover:B}),[y,I,B]),L=Object(o.useCallback)(e=>"blocks"===e.name?R:"patterns"===e.name?N:M,[R,N,M]);return Object(o.createElement)("div",{className:"block-editor-inserter__menu"},Object(o.createElement)("div",{className:"block-editor-inserter__main-area"},Object(o.createElement)("div",{className:"block-editor-inserter__content"},Object(o.createElement)(r.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{O&&v(null),g(e)},value:h,label:Object(c.__)("Search for blocks and patterns"),placeholder:Object(c.__)("Search")}),!!h&&Object(o.createElement)(V.a,{filterValue:h,onSelect:u,onHover:B,rootClientId:t,clientId:n,isAppender:i,__experimentalInsertionIndex:s,showBlockDirectory:!0,shouldFocusBlock:f}),!h&&(S||w)&&Object(o.createElement)(q,{showPatterns:S,showReusableBlocks:w},L),!h&&!S&&!w&&R)),d&&O&&Object(o.createElement)(b,{item:O}))}},xkPd:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("l3Sj"),l=n("gdqT");t.a=Object(r.forwardRef)((function(e,t){const[n,i]=Object(r.useState)(!1);return Object(r.useEffect)(()=>{n&&Object(l.speak)(Object(c.__)("Use left and right arrow keys to move through blocks"))},[n]),Object(r.createElement)("div",Object(o.a)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{i(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&i(!1)}},e))}))},yU1v:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("tI+e"),s=n("l3Sj"),u=n("dchM"),d=n("bVpQ"),b=n("Cn0l"),p=n("v5LD"),m=n("pY5h"),f=n("0LBR");const h=Object(s.__)("(%s: color %s)"),g=Object(s.__)("(%s: gradient %s)"),O=["colors","disableCustomColors","gradients","disableCustomGradients"],v=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map((e,o)=>{let c,{colorValue:l,gradientValue:i,label:u,colors:p,gradients:m}=e;if(!l&&!i)return null;if(l){const e=Object(d.c)(p||t,l);c=Object(s.sprintf)(h,u.toLowerCase(),e&&e.name||l)}else{const e=Object(b.b)(m||n,l);c=Object(s.sprintf)(g,u.toLowerCase(),e&&e.name||i)}return Object(r.createElement)(a.ColorIndicator,{key:o,colorValue:l||i,"aria-label":c})})},j=e=>{let{className:t,colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:d,children:b,settings:p,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:O,...j}=e;if(Object(i.isEmpty)(n)&&Object(i.isEmpty)(c)&&s&&d&&Object(i.every)(p,e=>Object(i.isEmpty)(e.colors)&&Object(i.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))return null;const k=Object(r.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,Object(r.createElement)(v,{colors:n,gradients:c,settings:p}));return Object(r.createElement)(a.PanelBody,Object(o.a)({className:l()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},j),Object(r.createElement)(u.a,{settings:p,colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:d,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:O}),!!b&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.__experimentalSpacer,{marginY:4})," ",b))},k=e=>{const t=Object(m.a)();return t.colors=Object(p.a)("color.palette"),t.gradients=Object(p.a)("color.gradients"),Object(r.createElement)(j,Object(o.a)({},t,e))},_=e=>{const t=Object(f.a)();return Object(r.createElement)(j,Object(o.a)({},t,e))};t.a=e=>Object(i.every)(O,t=>e.hasOwnProperty(t))?Object(r.createElement)(j,e):e.__experimentalHasMultipleOrigins?Object(r.createElement)(_,e):Object(r.createElement)(k,e)},ywyh:function(e,t){e.exports=window.wp.apiFetch},"z+q2":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("YLtl"),r=n("GRId"),c=n("1CF3"),l=n("1ZqX"),i=n("OL6h"),a=n("BhPs");function s(e){const t=Object(r.useRef)(),n=function(e){return Object(l.useSelect)(t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:c}=t(a.a);if(c(e)&&!o()&&!r())return n()},[e])}(e);return Object(r.useEffect)(()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const r=c.focus.tabbable.find(t.current).filter(e=>Object(c.isTextField)(e)),l=-1===n,a=(l?o.last:o.first)(r)||t.current;Object(i.c)(t.current,a)?Object(c.placeCaretAtHorizontalEdge)(a,l):t.current.focus()},[n]),t}},zQI6:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("1ZqX"),l=n("K9lf"),i=n("BhPs");function a(){const{hasSelectedBlock:e,hasMultiSelection:t}=Object(c.useSelect)(i.a),{clearSelectedBlock:n}=Object(c.useDispatch)(i.a);return Object(l.useRefEffect)(o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}},[e,t,n])}function s(e){return Object(r.createElement)("div",Object(o.a)({ref:a()},e))}},ziDm:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));t.a=c},zmSX:function(e,t,n){"use strict";var o=n("Cn0l");n.d(t,"a",(function(){return o.a})),n.d(t,"b",(function(){return o.b})),n.d(t,"c",(function(){return o.c})),n.d(t,"d",(function(){return o.d})),n.d(t,"e",(function(){return o.e}))},zt9T:function(e,t,n){"use strict";var o=n("jB5C");e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,c=n.onlyScrollIfNeeded,l=n.alignWithTop,i=n.alignWithLeft,a=n.offsetTop||0,s=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var b=o.isWindow(t),p=o.offset(e),m=o.outerHeight(e),f=o.outerWidth(e),h=void 0,g=void 0,O=void 0,v=void 0,j=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0;b?(_=t,C=o.height(_),E=o.width(_),y={left:o.scrollLeft(_),top:o.scrollTop(_)},j={left:p.left-y.left-s,top:p.top-y.top-a},k={left:p.left+f-(y.left+E)+d,top:p.top+m-(y.top+C)+u},v=y):(h=o.offset(t),g=t.clientHeight,O=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},j={left:p.left-(h.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-s,top:p.top-(h.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},k={left:p.left+f-(h.left+O+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:p.top+m-(h.top+g+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),j.top<0||k.top>0?!0===l?o.scrollTop(t,v.top+j.top):!1===l?o.scrollTop(t,v.top+k.top):j.top<0?o.scrollTop(t,v.top+j.top):o.scrollTop(t,v.top+k.top):c||((l=void 0===l||!!l)?o.scrollTop(t,v.top+j.top):o.scrollTop(t,v.top+k.top)),r&&(j.left<0||k.left>0?!0===i?o.scrollLeft(t,v.left+j.left):!1===i?o.scrollLeft(t,v.left+k.left):j.left<0?o.scrollLeft(t,v.left+j.left):o.scrollLeft(t,v.left+k.left):c||((i=void 0===i||!!i)?o.scrollLeft(t,v.left+j.left):o.scrollLeft(t,v.left+k.left)))}}}); \ No newline at end of file + */,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:function(e,t,n){"use strict";var o=n(3812),r=n(7939);function l(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={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:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return E(e,(e=>e.attributes))}function S(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function I(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:w(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!S(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N,P,M=(0,m.combineReducers)({blocks:x,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.startOffset},selectionEnd:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:l}=o;return{selectionStart:r,selectionEnd:l};case"MULTI_SELECT":const{start:i,end:s}=o;return{selectionStart:{clientId:i},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const a=null==n||null===(e=n.selectionStart)||void 0===e?void 0:e.clientId,c=null==n||null===(t=n.selectionEnd)||void 0===t?void 0:t.clientId;if(!a&&!c)return n;if(!o.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!o.blocks.some((e=>e.clientId===c)))return{...n,selectionEnd:n.selectionStart}}return{selectionStart:T(n.selectionStart,o),selectionEnd:T(n.selectionEnd,o)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":if(!n.blocks.length)return t;return{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o{const n=e.blocks.byClientId[t];return n?{...n,attributes:U(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function $(e,t){var n;const o=t&&It(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Be(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Be(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=Be(e);return[...t,...q(e,t)]}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=Y(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Q=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>G(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function Z(e,t){return Be(e,t).length}function J(e){return e.selection.selectionStart}function ee(e){return e.selection.selectionEnd}function te(e){return e.selection.selectionStart.clientId}function ne(e){return e.selection.selectionEnd.clientId}function oe(e){const t=ve(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ie(e){const t=le(e);return t?G(e,t):null}function se(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ae=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ce=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ae(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ue(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function de(e,t){const n=le(e),o=[...ae(e,t),t],r=[...ae(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=le(e)),void 0===t&&(t=n<0?ke(e):_e(e)),!t)return null;const o=se(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function me(e,t){return pe(e,t,-1)}function fe(e,t){return pe(e,t,1)}function he(e){return e.initialPosition}const ge=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=se(e,t.clientId);if(null===o)return z;const r=Be(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:ge(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>G(e,t))):z}),(e=>[...ge.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function ke(e){return(0,u.first)(ve(e))||null}function _e(e){return(0,u.last)(ve(e))||null}function ye(e,t){return ke(e)===t}function Ee(e,t){return-1!==ve(e).indexOf(t)}const Ce=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=se(e,n),o=Ee(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Be(e,t){return e.blocks.order[t||""]||z}function Ie(e,t){return Be(e,se(e,t)).indexOf(t)}function xe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Te(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Be(e,t),(t=>xe(e,t)||Ee(e,t)||n&&Te(e,t,n)))}function Ne(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&oFe(e,t)))}function Ve(e){return e.isCaretWithinFormattedText}function He(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=se(e,l)||void 0,n=Ie(e,r.clientId)+1):n=Be(e).length,{rootClientId:t,index:n}}function Ue(e){return null!==e.insertionPoint}function Ge(e){return e.template.isValid}function We(e){return e.settings.template}function $e(e,t){if(!t)return e.settings.templateLock;const n=ht(e,t);return n?n.templateLock:null}const je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ke=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=gt(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=ht(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=je(u,t),p=n.parent,m=V(e,o),f=je(p,m),h=null===d&&null===f||!0===d||!0===f;return h?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",h,n,o,{getBlock:G.bind(null,e),getBlockParentsByBlockName:ce.bind(null,e)}):h},qe=D(Ke,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>qe(e,V(e,t),n)))}function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=U(e,t);if(null===o)return!0;const{lock:r}=o,l=!!$e(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Xe(e,t,n)))}function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=U(e,t);if(null===o)return;const{lock:r}=o,l="all"===$e(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ze(e,t,n)))}function et(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const tt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Ke(e,t.name,n),nt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=et(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ot(r,l)}},ot=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},rt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(Q(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=et(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ot(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},lt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=rt(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=et(e,l)||{},c=ot(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>tt(e,n,t))).map(n),a=Ke(e,"core/block",t)?Et(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=nt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),it=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=rt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>tt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(e=>{let{name:t}=e;return t})),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]),a=(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc");return a}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>tt(e,n,t)));if(n)return!0;const o=Ke(e,"core/block",t)&&Et(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),at=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ct=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(G(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),ut=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),dt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=gt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return ut(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),pt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=dt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return qe(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),mt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=pt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...pt.getDependants(e,t)])),ft=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||It(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return mt(e,o,n)}),((e,t)=>[...mt.getDependants(e,t)]));function ht(e,t){return e.blockListSettings[t]}function gt(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),kt=D(((e,t)=>{var n;const o=(0,u.find)(Et(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Et(e)]));function _t(e){return e.blocks.isIgnoredChange}function yt(e){return e.lastBlockAttributesChange}function Et(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:z}function Ct(e){return e.isNavigationMode}function wt(e){return e.hasBlockMovingClientId}function St(e){return!!e.automaticChangeStatus}function Bt(e,t){return e.highlightedBlock===t}function It(e,t){return!!e.blocks.controlledInnerBlocks[t]}const xt=D(((e,t)=>{if(!t.length)return null;const n=le(e);if(t.includes(V(e,n)))return n;const o=ve(e),r=ce(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Tt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Nt=window.wp.a11y,Pt=window.wp.richText,Mt=window.wp.deprecated,Rt=n.n(Mt);const Lt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(At(e))},At=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Dt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ot(e){return Rt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function zt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ht=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Ut=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Gt(){return{type:"START_MULTI_SELECT"}}function Wt(){return{type:"STOP_MULTI_SELECT"}}const $t=(e,t)=>n=>{let{select:o,dispatch:r}=n;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t});const l=o.getSelectedBlockCount();(0,Nt.speak)((0,h.sprintf)((0,h._n)("%s block selected.","%s blocks selected.",l),l),"assertive")};function jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Kt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function qt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const Yt=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=qt((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Xt(e,t){return Yt(e,t)}const Qt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},Zt=Qt("MOVE_BLOCKS_DOWN"),Jt=Qt("MOVE_BLOCKS_UP"),en=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return en([e],t,n,o)}function nn(e,t,n,o,r){return on([e],t,n,o,0,r)}const on=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,Rt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"10.1",plugin:"Gutenberg",hint:"The meta argument is now the 6th argument of the function"})),e=qt((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e){s.canInsertBlockType(t.name,n)&&c.push(t)}c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function ln(){return{type:"HIDE_INSERTION_POINT"}}function sn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const an=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},cn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:h,offset:g}=o.getSelectionStart(),v=(f===s?d:m).attributes[h],b=(f===s||f===a)&&void 0!==h&&void 0!==g&&!!v;v||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[h],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Pt.insert)((0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"†",g,g);e.attributes[h]=(0,Pt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),t=E[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=d.attributes[e],i=(0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf("†"),a=(0,Pt.remove)(i,s,s+1),p=(0,Pt.toHTMLString)({value:a,multilineTag:n,preserveWhiteSpace:r});E[e]=p,l.selectionChange(c.clientId,e,s,s)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},un=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function dn(e,t){return un([e],t)}function pn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function mn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function fn(){return{type:"START_TYPING"}}function hn(){return{type:"STOP_TYPING"}}function gn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function vn(){return{type:"STOP_DRAGGING_BLOCKS"}}function bn(){return{type:"ENTER_FORMATTED_TEXT"}}function kn(){return{type:"EXIT_FORMATTED_TEXT"}}function _n(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}function yn(e,t,n){const o=(0,r.getDefaultBlockName)();if(!o)return;return nn((0,r.createBlock)(o,e),n,t)}function En(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Cn(e){return{type:"UPDATE_SETTINGS",settings:e}}function wn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Sn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Bn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const In=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},xn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Nt.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Nt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Tn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Nt.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Nn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;const s=i.map((e=>e.name));if(s.some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const a=o.getBlockRootClientId(e[0]),c=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),d=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(d,c+1,a,t),d.length>1&&t&&l.multiSelect((0,u.first)(d).clientId,(0,u.last)(d).clientId),d.map((e=>e.clientId))}},Pn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Mn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function Rn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Ln=e=>async t=>{let{dispatch:n}=t;n(Rn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Rn(e,!1))};function An(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const Dn="core/block-editor",On={reducer:M,selectors:e,actions:t,__experimentalUseThunks:!0},Fn=(0,m.createReduxStore)(Dn,{...On,persist:["preferences"]});(0,m.registerStore)(Dn,{...On,persist:["preferences"]});const zn={name:"",isSelected:!1},Vn=(0,s.createContext)(zn),{Provider:Hn}=Vn;function Un(){return(0,s.useContext)(Vn)}function Gn(){const{isSelected:e,clientId:t,name:n}=Un();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Fn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Wn(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Gn(),{clientId:o}=Un(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Fn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function $n(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const jn=Wn;jn.Slot=$n;const Kn=e=>(0,s.createElement)(Wn,i({group:"inline"},e));Kn.Slot=e=>(0,s.createElement)($n,i({group:"inline"},e));var qn=jn;var Yn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var Xn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var Qn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var Zn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var Jn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));var eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));var to=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var no=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var oo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var ro=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var lo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"}));var io=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function so(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const ao=["color","border","typography","spacing"],co={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},uo={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function po(e){const{name:t}=Un(),n=(0,m.useSelect)((n=>{var o;if(ao.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Fn).getSettings(),i=(e=>uo[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=co[i]?co[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e]);return n}const mo={left:to,center:no,right:oo,"space-between":ro};var fo=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?mo[r]:mo.left,d=[{name:"left",icon:to,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:no,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:oo,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:ro,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function ho(e){return(0,s.createElement)(fo,i({},e,{isToolbar:!1}))}function go(e){return(0,s.createElement)(fo,i({},e,{isToolbar:!0}))}const vo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},bo={left:"flex-start",right:"flex-end",center:"center"},ko=["wrap","nowrap"];var _o={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n}=e;const{allowOrientation:o=!0}=t;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(yo,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,o&&(0,s.createElement)(Co,{layout:t,onChange:n}))),(0,s.createElement)(Eo,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;return null!=o&&o.allowSwitching?null:(0,s.createElement)(qn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(yo,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l}=e;const{orientation:i="horizontal"}=r,a=null!==po("spacing.blockGap"),c=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=vo[r.justifyContent]||vo.left,d=ko.includes(r.flexWrap)?r.flexWrap:"wrap",p=`\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tjustify-content: ${u};\n\t\t`,m=`\n\t\tflex-direction: column;\n\t\talign-items: ${bo[r.justifyContent]||bo.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${so(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${so(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function yo(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(ho,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:to,label:(0,h.__)("Justify items left")},{value:"center",icon:no,label:(0,h.__)("Justify items center")},{value:"right",icon:oo,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:ro,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Eo(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Co(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:lo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:io,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wo=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},So={name:"default",label:(0,h.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(wo,{icon:Qn})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(wo,{icon:Jn}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t,n;let{selector:o,layout:r={},style:l}=e;const{contentSize:i,wideSize:a}=r,c=null!==po("spacing.blockGap"),u=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap )";let d=i||a?`\n\t\t\t\t\t${so(o,"> *")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${so(o,'> [data-align="wide"]')} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\n\t\t\t\t\t${so(o,'> [data-align="full"]')} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return d+=`\n\t\t\t${so(o,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${so(o,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\n\t\t`,c&&(d+=`\n\t\t\t\t${so(o,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${so(o,"> * + *")} {\n\t\t\t\t\tmargin-top: ${u};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,d)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;r.test(t)&&(o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t));r.test(n)&&(o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n));return o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const Bo=[So,_o];function Io(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Bo.find((t=>t.name===e))}const xo={type:"default"},To=(0,s.createContext)(xo),No=To.Provider;function Po(){return(0,s.useContext)(To)}function Mo(e){let{layout:t={},...n}=e;const o=Io(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Ro=["none","left","center","right","wide","full"],Lo=["wide","full"];function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ro;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Fn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Po(),r=Io(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Ro}=o,s=e.filter((e=>(o.alignments||t||!Lo.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Do={none:{icon:Yn,title:(0,h.__)("None")},left:{icon:Xn,title:(0,h.__)("Align left")},center:{icon:Qn,title:(0,h.__)("Align center")},right:{icon:Zn,title:(0,h.__)("Align right")},wide:{icon:Jn,title:(0,h.__)("Wide width")},full:{icon:eo,title:(0,h.__)("Full width")}},Oo={isAlternate:!0};var Fo=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ao(o);if(!!!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Do[t],m=Do.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,g={popoverProps:Oo,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Do[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Do[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},g,v))};function zo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!1}))}function Vo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!0}))}const Ho=["left","center","right","wide","full"],Uo=["wide","full"];function Go(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Ho.filter((t=>e.includes(t))):!0===e?[...Ho]:[],!o||!0===e&&!n?(0,u.without)(t,...Uo):t}const Wo=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ao(Go((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(qn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zo,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),$o=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ao(Go((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Ho,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$o),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wo),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Go((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));window.wp.warning;var jo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Ko(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Gn(),l=null===(t=jo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const qo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,qo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Yo(e){let{children:t,group:n,label:o}=e;const{attributes:r,clientIds:l,panelId:i}=(0,m.useSelect)((e=>{const{getBlockAttributes:t,getMultiSelectedBlockClientIds:n,getSelectedBlockClientId:o,hasMultiSelection:r}=e(Fn),l=o();if(r()){const e=n(),o=e.reduce(((e,n)=>(e[n]=t(n),e)),{});return{panelId:l,clientIds:e,attributes:o}}return{panelId:l,clientIds:[l],attributes:{[l]:t(l)}}}),[]),{updateBlockAttributes:a}=(0,m.useDispatch)(Fn);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={};l.forEach((n=>{const{style:o}=r[n];let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:qo(l.style)},t[n]=l})),a(l,t,!0)},key:i,panelId:i,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0},t)}function Xo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o}))}function Qo(e){var t;let{__experimentalGroup:n="default",bubblesVirtually:o=!0,label:r,...l}=e;const a=null===(t=jo[n])||void 0===t?void 0:t.Slot,c=(0,p.__experimentalUseSlot)(null==a?void 0:a.__unstableName);if(!a||!c)return"undefined"!=typeof process&&process.env,null;return Boolean(c.fills&&c.fills.length)?r?(0,s.createElement)(Yo,{group:n,label:r},(0,s.createElement)(Xo,i({},l,{bubblesVirtually:o,Slot:a}))):(0,s.createElement)(a,i({},l,{bubblesVirtually:o})):null}const Zo=Ko;Zo.Slot=Qo;const Jo=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));Jo.Slot=e=>(0,s.createElement)(Qo,i({},e,{__experimentalGroup:"advanced"})),Jo.slotName="InspectorAdvancedControls";var er=Zo;const tr=/[\s#]/g;const nr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(tr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(er,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",nr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const or=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(er,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",or),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));var rr=window.wp.dom;const lr=(0,s.createContext)({});function ir(e){let{value:t,children:n}=e;const o=(0,s.useContext)(lr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(lr.Provider,{value:r,children:n})}var sr=lr;const ar={};var cr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(sr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ar),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function ur(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Hn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(cr,e))}var dr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var pr=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:dr,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},mr=n(1973);function fr(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,rr.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var hr=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,mr.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(fr,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(fr,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const gr=e=>(0,r.rawHandler)({HTML:e.originalContent});var vr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Fn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Fn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,gr(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pr,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:f},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:(0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(hr,{block:i,onKeep:t,onConvert:n,convertor:gr,convertButtonText:(0,h.__)("Convert to Blocks")})))}));const br=(0,s.createElement)(pr,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed."));var kr=()=>br;class _r extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var yr=_r,Er=n(773);var Cr=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Fn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Fn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Er.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),c=!n||(0,r.isValidBlockContent)(e,s,a);i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let wr=Vr();const Sr=e=>Dr(e,wr);let Br=Vr();Sr.write=e=>Dr(e,Br);let Ir=Vr();Sr.onStart=e=>Dr(e,Ir);let xr=Vr();Sr.onFrame=e=>Dr(e,xr);let Tr=Vr();Sr.onFinish=e=>Dr(e,Tr);let Nr=[];Sr.setTimeout=(e,t)=>{let n=Sr.now()+t,o=()=>{let e=Nr.findIndex((e=>e.cancel==o));~e&&Nr.splice(e,1),Lr-=~e?1:0},r={time:n,handler:e,cancel:o};return Nr.splice(Pr(n),0,r),Lr+=1,Or(),r};let Pr=e=>~(~Nr.findIndex((t=>t.time>e))||~Nr.length);Sr.cancel=e=>{Ir.delete(e),xr.delete(e),wr.delete(e),Br.delete(e),Tr.delete(e)},Sr.sync=e=>{Ar=!0,Sr.batchedUpdates(e),Ar=!1},Sr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Sr.onStart(n)}return o.handler=e,o.cancel=()=>{Ir.delete(n),t=null},o};let Mr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Sr.use=e=>Mr=e,Sr.now="undefined"!=typeof performance?()=>performance.now():Date.now,Sr.batchedUpdates=e=>e(),Sr.catch=console.error,Sr.frameLoop="always",Sr.advance=()=>{"demand"!==Sr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):zr()};let Rr=-1,Lr=0,Ar=!1;function Dr(e,t){Ar?(t.delete(e),e(0)):(t.add(e),Or())}function Or(){Rr<0&&(Rr=0,"demand"!==Sr.frameLoop&&Mr(Fr))}function Fr(){~Rr&&(Mr(Fr),Sr.batchedUpdates(zr))}function zr(){let e=Rr;Rr=Sr.now();let t=Pr(Rr);t&&(Hr(Nr.splice(0,t),(e=>e.handler())),Lr-=t),Ir.flush(),wr.flush(e?Math.min(64,Rr-e):16.667),xr.flush(),Br.flush(),Tr.flush(),Lr||(Rr=-1)}function Vr(){let e=new Set,t=e;return{add(n){Lr+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Lr-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Lr-=t.size,Hr(t,(t=>t(n)&&e.add(t))),Lr+=e.size,t=e)}}}function Hr(e,t){e.forEach((e=>{try{t(e)}catch(e){Sr.catch(e)}}))}var Ur=n(9196),Gr=n.n(Ur);function Wr(){}const $r={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 jr(e,t){if($r.arr(e)){if(!$r.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function qr(e,t,n){if($r.arr(e))for(let o=0;o$r.und(e)?[]:$r.arr(e)?e:[e];function Xr(e,t){if(e.size){const n=Array.from(e);e.clear(),Kr(n,t)}}const Qr=(e,...t)=>Xr(e,(e=>e(...t))),Zr=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Jr,el,tl=null,nl=!1,ol=Wr;var rl=Object.freeze({__proto__:null,get createStringInterpolator(){return Jr},get to(){return el},get colors(){return tl},get skipAnimation(){return nl},get willAdvance(){return ol},assign:e=>{e.to&&(el=e.to),e.now&&(Sr.now=e.now),void 0!==e.colors&&(tl=e.colors),null!=e.skipAnimation&&(nl=e.skipAnimation),e.createStringInterpolator&&(Jr=e.createStringInterpolator),e.requestAnimationFrame&&Sr.use(e.requestAnimationFrame),e.batchedUpdates&&(Sr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(ol=e.willAdvance),e.frameLoop&&(Sr.frameLoop=e.frameLoop)}});const ll=new Set;let il=[],sl=[],al=0;const cl={get idle(){return!ll.size&&!il.length},start(e){al>e.priority?(ll.add(e),Sr.onStart(ul)):(dl(e),Sr(ml))},advance:ml,sort(e){if(al)Sr.onFrame((()=>cl.sort(e)));else{const t=il.indexOf(e);~t&&(il.splice(t,1),pl(e))}},clear(){il=[],ll.clear()}};function ul(){ll.forEach(dl),ll.clear(),Sr(ml)}function dl(e){il.includes(e)||pl(e)}function pl(e){il.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(il,(t=>t.priority>e.priority)),0,e)}function ml(e){const t=sl;for(let n=0;n0}const fl="[-+]?\\d*\\.?\\d+",hl=fl+"%";function gl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const vl=new RegExp("rgb"+gl(fl,fl,fl)),bl=new RegExp("rgba"+gl(fl,fl,fl,fl)),kl=new RegExp("hsl"+gl(fl,hl,hl)),_l=new RegExp("hsla"+gl(fl,hl,hl,fl)),yl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,El=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Cl=/^#([0-9a-fA-F]{6})$/,wl=/^#([0-9a-fA-F]{8})$/;function Sl(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 Bl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Sl(r,o,e+1/3),i=Sl(r,o,e),s=Sl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Il(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function xl(e){return(parseFloat(e)%360+360)%360/360}function Tl(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Nl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Pl(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Cl.exec(e))?parseInt(t[1]+"ff",16)>>>0:tl&&void 0!==tl[e]?tl[e]:(t=vl.exec(e))?(Il(t[1])<<24|Il(t[2])<<16|Il(t[3])<<8|255)>>>0:(t=bl.exec(e))?(Il(t[1])<<24|Il(t[2])<<16|Il(t[3])<<8|Tl(t[4]))>>>0:(t=yl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=wl.exec(e))?parseInt(t[1],16)>>>0:(t=El.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=kl.exec(e))?(255|Bl(xl(t[1]),Nl(t[2]),Nl(t[3])))>>>0:(t=_l.exec(e))?(Bl(xl(t[1]),Nl(t[2]),Nl(t[3]))|Tl(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})`)}const Ml=(e,t,n)=>{if($r.fun(e))return e;if($r.arr(e))return Ml({range:e,output:t,extrapolate:n});if($r.str(e.output[0]))return Jr(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(cn){if("identity"===s)return c;"clamp"===s&&(c=n)}if(o===r)return o;if(t===n)return e<=t?o:r;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o;return c}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function Rl(){return Rl=Object.assign||function(e){for(var t=1;tBoolean(e&&e[Ll]),Ol=e=>e&&e[Ll]?e[Ll]():e,Fl=e=>e[Al]||null;function zl(e,t){let n=e[Al];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Vl{constructor(e){if(this[Ll]=void 0,this[Al]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Hl(this,e)}}const Hl=(e,t)=>Wl(e,Ll,t);function Ul(e,t){if(e[Ll]){let n=e[Al];n||Wl(e,Al,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Gl(e,t){let n=e[Al];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Al]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Wl=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),$l=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,jl=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Kl=new RegExp(`(${$l.source})(%|[a-z]+)`,"i"),ql=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Yl=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Xl=e=>{const[t,n]=Ql(e);if(!t||Zr())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){const t=window.getComputedStyle(document.documentElement).getPropertyValue(n);return t||e}return n&&Yl.test(n)?Xl(n):n||e},Ql=e=>{const t=Yl.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Zl;const Jl=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,ei=e=>{Zl||(Zl=tl?new RegExp(`(${Object.keys(tl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Ol(e).replace(Yl,Xl).replace(jl,Pl).replace(Zl,Pl))),n=t.map((e=>e.match($l).map(Number))),o=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]})))),r=o.map((t=>Ml(Rl({},e,{output:t}))));return e=>{var n;const o=!Kl.test(t[0])&&(null==(n=t.find((e=>Kl.test(e))))?void 0:n.replace($l,""));let l=0;return t[0].replace($l,(()=>`${r[l++](e)}${o||""}`)).replace(ql,Jl)}},ti="react-spring: ",ni=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ti}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},oi=ni(console.warn);const ri=ni(console.warn);function li(e){return $r.str(e)&&("#"==e[0]||/\d/.test(e)||!Zr()&&Yl.test(e)||e in(tl||{}))}const ii=e=>(0,Ur.useEffect)(e,si),si=[];function ai(){const e=(0,Ur.useState)()[1],t=(0,Ur.useState)(ci)[0];return ii(t.unmount),()=>{t.current&&e({})}}function ci(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ui(e){const t=(0,Ur.useRef)();return(0,Ur.useEffect)((()=>{t.current=e})),t.current}const di="undefined"!=typeof window&&window.document&&window.document.createElement?Ur.useLayoutEffect:Ur.useEffect,pi=Symbol.for("Animated:node"),mi=e=>e&&e[pi],fi=(e,t)=>{return n=e,o=pi,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},hi=e=>e&&e[pi]&&e[pi].getPayload();class gi{constructor(){this.payload=void 0,fi(this,this)}getPayload(){return this.payload||[]}}class vi extends gi{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,$r.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new vi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return $r.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(){const{done:e}=this;this.done=!1,$r.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class bi extends vi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Ml({output:[e,e]})}static create(e){return new bi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if($r.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=Ml({output:[this.getValue(),e]})),this._value=0,super.reset()}}const ki={dependencies:null};class _i extends gi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return qr(this.source,((n,o)=>{var r;(r=n)&&r[pi]===r?t[o]=n.getValue(e):Dl(n)?t[o]=Ol(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Kr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return qr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ki.dependencies&&Dl(e)&&ki.dependencies.add(e);const t=hi(e);t&&Kr(t,(e=>this.add(e)))}}class yi extends _i{constructor(e){super(e)}static create(e){return new yi(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Ei)),!0)}}function Ei(e){return(li(e)?bi:vi).create(e)}function Ci(e){const t=mi(e);return t?t.constructor:$r.arr(e)?yi:li(e)?bi:vi}function wi(){return wi=Object.assign||function(e){for(var t=1;t{const n=!$r.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ur.forwardRef)(((o,r)=>{const l=(0,Ur.useRef)(null),i=n&&(0,Ur.useCallback)((e=>{l.current=function(e,t){e&&($r.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;ki.dependencies=n,e.style&&(e=wi({},e,{style:t.createAnimatedStyle(e.style)}));return e=new _i(e),ki.dependencies=null,[e,n]}(o,t),c=ai(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Bi(u,a),p=(0,Ur.useRef)();di((()=>{const e=p.current;p.current=d,Kr(a,(e=>Ul(e,d))),e&&(Kr(e.deps,(t=>Gl(t,e))),Sr.cancel(e.update))})),(0,Ur.useEffect)(u,[]),ii((()=>()=>{const e=p.current;Kr(e.deps,(t=>Gl(t,e)))}));const m=t.getComponentProps(s.getValue());return Ur.createElement(e,wi({},m,{ref:i}))}))};class Bi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Sr.write(this.update)}}const Ii=Symbol.for("AnimatedComponent"),xi=e=>$r.str(e)?e:e&&$r.str(e.displayName)?e.displayName:$r.fun(e)&&e.name||null;function Ti(){return Ti=Object.assign||function(e){for(var t=1;t!0===e||!!(t&&e&&($r.fun(e)?e(t):Yr(e).includes(t))),Mi=(e,t)=>$r.obj(e)?t&&e[t]:e,Ri=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Li=e=>e,Ai=(e,t=Li)=>{let n=Di;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);$r.und(n)||(o[r]=n)}return o},Di=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Oi={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 Fi(e){const t=function(e){const t={};let n=0;if(qr(e,((e,o)=>{Oi[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return qr(e,((e,o)=>o in t||(n[o]=e))),n}return Ti({},e)}function zi(e){return e=Ol(e),$r.arr(e)?e.map(zi):li(e)?rl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Vi(e){for(const t in e)return!0;return!1}function Hi(e){return $r.fun(e)||$r.arr(e)&&$r.obj(e[0])}function Ui(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Gi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Wi=1.70158,$i=1.525*Wi,ji=Wi+1,Ki=2*Math.PI/3,qi=2*Math.PI/4.5,Yi=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},Xi={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=>ji*e*e*e-Wi*e*e,easeOutBack:e=>1+ji*Math.pow(e-1,3)+Wi*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-$i)/2:(Math.pow(2*e-2,2)*(($i+1)*(2*e-2)+$i)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ki),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ki)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*qi)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*qi)/2+1,easeInBounce:e=>1-Yi(1-e),easeOutBounce:Yi,easeInOutBounce:e=>e<.5?(1-Yi(1-2*e))/2:(1+Yi(2*e-1))/2},Qi=Ti({},{tension:170,friction:26},{mass:1,damping:1,easing:Xi.linear,clamp:!1});class Zi{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Qi)}}function Ji(e,t){if($r.und(t.decay)){const n=!$r.und(t.tension)||!$r.und(t.friction);!n&&$r.und(t.frequency)&&$r.und(t.damping)&&$r.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const es=[];class ts{constructor(){this.changed=!1,this.values=es,this.toValues=null,this.fromValues=es,this.to=void 0,this.from=void 0,this.config=new Zi,this.immediate=!1}}function ns(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Pi(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{$r.und(n.pause)||(r.paused=Pi(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Pi(e,t)),c=Ni(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-Sr.now()}function m(){c>0&&!rl.skipAnimation?(r.delayed=!0,u=Sr.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ti({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const os=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?is(e.get()):t.every((e=>e.noop))?rs(e.get()):ls(e.get(),t.every((e=>e.finished))),rs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ls=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),is=e=>({value:e,cancelled:!0,finished:!1});function ss(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Ai(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&is(o)||r!==n.asyncId&&ls(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new cs,i=new us;return(async()=>{if(rl.skipAnimation)throw as(n),i.result=ls(o,!1),d(i),i;m(l);const s=$r.obj(e)?Ti({},e):Ti({},t,{to:e});s.parentId=r,qr(c,((e,t)=>{$r.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(rl.skipAnimation)return as(n),ls(o,!1);try{let t;t=$r.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=ls(o.get(),!0,!1)}catch(e){if(e instanceof cs)h=e.result;else{if(!(e instanceof us))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return $r.fun(i)&&Sr.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function as(e,t){Xr(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class cs extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class us extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const ds=e=>e instanceof ms;let ps=1;class ms extends Vl{constructor(...e){super(...e),this.id=ps++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=mi(this);return e&&e.getValue()}to(...e){return rl.to(this,e)}interpolate(...e){return oi(`${ti}The "interpolate" function is deprecated in v9 (use "to" instead)`),rl.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){zl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||cl.sort(this),zl(this,{type:"priority",parent:this,priority:e})}}const fs=Symbol.for("SpringPhase"),hs=e=>(1&e[fs])>0,gs=e=>(2&e[fs])>0,vs=e=>(4&e[fs])>0,bs=(e,t)=>t?e[fs]|=3:e[fs]&=-3,ks=(e,t)=>t?e[fs]|=4:e[fs]&=-5;class _s extends ms{constructor(e,t){if(super(),this.key=void 0,this.animation=new ts,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!$r.und(e)||!$r.und(t)){const n=$r.obj(e)?Ti({},e):Ti({},t,{from:e});$r.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(gs(this)||this._state.asyncTo)||vs(this)}get goal(){return Ol(this.animation.to)}get velocity(){const e=mi(this);return e instanceof vi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return hs(this)}get isAnimating(){return gs(this)}get isPaused(){return vs(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=hi(o.to);!i&&Dl(o.to)&&(l=Yr(Ol(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==bi?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=$r.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if($r.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!$r.und(a),m=n==c?s.v0>0:no,f||(u=Math.abs(c-d)<=t,!u));++e){p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c));i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*g,d+=i*g}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=mi(this),a=s.getValue();if(t){const e=Ol(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Sr.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(gs(this)){const{to:e,config:t}=this.animation;Sr.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 $r.und(e)?(n=this.queue||[],this.queue=[]):n=[$r.obj(e)?e:Ti({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>os(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),as(this._state,e&&this._lastCallId),Sr.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){const t=this.key||"";let{to:n,from:o}=e;n=$r.obj(n)?n[t]:n,(null==n||Hi(n))&&(n=void 0),o=$r.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return hs(this)||(e.reverse&&([n,o]=[o,n]),o=Ol(o),$r.und(o)?mi(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ti({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Ai(n,((e,t)=>/^on/.test(t)?Mi(e,o):e))),Is(this,n,"onProps"),xs(this,"onProps",n,this);const l=this._prepareNode(n);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?");const i=this._state;return ns(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{vs(this)||(ks(this,!0),Qr(i.pauseQueue),xs(this,"onPause",ls(this,ys(this,this.animation.to)),this))},resume:()=>{vs(this)&&(ks(this,!1),gs(this)&&this._resume(),Qr(i.resumeQueue),xs(this,"onResume",ls(this,ys(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Es(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(is(this));const o=!$r.und(e.to),r=!$r.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(is(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!$r.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!jr(d,c);p&&(s.from=d),d=Ol(d);const m=!jr(u,a);m&&this._focus(u);const f=Hi(t.to),{config:h}=s,{decay:g,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!f&&function(e,t,n){n&&(Ji(n=Ti({},n),t),t=Ti({},n,t)),Ji(e,t),Object.assign(e,t);for(const t in Qi)null==e[t]&&(e[t]=Qi[t]);let{mass:o,frequency:r,damping:l}=e;$r.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,Ni(t.config,l),t.config!==i.config?Ni(i.config,l):void 0);let b=mi(this);if(!b||$r.und(u))return n(ls(this,!0));const k=$r.und(t.reset)?r&&!t.default:!$r.und(d)&&Pi(t.reset,l),_=k?d:this.get(),y=zi(u),E=$r.num(y)||$r.arr(y)||li(y),C=!f&&(!E||Pi(i.immediate||t.immediate,l));if(m){const e=Ci(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const w=b.constructor;let S=Dl(u),B=!1;if(!S){const e=k||!hs(this)&&p;(m||e)&&(B=jr(zi(_),y),S=!B),(jr(s.immediate,C)||C)&&jr(h.decay,g)&&jr(h.velocity,v)||(S=!0)}if(B&&gs(this)&&(s.changed&&!k?S=!0:S||this._stop(a)),!f&&((S||Dl(a))&&(s.values=b.getPayload(),s.toValues=Dl(u)?null:w==bi?[1]:Yr(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),S)){const{onRest:e}=s;Kr(Bs,(e=>Is(this,t,e)));const o=ls(this,ys(this,a));Qr(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Sr.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Ni(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(ss(t.to,t,this._state,this)):S?this._start():gs(this)&&!m?this._pendingCalls.add(n):n(rs(_))}_focus(e){const t=this.animation;e!==t.to&&(Fl(this)&&this._detach(),t.to=e,Fl(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Dl(t)&&(Ul(t,this),ds(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Dl(e)&&Gl(e,this)}_set(e,t=!0){const n=Ol(e);if(!$r.und(n)){const e=mi(this);if(!e||!jr(n,e.getValue())){const o=Ci(n);e&&e.constructor==o?e.setValue(n):fi(this,o.create(n)),e&&Sr.batchedUpdates((()=>{this._onChange(n,t)}))}}return mi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,xs(this,"onStart",ls(this,ys(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Ni(this.animation.onChange,e,this)),Ni(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;mi(this).reset(Ol(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),gs(this)||(bs(this,!0),vs(this)||this._resume())}_resume(){rl.skipAnimation?this.finish():cl.start(this)}_stop(e,t){if(gs(this)){bs(this,!1);const n=this.animation;Kr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),zl(this,{type:"idle",parent:this});const o=t?is(this.get()):ls(this.get(),ys(this,null!=e?e:n.to));Qr(this._pendingCalls,o),n.changed&&(n.changed=!1,xs(this,"onRest",o,this))}}}function ys(e,t){const n=zi(t);return jr(zi(e.get()),n)}function Es(e,t=e.loop,n=e.to){let o=Ni(t);if(o){const r=!0!==o&&Fi(o),l=(r||e).reverse,i=!r||r.reset;return Cs(Ti({},e,{loop:t,default:!1,pause:void 0,to:!l||Hi(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Cs(e){const{to:t,from:n}=e=Fi(e),o=new Set;return $r.obj(t)&&Ss(t,o),$r.obj(n)&&Ss(n,o),e.keys=o.size?Array.from(o):null,e}function ws(e){const t=Cs(e);return $r.und(t.default)&&(t.default=Ai(t)),t}function Ss(e,t){qr(e,((e,n)=>null!=e&&t.add(n)))}const Bs=["onStart","onRest","onChange","onPause","onResume"];function Is(e,t,n){e.animation[n]=t[n]!==Ri(t,n)?Mi(t[n],e.key):void 0}function xs(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const Ts=["onStart","onChange","onRest"];let Ns=1;class Ps{constructor(e,t){this.id=Ns++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Ti({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(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];$r.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Cs(e)),this}start(e){let{queue:t}=this;return e?t=Yr(e).map(Cs):this.queue=[],this._flush?this._flush(this,t):(Fs(this,t),Ms(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Kr(Yr(t),(t=>n[t].stop(!!e)))}else as(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if($r.und(e))this.start({pause:!0});else{const t=this.springs;Kr(Yr(e),(e=>t[e].pause()))}return this}resume(e){if($r.und(e))this.start({pause:!1});else{const t=this.springs;Kr(Yr(e),(e=>t[e].resume()))}return this}each(e){qr(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,Xr(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&Xr(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Xr(n,(([e,t])=>{t.value=i,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)}Sr.onFrame(this._onFrame)}}function Ms(e,t){return Promise.all(t.map((t=>Rs(e,t)))).then((t=>os(e,t)))}async function Rs(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=$r.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=$r.arr(r)||$r.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Kr(Ts,(n=>{const o=t[n];if($r.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Qr(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Ri(t,"cancel");(u||m&&d.asyncId)&&p.push(ns(++e._lastAsyncId,{props:t,state:d,actions:{pause:Wr,resume:Wr,start(t,n){m?(as(d,e._lastAsyncId),n(is(e))):(t.onRest=s,n(ss(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=os(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=Es(t,i,r);if(n)return Fs(e,[n]),Rs(e,n,!0)}return a&&Sr.batchedUpdates((()=>a(f,e,e.item))),f}function Ls(e,t){const n=Ti({},e.springs);return t&&Kr(Yr(t),(e=>{$r.und(e.keys)&&(e=Cs(e)),$r.obj(e.to)||(e=Ti({},e,{to:void 0})),Os(n,e,(e=>Ds(e)))})),As(e,n),n}function As(e,t){qr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ul(t,e))}))}function Ds(e,t){const n=new _s;return n.key=e,t&&Ul(n,t),n}function Os(e,t,n){t.keys&&Kr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Fs(e,t){Kr(t,(t=>{Os(e.springs,t,(t=>Ds(t,e)))}))}function zs(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const Vs=["children"],Hs=e=>{let{children:t}=e,n=zs(e,Vs);const o=(0,Ur.useContext)(Us),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ur.useState)((()=>({inputs:t,result:e()}))),o=(0,Ur.useRef)(),r=o.current;let l=r;if(l){const n=Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Us;return Ur.createElement(i,{value:n},t)},Us=(Gs=Hs,Ws={},Object.assign(Gs,Ur.createContext(Ws)),Gs.Provider._context=Gs,Gs.Consumer._context=Gs,Gs);var Gs,Ws;Hs.Provider=Us.Provider,Hs.Consumer=Us.Consumer;const $s=()=>{const e=[],t=function(t){ri(`${ti}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Kr(e,((e,r)=>{if($r.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Kr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Kr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Kr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Kr(e,((e,o)=>{if($r.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Kr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Kr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return $r.fun(e)?e(n,t):e};return t._getProps=n,t};function js(e,t,n){const o=$r.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ur.useMemo)((()=>o||3==arguments.length?$s():void 0),[]),l=(0,Ur.useRef)(0),i=ai(),s=(0,Ur.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ls(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ms(e,t):new Promise((o=>{As(e,n),s.queue.push((()=>{o(Ms(e,t))})),i()}))}})),[]),a=(0,Ur.useRef)([...s.ctrls]),c=[],u=ui(e)||0;function d(e,n){for(let r=e;r{Kr(a.current.slice(e,u),(e=>{Ui(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ur.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ls(e,c[t]))),m=(0,Ur.useContext)(Hs),f=ui(m),h=m!==f&&Vi(m);di((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Kr(e,(e=>e()))),Kr(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Gi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ii((()=>()=>{Kr(s.ctrls,(e=>e.stop(!0)))}));const g=p.map((e=>Ti({},e)));return r?[g,r]:g}function Ks(e,t){const n=$r.fun(e),[[o],r]=js(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}let qs;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(qs||(qs={}));class Ys extends ms{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Ml(...t);const n=this._get(),o=Ci(n);fi(this,o.create(n))}advance(e){const t=this._get();jr(t,this.get())||(mi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Qs(this._active)&&Zs(this)}_get(){const e=$r.arr(this.source)?this.source.map(Ol):Yr(Ol(this.source));return this.calc(...e)}_start(){this.idle&&!Qs(this._active)&&(this.idle=!1,Kr(hi(this),(e=>{e.done=!1})),rl.skipAnimation?(Sr.batchedUpdates((()=>this.advance())),Zs(this)):cl.start(this))}_attach(){let e=1;Kr(Yr(this.source),(t=>{Dl(t)&&Ul(t,this),ds(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Kr(Yr(this.source),(e=>{Dl(e)&&Gl(e,this)})),this._active.clear(),Zs(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=Yr(this.source).reduce(((e,t)=>Math.max(e,(ds(t)?t.priority:0)+1)),0))}}function Xs(e){return!1!==e.idle}function Qs(e){return!e.size||Array.from(e).every(Xs)}function Zs(e){e.idle||(e.idle=!0,Kr(hi(e),(e=>{e.done=!0})),zl(e,{type:"idle",parent:e}))}rl.assign({createStringInterpolator:ei,to:(e,t)=>new Ys(e,t)});cl.advance;var Js=window.ReactDOM;function ea(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const ta=["style","children","scrollTop","scrollLeft"],na=/^--/;function oa(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||na.test(e)||la.hasOwnProperty(e)&&la[e]?(""+t).trim():t+"px"}const ra={};let la={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};const ia=["Webkit","Ms","Moz","O"];la=Object.keys(la).reduce(((e,t)=>(ia.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),la);const sa=["x","y","z"],aa=/^(matrix|translate|scale|rotate|skew)/,ca=/^(translate)/,ua=/^(rotate|skew)/,da=(e,t)=>$r.num(e)&&0!==e?e+t:e,pa=(e,t)=>$r.arr(e)?e.every((e=>pa(e,t))):$r.num(e)?e===t:parseFloat(e)===t;class ma extends _i{constructor(e){let{x:t,y:n,z:o}=e,r=ea(e,sa);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>da(e,"px"))).join(",")})`,pa(e,0)]))),qr(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(aa.test(t)){if(delete r[t],$r.und(e))return;const n=ca.test(t)?"px":ua.test(t)?"deg":"";l.push(Yr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${da(r,n)})`,pa(r,0)]:e=>[`${t}(${e.map((e=>da(e,n))).join(",")})`,pa(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new fa(l,i)),super(r)}}class fa extends Vl{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Kr(this.inputs,((n,o)=>{const r=Ol(n[0]),[l,i]=this.transforms[o]($r.arr(r)?r:n.map(Ol));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Kr(this.inputs,(e=>Kr(e,(e=>Dl(e)&&Ul(e,this)))))}observerRemoved(e){0==e&&Kr(this.inputs,(e=>Kr(e,(e=>Dl(e)&&Gl(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),zl(this,e)}}const ha=["scrollTop","scrollLeft"];rl.assign({batchedUpdates:Js.unstable_batchedUpdates,createStringInterpolator:ei,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}});const ga=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new _i(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=xi(e)||"Anonymous";return(e=$r.str(e)?l[e]||(l[e]=Si(e,r)):e[Ii]||(e[Ii]=Si(e,r))).displayName=`Animated(${t})`,e};return qr(e,((t,n)=>{$r.arr(e)&&(n=xi(t)),l[n]=l(t)})),{animated:l}})(["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;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=ea(o,ta),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ra[t]||(ra[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=oa(t,r[t]);na.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new ma(e),getComponentProps:e=>ea(e,ha)}),va=ga.animated,ba=e=>e+1,ka=e=>({top:e.offsetTop,left:e.offsetLeft});var _a=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(ba,0),[u,p]=(0,s.useReducer)(ba,0),[m,f]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?ka(l.current):null),[r]),g=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,rr.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(!function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",g()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void g();l.current.style.transform="";const e=ka(l.current);c(),f({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,Ks({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const ya=".block-editor-block-list__block",Ea=".block-list-appender";function Ca(e,t){return t.closest([ya,Ea].join(","))===e}function wa(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(Fn);if(l(e)&&!o()&&!r())return n()}),[e])}(e);return(0,s.useEffect)((()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const o=rr.focus.tabbable.find(t.current).filter((e=>(0,rr.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;Ca(t.current,l)?(0,rr.placeCaretAtHorizontalEdge)(l,r):t.current.focus()}),[n]),t}function Sa(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Ba(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Fn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Sa),t.addEventListener("mouseover",Sa),()=>{t.removeEventListener("mouseout",Sa),t.removeEventListener("mouseover",Sa),t.classList.remove("is-hovered")}}),[e])}function Ia(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(Fn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),h=n(e),g=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":g,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":g&&f&&d()})}),[e])}function xa(e){return(0,m.useSelect)((t=>{const n=t(Fn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Ta(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Fn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function Na(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Fn);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function Pa(e){const{isBlockSelected:t}=(0,m.useSelect)(Fn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Fn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):Ca(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Ma=window.wp.keycodes;function Ra(e){const t=(0,m.useSelect)((t=>t(Fn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Fn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Fn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==Ma.ENTER&&s!==Ma.BACKSPACE&&s!==Ma.DELETE||a!==i||(0,rr.isTextField)(a)||(t.preventDefault(),s===Ma.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function La(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Fn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Fn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}var Aa=n(5425),Da=n.n(Aa);function Oa(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(Fn);return n(e)||o()===e}),[e]);return(0,s.useEffect)((()=>{if(!n)return;const e=t.current;if(!e)return;if(e.contains(e.ownerDocument.activeElement))return;const o=(0,rr.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&Da()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const Fa=(0,s.createContext)();function za(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Fa.Provider,{value:n},t)}function Va(e){const{refs:t,callbacks:n}=(0,s.useContext)(Fa),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Ha(e){const{refs:t}=(0,s.useContext)(Fa),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Ua(e){const{callbacks:t}=(0,s.useContext)(Fa),n=Ha(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Ga(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach((e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}function Wa(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(Fn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(Fn);return(0,d.useRefEffect)((u=>{const{ownerDocument:d}=u,{defaultView:p}=d;let m,f;function h(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void Ga(u,!0);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ya);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(Ga(u,!0),l.rangeCount)){const{commonAncestorContainer:e}=l.getRangeAt(0);m.contains(e)&&m.focus()}}else{const t=[...s(e),e],n=[...s(i),i],r=Math.min(t.length,n.length)-1;o(t[r],n[r])}}function g(){d.removeEventListener("selectionchange",h),p.removeEventListener("mouseup",g),f=p.requestAnimationFrame((()=>{h({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",h),p.addEventListener("mouseup",g),Ga(u,!1))}function b(t){if(l()&&0===t.button)if(t.shiftKey){const n=a(),r=s(n);if(n&&n!==e&&(null==r||!r.includes(e))){const l=[...r,n],i=[...s(e),e],a=Math.min(l.length,i.length)-1,c=l[a],d=i[a];c!==d&&(Ga(u,!1),o(c,d),t.preventDefault())}}else c()&&r(e)}return u.addEventListener("mousedown",b),u.addEventListener("mouseleave",v),()=>{u.removeEventListener("mousedown",b),u.removeEventListener("mouseleave",v),d.removeEventListener("selectionchange",h),p.removeEventListener("mouseup",g),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function $a(){const e=(0,s.useContext)(Nm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function ja(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(Ka),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:g,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Fn),p=a(n),m=c(n)||u(n),f=l(n),h=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,h.sprintf)((0,h.__)("Block: %s"),g),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,wa(n),Oa(n),Va(n),Pa(n),Wa(n),Ra(n),La(n),Ba(),$a(),_a({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Un();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":g,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,Ia(n),xa(n),Ta(n),Na(n)),style:{...l.style,...e.style}}}ja.save=r.__unstableGetBlockProps;const Ka=(0,s.createContext)();function qa(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",ja(o,{__unstableIsHtml:n}),t)}const Ya=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(Fn),d=a(n),p=r(n),m=s(o),f=c(n,o),h=u(n,o),{name:g,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:h,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),Xa=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Fn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Fn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(Fn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Fn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Qa=(0,d.compose)(d.pure,Ya,Xa,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:o,clientId:l,isSelected:i,isSelectionEnabled:a,className:d,name:p,isValid:f,attributes:h,wrapperProps:g,setAttributes:v,onReplace:b,onInsertBlocksAfter:k,onMerge:_,toggleSelection:y}=e;const{removeBlock:E}=(0,m.useDispatch)(Fn),C=(0,s.useCallback)((()=>E(l)),[l]);let w=(0,s.createElement)(ur,{name:p,isSelected:i,attributes:h,setAttributes:v,insertBlocksAfter:n?void 0:k,onReplace:o?b:void 0,onRemove:o?C:void 0,mergeBlocks:o?_:void 0,clientId:l,isSelectionEnabled:a,toggleSelection:y});const S=(0,r.getBlockType)(p);null!=S&&S.getEditWrapperProps&&(g=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(g,S.getEditWrapperProps(h)));const B=g&&!!g["data-align"];let I;if(B&&(w=(0,s.createElement)("div",{className:"wp-block","data-align":g["data-align"]},w)),f)I="html"===t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},w),(0,s.createElement)(qa,{isHtml:!0},(0,s.createElement)(Cr,{clientId:l}))):(null==S?void 0:S.apiVersion)>1?w:(0,s.createElement)(qa,g,w);else{const e=(0,r.getSaveContent)(S,h);I=(0,s.createElement)(qa,{className:"has-warning"},(0,s.createElement)(vr,{clientId:l}),(0,s.createElement)(s.RawHTML,null,(0,rr.safeHTML)(e)))}const x={clientId:l,className:d,wrapperProps:(0,u.omit)(g,["data-align"]),isAligned:B},T=(0,s.useMemo)((()=>x),Object.values(x));return(0,s.createElement)(Ka.Provider,{value:T},(0,s.createElement)(yr,{fallback:(0,s.createElement)(qa,{className:"has-warning"},(0,s.createElement)(kr,null))},I))})),Za=window.wp.htmlEntities;var Ja=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const ec=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")];var tc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*ec.length));return(0,s.createElement)(p.Tip,null,ec[e])};var nc=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));var oc=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:nc});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)}));var rc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Rt()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(oc,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))};function lc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(Fn),{getBlockName:g,getBlocks:v}=a.select(Fn),b=(0,m.useSelect)((e=>!t||e(Fn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(Fn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===g(t))return;if(!(!t||i(t)))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);if(p||u&&!p&&a&&!c){c=a,k.current.outgoing.push(s);(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>d()}),[a,t])}var ic=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(Dn,On),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Fn);return(0,s.useEffect)((()=>{o(n)}),[n]),lc(e),(0,s.createElement)(za,null,t)}));function sc(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(Mm,null)))}function ac(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Fn),{clearSelectedBlock:n}=(0,m.useDispatch)(Fn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function cc(e){return(0,s.createElement)("div",i({ref:ac()},e))}function uc(e,t){const n="start"===t?"firstChild":"lastChild",o="start"===t?"nextSibling":"previousSibling";for(;e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[o];)e=e[o];return e}function dc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r}=e(Fn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r()}}function pc(){const{isMultiSelecting:e,multiSelectedBlockClientIds:t,hasMultiSelection:n,selectedBlockClientId:o}=(0,m.useSelect)(dc,[]),r=Ha(o),l=Ha((0,u.first)(t)),i=Ha((0,u.last)(t));return(0,d.useRefEffect)((s=>{const{ownerDocument:a}=s,{defaultView:c}=a;if(!n||e){if(!o||e)return;const t=c.getSelection();if(t.rangeCount&&!t.isCollapsed){const e=r.current,{startContainer:n,endContainer:o}=t.getRangeAt(0);!e||e.contains(n)&&e.contains(o)||t.removeAllRanges()}return}const{length:u}=t;if(u<2)return;if(!l.current||!i.current)return;s.focus();const d=c.getSelection(),p=a.createRange(),m=uc(l.current,"start"),f=uc(i.current,"end");var h,g;h=s,g=!1,Array.from(h.querySelectorAll(".rich-text")).forEach((e=>{g?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")})),p.setStartBefore(m),p.setEndAfter(f),d.removeAllRanges(),d.addRange(p)}),[n,e,t,o])}function mc(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function fc(e,t,n,o){let r,l=rr.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!rr.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function hc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(Fn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(Fn);return(0,d.useRefEffect)((d=>{let p;function m(){p=null}function f(l){const i=e(),s=t(),a=n(),d=o(a||i),p=r(a||i),m=l?d:p;m&&(s===m?u(m):c(s||i,m))}function h(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function g(e,t){const n=fc(e,t,d);return!n||!function(e,t){return e.closest(ya)===t.closest(ya)}(e,n)}function v(t){const{keyCode:l,target:i}=t,c=l===Ma.UP,u=l===Ma.DOWN,m=l===Ma.LEFT,v=l===Ma.RIGHT,b=c||m,k=m||v,_=c||u,y=k||_,E=t.shiftKey,C=E||t.ctrlKey||t.altKey||t.metaKey,w=_?rr.isVerticalEdge:rr.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:B}=S;if(a()){if(y){(E?f:h)(b),t.preventDefault()}return}if(_?p||(p=(0,rr.computeCaretRect)(B)):p=null,t.defaultPrevented)return;if(!y)return;if(!function(e,t,n){if((t===Ma.UP||t===Ma.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,C))return;const I=(0,rr.isRTL)(i)?!b:b,{keepCaretInsideBlock:x}=s(),T=e();if(E){const e=n(),l=o(e||T),s=r(e||T);(b&&l||!b&&s)&&g(i,b)&&w(i,b)&&(f(b),t.preventDefault())}else if(_&&(0,rr.isVerticalEdge)(i,b)&&!x){const e=fc(i,b,d,!0);e&&((0,rr.placeCaretAtVerticalEdge)(e,b,p),t.preventDefault())}else if(k&&B.getSelection().isCollapsed&&(0,rr.isHorizontalEdge)(i,I)&&!x){const e=fc(i,I,d);(0,rr.placeCaretAtHorizontalEdge)(e,b),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",v),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",v)}}),[])}var gc=window.wp.keyboardShortcuts;function vc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Fn),{multiSelect:o}=(0,m.useDispatch)(Fn),r=(0,gc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;if(!(0,rr.isEntirelySelected)(l.target))return;const i=t(),[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function bc(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(Fn),{setNavigationMode:a}=(0,m.useDispatch)(Fn),c=(0,m.useSelect)((e=>e(Fn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";rr.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),g=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Ma.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Ma.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(mc(e.target)&&mc(rr.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Ma.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=rr.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,g]),h]}(),o=(0,m.useSelect)((e=>e(Fn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,pc(),vc(),hc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var kc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=bc();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const _c="editor-styles-wrapper";function yc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Ec=(0,s.forwardRef)((function(e,t){var n,o;let{contentRef:r,children:l,head:a,tabIndex:u=0,...m}=e;const[,f]=(0,s.useReducer)((()=>({}))),[g,v]=(0,s.useState)(),[b,k]=(0,s.useState)([]),_=yc(null===(n=window.__editorAssets)||void 0===n?void 0:n.styles),y=yc(null===(o=window.__editorAssets)||void 0===o?void 0:o.scripts),E=ac(),[C,w,S]=bc(),B=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),v(t),E(r),k(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",(()=>{t()}))}),[]),I=(0,d.useRefEffect)((e=>{y.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{f()}))}),[]),x=(0,d.useMergeRefs)([r,E,w]);return(0,s.useEffect)((()=>{var e;g&&(e=g,Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${_c}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[g]),a=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),_.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),a),(0,s.createElement)(s.Fragment,null,u>=0&&C,(0,s.createElement)("iframe",i({},m,{ref:(0,d.useMergeRefs)([t,B]),tabIndex:u,title:(0,h.__)("Editor canvas")}),g&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:I},a),(0,s.createElement)("body",{ref:x,className:c()(_c,...b)},(0,s.createElement)(p.__experimentalStyleProvider,{document:g},l))),g.documentElement)),u>=0&&S)})),Cc={grad:.9,turn:360,rad:360/(2*Math.PI)},wc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Sc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Bc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Ic=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},xc=function(e){return{r:Bc(e.r,0,255),g:Bc(e.g,0,255),b:Bc(e.b,0,255),a:Bc(e.a)}},Tc=function(e){return{r:Sc(e.r),g:Sc(e.g),b:Sc(e.b),a:Sc(e.a,3)}},Nc=/^#([0-9a-f]{3,8})$/i,Pc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Mc=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},Rc=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},Lc=function(e){return{h:Ic(e.h),s:Bc(e.s,0,100),l:Bc(e.l,0,100),a:Bc(e.a)}},Ac=function(e){return{h:Sc(e.h),s:Sc(e.s),l:Sc(e.l),a:Sc(e.a,3)}},Dc=function(e){return Rc((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},Oc=function(e){return{h:(t=Mc(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Fc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Vc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Hc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Uc={string:[[function(e){var t=Nc.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?Sc(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?Sc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Vc.exec(e)||Hc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:xc({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=Fc.exec(e)||zc.exec(e);if(!t)return null;var n,o,r=Lc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Cc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Dc(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return wc(t)&&wc(n)&&wc(o)?xc({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!wc(t)||!wc(n)||!wc(o))return null;var i=Lc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Dc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!wc(t)||!wc(n)||!wc(o))return null;var i=function(e){return{h:Ic(e.h),s:Bc(e.s,0,100),v:Bc(e.v,0,100),a:Bc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Rc(i)},"hsv"]]},Gc=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Tc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Pc(Sc(255*r)):"","#"+Pc(t)+Pc(n)+Pc(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Tc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Tc(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Ac(Oc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Ac(Oc(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Mc(this.rgba),{h:Sc(e.h),s:Sc(e.s),v:Sc(e.v),a:Sc(e.a,3)};var e},e.prototype.invert=function(){return Yc({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),Yc($c(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Yc($c(this.rgba,-e))},e.prototype.grayscale=function(){return Yc($c(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Yc(Kc(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Yc(Kc(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?Yc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Sc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Oc(this.rgba);return"number"==typeof e?Yc({h:e,s:t.s,l:t.l,a:t.a}):Sc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Yc(e).toHex()},e}(),Yc=function(e){return e instanceof qc?e:new qc(e)},Xc=[],Qc=function(e){e.forEach((function(e){Xc.indexOf(e)<0&&(e(qc,Uc),Xc.push(e))}))};function Zc(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"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m(a=eu(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var nu=n(3124),ou=n.n(nu);const ru=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function lu(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=w()||S());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function g(){const e=p(/^([^{]+)/);if(e)return iu(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=iu(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(ru,""),value:n?iu(n[0]).replace(ru,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function w(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=iu(t[1]);if(!c())return a("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:iu(t[1]),media:iu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=iu(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=iu(t[1]),o=iu(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=g()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function S(){const e=l(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return su(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function iu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function su(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){su(e,o)})):n&&"object"==typeof n&&su(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var au=n(8575),cu=n.n(au),uu=du;function du(e){this.options=e||{}}du.prototype.emit=function(e){return e},du.prototype.visit=function(e){return this[e.type](e)},du.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};vu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+bu(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const _u=/^(body|html|:root).*$/;var yu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>{const o=n=>t.includes(n.trim())?n:n.match(_u)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var Eu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(yu(t)),o&&r.push(ku(o)),r.length?gu(n,(0,d.compose)(r)):n}))};const Cu=".editor-styles-wrapper";function wu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Cu);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Yc(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Su(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Eu(t,Cu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:wu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let Bu;Qc([Zc,tu]);const Iu=2e3;var xu=function(e){let{viewportWidth:t,__experimentalPadding:n}=e;const[o,{width:r}]=(0,d.useResizeObserver)(),[l,{height:i}]=(0,d.useResizeObserver)(),a=(0,m.useSelect)((e=>e(Fn).getSettings().styles),[]),c=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);Bu=Bu||(0,d.pure)(Mm);const u=r/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},o,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${u})`,height:i*u,maxHeight:i>Iu?Iu*u:void 0}},(0,s.createElement)(Ec,{head:(0,s.createElement)(Su,{styles:c}),contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:Iu}},l,(0,s.createElement)(Bu,{renderAppender:!1}))))};var Tu=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l}=e;const i=(0,m.useSelect)((e=>e(Fn).getSettings()),[]),a=(0,s.useMemo)((()=>{const e={...i};return e.__experimentalBlockPatterns=[],e}),[i]),c=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(ic,{value:c,settings:a},r?(0,s.createElement)(sc,{onClick:l}):(0,s.createElement)(xu,{viewportWidth:o,__experimentalPadding:n})):null}));function Nu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Fn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(ic,{value:p,settings:a},(0,s.createElement)(Lm,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var Pu=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(Tu,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!p&&(0,s.createElement)(rc,{title:i,icon:a,description:c}))};var Mu=(0,s.createContext)();var Ru=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(Mu);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))}));var Lu=(0,s.createElement)(O.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},(0,s.createElement)(O.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));function Au(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(oc,{icon:n}):(0,h.sprintf)((0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(oc,{icon:Lu})))))}var Du=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,s.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,s.createElement)(Au,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function Ou(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var Fu=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Du,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(Ru,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,Ou()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Ma.ENTER&&(e.preventDefault(),l(o,Ou()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,s.createElement)(oc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))}));var zu=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Nt.speak)((0,h.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var Vu=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(Mu);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))}));var Hu=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(zu,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let o=0,r=e.length;o(0,s.createElement)(Vu,{key:t},e.map(((e,l)=>(0,s.createElement)(Fu,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)};var Uu=function(e){let{title:t,icon:n,children:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,s.createElement)(p.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var Gu=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Fn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const s=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]};var Wu=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(Mu.Provider,{value:n},t)};const $u=[];var ju=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Gu(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,s.useMemo)((()=>l.filter((e=>!e.category))),[l]),f=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),g=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:$u);return(0,s.createElement)(Wu,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Uu,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(Hu,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(Uu,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Hu,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Uu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(Hu,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,s.createElement)(Uu,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Hu,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))};var Ku=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:r}=e;const l=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(p.FlexItem,{isBlock:!0},(0,s.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,h.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},qu=window.wp.notices;var Yu=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Fn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(qu.store),i=(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)((0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,i]};function Xu(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(Xu)}`;return(0,s.createElement)(Du,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,s.createElement)(Tu,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function Qu(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Zu=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(Xu,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Qu,{key:e.name}))))};function Ju(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function ed(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}var td=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(ed,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Ju,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var nd=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(wo,{className:"block-editor-inserter__no-results-icon",icon:nc}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))};var od=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Fn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Fn),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:g,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Fn),k=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?f(o.clientId,e,null,a||n?0:null,t):g(e,p,d,!0,a||n?0:null,t);const s=(0,h.sprintf)((0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Nt.speak)(s),i&&i()}),[l,c,f,g,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const rd=e=>e.name||"",ld=e=>e.title,id=e=>e.description||"",sd=e=>e.keywords||[],ad=e=>e.category,cd=()=>null;function ud(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const dd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(ud(e))},pd=(e,t)=>(0,u.differenceWith)(e,dd(t),((e,t)=>t.includes(e))),md=(e,t,n,o)=>{if(0===dd(o).length)return e;return fd(e,o,{getCategory:e=>{var n;return null===(n=(0,u.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}})},fd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=dd(t);if(0===o.length)return e;const r=e.map((e=>[e,hd(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function hd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=rd,getTitle:r=ld,getDescription:l=id,getKeywords:i=sd,getCategory:s=ad,getCollection:a=cd}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),h=a(e),g=ud(t),v=ud(d);let b=0;if(g===v)b+=30;else if(v.startsWith(g))b+=20;else{const e=[c,d,p,...m,f,h].join(" "),t=(0,u.words)(g);0===pd(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&b++,b}function gd(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(p.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,h.sprintf)((0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var vd=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Nt.speak,500),[l,i]=od({shouldFocusBlock:!0}),[a,,c]=Yu(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?fd(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!u.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,s.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,h.sprintf)((0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(gd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Wu,null,!f&&(0,s.createElement)(nd,null),f&&(0,s.createElement)(Zu,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function bd(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(td,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(vd,{filterValue:o,selectedCategory:l,patternCategories:n}))}var kd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(bd,n))};function _d(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Yu(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,s.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,s.useMemo)((()=>c.sort(((e,t)=>a(e)-a(t)))),[c,a]),p=(0,d.useAsyncList)(u);return c.length?(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,s.createElement)(Zu,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var yd=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Yu(),u=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,s.useMemo)((()=>{const e=c.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,h._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,!l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ku,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),(0,s.createElement)(_d,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d})),l&&(0,s.createElement)(kd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Ed=window.wp.url;function Cd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Gu(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(nd,null):(0,s.createElement)(Uu,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(Hu,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}var wd=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Cd,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,Ed.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))};const{Fill:Sd,Slot:Bd}=(0,p.createSlotFill)("__unstableInserterMenuExtension");Sd.Slot=Bd;var Id=Sd;const xd=[];var Td=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:g=!0,shouldFocusBlock:v=!0}=e;const b=(0,d.useDebounce)(Nt.speak,500),[k,_]=od({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[y,E,C,w]=Gu(k,_),[S,,B]=Yu(_,k),I=(0,s.useMemo)((()=>{const e=md((0,u.orderBy)(y,["frecency"],["desc"]),E,C,t);return void 0!==m?e.slice(0,m):e}),[t,y,E,C,m]),x=(0,s.useMemo)((()=>{const e=fd(S,t);return void 0!==c?e.slice(0,c):e}),[t,S,c]);(0,s.useEffect)((()=>{if(!t)return;const e=I.length+x.length,n=(0,h.sprintf)((0,h._n)("%d result found.","%d results found.",e),e);b(n)}),[t,b]);const T=(0,d.useAsyncList)(I,{step:9}),N=(0,d.useAsyncList)(T.length===I.length?x:xd),P=!(0,u.isEmpty)(I)||!(0,u.isEmpty)(x);return(0,s.createElement)(Wu,null,!f&&!P&&(0,s.createElement)(nd,null),!!I.length&&(0,s.createElement)(Uu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(Hu,{items:T,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:g})),!!I.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),!!x.length&&(0,s.createElement)(Uu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Zu,{shownPatterns:N,blockPatterns:x,onClickPattern:B,isDraggable:g}))),f&&(0,s.createElement)(Id.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:P,rootClientId:k}},(e=>e.length?e:P?null:(0,s.createElement)(nd,null))))};const Nd={name:"blocks",title:(0,h.__)("Blocks")},Pd={name:"patterns",title:(0,h.__)("Patterns")},Md={name:"reusable",title:(0,h.__)("Reusable")};var Rd=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[Nd];return n&&e.push(Pd),o&&e.push(Md),e}),[Nd,n,Pd,o,Md]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)};var Ld=function(e){let{rootClientId:t,clientId:n,isAppender:o,__experimentalInsertionIndex:r,onSelect:l,showInserterHelpPanel:i,showMostUsedBlocks:a,__experimentalFilterValue:c="",shouldFocusBlock:u=!0}=e;const[d,f]=(0,s.useState)(c),[g,v]=(0,s.useState)(null),[b,k]=(0,s.useState)(null),[_,y,E]=od({rootClientId:t,clientId:n,isAppender:o,insertionIndex:r,shouldFocusBlock:u}),{showPatterns:C,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Fn);return{showPatterns:!!n(_).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[_]),S=(0,s.useCallback)(((e,t,n)=>{y(e,t,n),l()}),[y,l]),B=(0,s.useCallback)(((e,t)=>{y(e,{patternName:t}),l()}),[y,l]),I=(0,s.useCallback)((e=>{E(!!e),v(e)}),[E,v]),x=(0,s.useCallback)((e=>{k(e)}),[k]),T=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(ju,{rootClientId:_,onInsert:S,onHover:I,showMostUsedBlocks:a})),i&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(tc,null)))),[_,S,I,d,a,i]),N=(0,s.useMemo)((()=>(0,s.createElement)(yd,{rootClientId:_,onInsert:B,onClickCategory:x,selectedCategory:b})),[_,B,x,b]),P=(0,s.useMemo)((()=>(0,s.createElement)(wd,{rootClientId:_,onInsert:S,onHover:I})),[_,S,I]),M=(0,s.useCallback)((e=>"blocks"===e.name?T:"patterns"===e.name?N:P),[T,N,P]);return(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:"block-editor-inserter__main-area"},(0,s.createElement)("div",{className:"block-editor-inserter__content"},(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{g&&v(null),f(e)},value:d,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),!!d&&(0,s.createElement)(Td,{filterValue:d,onSelect:l,onHover:I,rootClientId:t,clientId:n,isAppender:o,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:u}),!d&&(C||w)&&(0,s.createElement)(Rd,{showPatterns:C,showReusableBlocks:w},M),!d&&!C&&!w&&T)),i&&g&&(0,s.createElement)(Pu,{item:g}))};function Ad(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=od({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=Gu(a,u),[f]=Yu(u,a),g=f.length&&!!l,v=g&&f.length>6||d.length>6,{setInserterIsOpened:b,insertionIndex:k}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(Fn),l=n(o);return{setInserterIsOpened:t().__experimentalSetIsInserterOpened,insertionIndex:-1===l?r():l}}),[o,n]);(0,s.useEffect)((()=>{b&&b(!1)}),[b]);return(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":v,"has-expand":b})},v&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Td,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:g?2:0,maxBlockTypes:6,isDraggable:!1})),b&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{b({rootClientId:n,insertionIndex:k,filterValue:l})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Dd=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,h.sprintf)((0,h._x)("Add %s","directly add the only allowed block"),l):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:Ja,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),u&&u(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},d))};class Od extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Dd}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?(0,s.createElement)(Ad,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(Ld,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||null!=n&&n.length?this.renderToggle({onToggle:o}):(0,s.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var Fd=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(Fn),{getBlockVariations:c}=e(r.store);o=o||l(n)||void 0;const d=s(o),p=a(o),m=1===(0,u.size)(d)&&0===(0,u.size)(c(d[0].name,"inserter"));let f=!1;return m&&(f=d[0]),{hasItems:i(o),hasSingleBlockType:m,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:o}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!(s||null!=c&&c.length))return;const{insertBlock:d}=e(Fn);d(null!=c&&c.length?(0,r.createBlock)(...c):(0,r.createBlock)(a.name),function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(Fn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const p=(0,h.sprintf)((0,h.__)("%s block added"),a.title);(0,Nt.speak)(p)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Od);var zd=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getBlockName:o,isBlockValid:l,getSettings:i,getTemplateLock:s}=e(Fn),a=!n(t.rootClientId),c=o(t.lastBlockClientId)===(0,r.getDefaultBlockName)(),u=l(t.lastBlockClientId),{bodyPlaceholder:d}=i();return{isVisible:a||!c||!u,showPrompt:a,isLocked:!!s(t.rootClientId),placeholder:d}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Fn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,isVisible:n,onAppend:o,showPrompt:r,placeholder:l,rootClientId:i}=e;if(t||!n)return null;const a=(0,Za.decodeEntities)(l)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":i||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":r})},(0,s.createElement)("p",{tabIndex:"0",contentEditable:!0,suppressContentEditableWarning:!0,role:"button","aria-label":(0,h.__)("Add block"),className:"block-editor-default-block-appender__content",onFocus:o},r?a:"\ufeff"),(0,s.createElement)(Fd,{rootClientId:i,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Vd(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Fd,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(0,h.sprintf)((0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const f=!m;let g=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(wo,{icon:Ja}));return(f||m)&&(g=(0,s.createElement)(p.Tooltip,{text:n},g)),g},isAppender:!0})}const Hd=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender"}),Vd(e,t))));var Ud=(0,s.forwardRef)(Vd);var Gd=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{getBlockOrder:o,canInsertBlockType:l,getTemplateLock:i,getSelectedBlockClientId:s}=e(Fn);return{isLocked:!!i(n),blockClientIds:o(n),canInsertDefaultBlock:l((0,r.getDefaultBlockName)(),n),selectedBlockClientId:s()}}))((function(e){let t,{blockClientIds:n,rootClientId:o,canInsertDefaultBlock:r,isLocked:l,renderAppender:i,className:a,selectedBlockClientId:d,tagName:p="div"}=e;if(l||!1===i)return null;if(i)t=(0,s.createElement)(i,null);else{const e=!o,l=d===o,i=d&&!n.includes(d);if(!e&&!l&&(!d||i))return null;t=r?(0,s.createElement)(zd,{rootClientId:o,lastBlockClientId:(0,u.last)(n)}):(0,s.createElement)(Ud,{rootClientId:o,className:"block-list-appender__toggle"})}return(0,s.createElement)(p,{tabIndex:-1,className:c()("block-list-appender wp-block",a),"data-block":!0},t)}));function Wd(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])}const $d=(0,s.createContext)();function jd(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o}=(0,m.useDispatch)(Fn),r=(0,s.useContext)($d),l=(0,s.useRef)(),{orientation:i,previousClientId:a,nextClientId:u,rootClientId:f,isInserterShown:g}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Fn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),v=Ua(a),b=Ua(u),k="vertical"===i,_=(0,s.useMemo)((()=>{if(!v&&!b)return{};const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;if(k)return{width:v?v.offsetWidth:b.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:v?v.offsetHeight:b.offsetHeight}}),[v,b]),y=(0,s.useCallback)((()=>{if(!v&&!b)return{};const{ownerDocument:e}=v||b,t=v?v.getBoundingClientRect():null,n=b?b.getBoundingClientRect():null;return k?(0,h.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,h.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[v,b]),E=Wd(n),C=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+i);const S=v&&b&&g,B={start:{...k?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...k?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:S?.4:0}},hover:{...k?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},I={start:{scale:C?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:E,noArrow:!0,animate:!1,getAnchorRect:y,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:u+"--"+f},(0,s.createElement)(p.__unstableMotion.div,{layout:!C,initial:C?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&u&&o(u,-1)},onFocus:function(e){e.target!==l.current&&(r.current=!0)},className:c()(w,{"is-with-inserter":S}),style:_},(0,s.createElement)(p.__unstableMotion.div,{variants:B,className:"block-editor-block-list__insertion-point-indicator"}),S&&(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Fd,{position:"bottom center",clientId:u,rootClientId:f,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function Kd(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(Fn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)($d.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(jd,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function qd(){const e=(0,s.useContext)($d),t=(0,m.useSelect)((e=>e(Fn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Fn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Fn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(!t.target.classList.contains("is-root-container")){d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),h=t.clientY-f.top,g=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>g));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientYk.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Xd="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Qd(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Fn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description}:d}),[e])}function Zd(e){let{clientId:t}=e;const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(Fn),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),i=Qd(t);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a;return c&&c!==s.title?(0,u.truncate)(c,{length:35}):i.title}var Jd=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:o,getTemplateLock:l,getBlockName:i}=e(Fn),s=o(n[0]),a=s?l(s):null,c=i(n[0]);return{srcRootClientId:s,isDraggable:"all"!==a,icon:null===(t=(0,r.getBlockType)(c))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,h,g]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,rr.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(Fn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,g(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Au,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var ep=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Qd(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Fn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:g,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(Fn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Nt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:w,getBlockRootClientId:S,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Fn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Fn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),O=(0,h.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(oc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Jd,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Lu,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===Ma.UP,l=n===Ma.DOWN,i=n===Ma.LEFT,s=n===Ma.RIGHT,a=n===Ma.TAB,c=n===Ma.ESCAPE,u=n===Ma.ENTER,d=n===Ma.SPACE,p=e.shiftKey;if(n===Ma.BACKSPACE||n===Ma.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),h=T(f||m),g=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=h;else if(b)E=g;else if(_){var D;E=null!==(D=S(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&P()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=S(F),t=S(m),n=w(F);let o=w(m);n{!function(e){const[t]=rr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,gc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=tp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=tp(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var op=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!rr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Rt()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return np(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)};var rp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var lp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var ip=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var sp=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function ap(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,h.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;if(r<0&&n)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if(r>0&&o)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if(r<0&&!n)return(0,h.sprintf)((0,h._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l);if(r>0&&!o)return(0,h.sprintf)((0,h._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l)}(e,n,o,r,l);if(o&&r)return(0,h.sprintf)((0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=a("down");if("down"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=a("up");if("up"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const cp=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?rp:lp:ip:"down"===e?"horizontal"===t?(0,h.isRTL)()?lp:rp:sp:null,up=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,dp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(dp),h=(0,u.castArray)(n).length,{blockType:g,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Fn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),h=t((0,u.last)(d)),g=s(m),v=a(p),b=0===f,k=h===g.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:w}=(0,m.useDispatch)(Fn),S="up"===o?w:C,B=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:cp(o,E),label:up(o,E),"aria-describedby":B},a,{onClick:v?null:e=>{S(n,b),a.onClick&&a.onClick(e)},"aria-disabled":v})),(0,s.createElement)("span",{id:B,className:"block-editor-block-mover-button__description"},ap(h,g&&g.title,y,k,_,"up"===o?-1:1,E)))})),pp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(dp,i({direction:"up",ref:t},e)))),mp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(dp,i({direction:"down",ref:t},e))));var fp=(0,m.withSelect)(((e,t)=>{var n;let{clientIds:o}=t;const{getBlock:l,getBlockIndex:i,getBlockListSettings:s,canMoveBlocks:a,getBlockOrder:c,getBlockRootClientId:d}=e(Fn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),h=d((0,u.first)(p)),g=i(m),v=0===g,b=i((0,u.last)(p))===c(h).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:a(o,h),rootClientId:h,firstIndex:g,isFirst:v,isLast:b,orientation:null===(n=s(h))||void 0===n?void 0:n.orientation}}))((function(e){let{isFirst:t,isLast:n,clientIds:o,canMove:r,isHidden:l,rootClientId:a,orientation:u,hideDragHandle:d}=e;const[m,f]=(0,s.useState)(!1),g=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!a)return null;const b=(0,h.__)("Drag");return(0,s.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,s.createElement)(Jd,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,s.createElement)(p.Button,i({icon:Lu,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:b,tabIndex:"-1"},e)))),(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,{onFocus:g,onBlur:v},(e=>(0,s.createElement)(pp,i({clientIds:o},e)))),(0,s.createElement)(p.ToolbarItem,{onFocus:g,onBlur:v},(e=>(0,s.createElement)(mp,i({clientIds:o},e))))))}));const{clearTimeout:hp,setTimeout:gp}=window,vp=200;function bp(e){let{ref:t,isFocused:n,debounceTimeout:o=vp,onChange:r=u.noop}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},p=()=>{const e=a.current;e&&hp&&hp(e)};return(0,s.useEffect)((()=>()=>p()),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),p(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),p(),a.current=gp((()=>{d()&&c(!1)}),o)}}}function kp(e){let{ref:t,debounceTimeout:n=vp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=bp({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,s.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),a())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function _p(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Fn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Fn),{hasBlockSupport:i}=e(r.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=Qd(n),c=(0,s.useRef)(),{gestures:u}=kp({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,s.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,s.createElement)(p.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,h.sprintf)((0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(oc,{icon:a.icon})}))}var yp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function Ep(e){let{blocks:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,s.createElement)(Tu,{viewportWidth:500,blocks:t})))))}var Cp=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,a]=(0,s.useState)();return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Transform to"),className:t},i&&(0,s.createElement)(Ep,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,s.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>a(null),onMouseEnter:()=>a(t)},(0,s.createElement)(oc,{icon:n,showColors:!0}),l)})))},wp=window.wp.tokenList,Sp=n.n(wp);const Bp={};function Ip(e){let{genericPreviewBlock:t,viewportWidth:n,style:o,isActive:r,onBlur:l,onHover:i,onSelect:a,styleClassName:u,itemRole:d}=e;const p=(0,s.useMemo)((()=>({...t,attributes:{...t.attributes,className:u}})),[t,u]);return(0,s.createElement)("div",{key:o.name,className:c()("block-editor-block-styles__item",{"is-active":r}),onClick:()=>a(),onKeyDown:e=>{Ma.ENTER!==e.keyCode&&Ma.SPACE!==e.keyCode||(e.preventDefault(),a())},onMouseEnter:i,onMouseLeave:l,role:d||"button",tabIndex:"0","aria-label":o.label||o.name},(0,s.createElement)("div",{className:"block-editor-block-styles__item-preview"},(0,s.createElement)(Tu,{viewportWidth:n,blocks:p})),(0,s.createElement)("div",{className:"block-editor-block-styles__item-label"},o.label||o.name))}var xp=function(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,itemRole:l}=e;const{styles:i,block:a,type:c,className:d}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Fn),o=n(t);if(!o)return Bp;const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,type:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:p}=(0,m.useDispatch)(Fn),f=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(a,c);if(!i||0===i.length)return null;const g=(0,u.find)(i,"isDefault")?i:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...i],v=function(e,t){for(const n of new(Sp())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,u.find)(e,{name:t});if(o)return o}return(0,u.find)(e,"isDefault")}(g,d);return(0,s.createElement)("div",{className:"block-editor-block-styles"},g.map((e=>{var r,i;const a=function(e,t,n){const o=new(Sp())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}(d,v,e);return(0,s.createElement)(Ip,{genericPreviewBlock:f,viewportWidth:null!==(r=null===(i=c.example)||void 0===i?void 0:i.viewportWidth)&&void 0!==r?r:500,className:d,isActive:v===e,key:e.name,onSelect:()=>{p(t,{className:a}),o(null),n()},onBlur:()=>o(null),onHover:()=>o(a),style:e,styleClassName:a,itemRole:l})})))};function Tp(e){let{hoveredBlock:t,onSwitch:n}=e;const{name:o,clientId:l}=t,[i,a]=(0,s.useState)(),c=(0,m.useSelect)((e=>e(r.store).getBlockType(o)),[o]);return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},i&&(0,s.createElement)(Ep,{blocks:c&&c.example?(0,r.getBlockFromExample)(c.name,{attributes:{...c.example.attributes,className:i},innerBlocks:c.example.innerBlocks}):(0,r.cloneBlock)(t,{className:i})}),(0,s.createElement)(xp,{clientId:l,onSwitch:n,onHoverClassName:a,itemRole:"menuitem"}))}const Np=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=Np(e,t,n);if(o)return o}}},Pp=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var Mp=(e,t)=>(0,s.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=Np(r,t.name,o);if(n){e=!0,o.add(n.clientId),Pp(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Rp(e){let{patterns:t,onSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,s.createElement)(Lp,{patterns:t,onSelect:n})))))}function Lp(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,s.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Ap,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Ap(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Ap,`${r}-list__item-description`);return(0,s.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(Tu,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(p.VisuallyHidden,{id:l},t.description))}var Dp=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,s.useState)(!1),i=Mp(n,t);return i.length?(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,s.createElement)(Rp,{patterns:i,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:rp},(0,h.__)("Patterns"))):null};const Op=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Fn),l=Qd(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:g}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Fn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Fn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,h=1===n.length,g=h&&c(f);let v;if(h)v=null==l?void 0:l.icon;else{var b;v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:yp}return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==g||!g.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:a(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&a,_=!(null==g||!g.length)&&a;if(!c&&!k)return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(oc,{icon:d,showColors:!0})}));const y=f,E=1===n.length?(0,h.sprintf)((0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)((0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(oc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Zd,{clientId:t}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(Dp,{blocks:n,patterns:g,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Cp,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,s.createElement)(Tp,{hoveredBlock:n[0],onSwitch:l}))})))))};var Fp=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Fn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Op,{clientIds:t,blocks:n})};var zp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Vp=window.wp.blob;function Hp(){const{getBlockName:e}=(0,m.useSelect)(Fn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(qu.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,h.sprintf)((0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)((0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)((0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)((0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Up(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(Fn),{flashBlock:l,removeBlocks:i,replaceBlocks:s}=(0,m.useDispatch)(Fn),a=Hp();return(0,d.useRefEffect)((c=>{function u(u){const d=t();if(0===d.length)return;if(!n()){const{target:e}=u,{ownerDocument:t}=e;if("copy"===u.type||"cut"===u.type?(0,rr.documentHasUncollapsedSelection)(t):(0,rr.documentHasSelection)(t))return}if(!c.contains(u.target.ownerDocument.activeElement))return;const p=u.defaultPrevented;if(u.preventDefault(),"copy"===u.type||"cut"===u.type){1===d.length&&l(d[0]),a(u.type,d);const t=e(d),n=(0,r.serialize)(t);u.clipboardData.setData("text/plain",n),u.clipboardData.setData("text/html",n)}if("cut"===u.type)i(d);else if("paste"===u.type){if(p)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,rr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif)$/.test(t)}));return r.length&&!o&&(o=r.map((e=>``)).join(""),n=""),{html:o,plainText:n}}(u),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});s(d,l,l.length-1,-1)}}return c.ownerDocument.addEventListener("copy",u),c.ownerDocument.addEventListener("cut",u),c.ownerDocument.addEventListener("paste",u),()=>{c.ownerDocument.removeEventListener("copy",u),c.ownerDocument.removeEventListener("cut",u),c.ownerDocument.removeEventListener("paste",u)}}),[])}var Gp=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Up()},t)};function Wp(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Fn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),h=i(t[0]),g=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=a(t,h),k=c(t,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:w,flashBlock:S,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Fn),T=Hp();return n({canDuplicate:g,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:h,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){w((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&S(e[0]),T("copy",e)}})}var $p=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Fn),s=o(n),a=i().codeEditingEnabled;return{mode:l(n),blockType:s?(0,r.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(Fn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)}));var jp=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Fn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Fn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,h.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Kp,Slot:qp}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Kp.Slot=qp;var Yp=Kp;function Xp(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Fn);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),a()}},(0,h._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}const{Fill:Qp,Slot:Zp}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Jp(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Qp,t))}Jp.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o}=e(Fn),r=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(r)),(e=>e.name)),selectedClientIds:r}}),[n]),a=function(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(Fn),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length&&!p,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}(),{isGroupable:c,isUngroupable:d}=a,f=c||d;return(0,s.createElement)(Zp,{fillProps:{...t,selectedBlocks:o,selectedClientIds:l}},(e=>{if((null==e?void 0:e.length)>0||f)return(0,s.createElement)(p.MenuGroup,null,e,(0,s.createElement)(Xp,i({},a,{onClose:null==t?void 0:t.onClose})))}))};var em=Jp;const tm={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function nm(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,s.createElement)(p.MenuItem,{ref:o},(0,h.__)("Copy"))}var om=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{onlyBlock:f,title:g}=(0,m.useSelect)((e=>{var t;const{getBlockCount:n,getBlockName:o}=e(Fn),{getBlockType:l}=e(r.store);return{onlyBlock:1===n(),title:null===(t=l(o(d)))||void 0===t?void 0:t.title}}),[d]),v=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(gc.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),b=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),k=(0,h.sprintf)((0,h.__)("Remove %s"),g),_=1===c?k:(0,h.__)("Remove blocks");return(0,s.createElement)(Wp,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:g,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:C,onMoveTo:w,blocks:S}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:zp,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:tm,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Yp.Slot,{fillProps:{onClose:l}}),1===c&&(0,s.createElement)(jp,{clientId:d}),(0,s.createElement)(nm,{blocks:S,onCopy:C}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,g,b),shortcut:v.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y),shortcut:v.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:v.insertAfter},(0,h.__)("Insert after"))),a&&!f&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,w)},(0,h.__)("Move to")),1===c&&(0,s.createElement)($p,{clientId:d,onToggle:l})),(0,s.createElement)(em.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,E,b),shortcut:v.remove},_)))}))}))};var rm=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(om,i({clientIds:t,toggleProps:e},n)))))};function lm(e){let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:h}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Fn),a=o(),c=a[0],u=i(c),d=s();return{blockClientIds:a,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:a.every((e=>l(e))),isVisual:a.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:g}=(0,m.useDispatch)(Fn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=kp({ref:v,onChange(e){e&&u||g(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&h,C=n.length>1,w=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:w},!C&&!_&&(0,s.createElement)(_p,{clientIds:n}),(0,s.createElement)("div",i({ref:v},k),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(Fp,{clientIds:n}),(0,s.createElement)(fp,{clientIds:n,hideDragHandle:t||u}))),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qn.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(qn.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(qn.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(qn.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(qn.Slot,{group:"other",className:"block-editor-block-toolbar__slot"})),(0,s.createElement)(rm,{clientIds:n}))}var im=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:a,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(Fn),{getBlockType:l}=e(r.store),i=o(),s=i[0],a=n(s),c=l(t(a[a.length-1]));return{blockType:s&&l(t(s)),hasParents:a.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(op,i({focusOnMount:t,className:d,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(lm,{hideDragHandle:n}))};function sm(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(Fn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function am(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:h,isCaretWithinFormattedText:g,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(sm,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Fn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,s.useState)(!1),[w,S]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(Fn),I=!h&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!h||g),N=!(u||T||b||r);(0,gc.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!N}),(0,s.useEffect)((()=>{T||C(!1)}),[T]);const P=(0,s.useRef)(),M=Ua(t),R=Ua(k),L=Ua(l),A=Wd(a);if(!(x||T||E||I))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=I?"top left right":"top right left",{ownerDocument:z}=D,V=I?void 0:z.defaultView.frameElement||(0,rr.getScrollContainer)(D)||z.body;return(0,s.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==a?void 0:a.current},(T||E)&&(0,s.createElement)("div",{onFocus:function(){S(!0)},onBlur:function(){S(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":w})},(0,s.createElement)(Fd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(im,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,s.createElement)(ep,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Fd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function cm(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Fn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),h=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:h}}function um(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(cm,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(am,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function dm(e){let{children:t}=e;const n=(0,s.useContext)($d),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Rt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools"}),(0,s.createElement)(Kd,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(um,{__unstablePopoverSlot:"block-toolbar"}),t))}var pm=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Un();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId");var mm=pm((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Ud,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var fm=(0,d.compose)([pm,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Fn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t,lastBlockClientId:n}=e;return(0,s.createElement)(zd,{rootClientId:t,lastBlockClientId:n})})),hm=window.wp.isShallowEqual,gm=n.n(hm);const vm=new WeakMap;function bm(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&re(Fn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Fn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Fn),d=bm(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,rr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");t.length?p(t):n?f(n):d(e)}}function _m(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=_m(e,t,r);(void 0===n||l{const s=e.getBoundingClientRect(),[a,c]=ym(t,s,o);if(void 0===i||a0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(Fn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Fn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Fn),a=km(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Em(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function wm(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:h,orientation:g,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Fn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Fn).getBlockRootClientId(e);return{blockListSettings:t(Fn).getBlockListSettings(e),parentLock:t(Fn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Io(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),gm()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,g,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Fn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Fn),a=(0,m.useSelect)((t=>t(Fn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(Fn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){vm.has(t)||vm.set(t,new WeakMap);const n=vm.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(ir,{value:k},(0,s.createElement)(Lm,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Sm(e){return lc(e),(0,s.createElement)(wm,e)}const Bm=(0,s.forwardRef)(((e,t)=>{const n=Im({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Im(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Un(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(Fn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Cm({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?Sm:wm;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(Lm,t)}}Im.save=r.__unstableGetInnerBlocksProps,Bm.DefaultBlockAppender=fm,Bm.ButtonBlockAppender=mm,Bm.Content=()=>Im.save().children;var xm=Bm;const Tm=(0,s.createContext)(),Nm=(0,s.createContext)();function Pm(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(Fn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=Im({ref:(0,d.useMergeRefs)([ac(),qd(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(Tm.Provider,{value:o},(0,s.createElement)("div",p))}function Mm(e){return function(){const e=(0,m.useSelect)((e=>e(Fn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Fn).__experimentalGetParsedPattern(e[n].name),t=Yd(o))};return t=Yd(o),()=>Xd(t)}),[e])}(),(0,s.createElement)(dm,null,(0,s.createElement)(Hn,{value:zn},(0,s.createElement)(Pm,e)))}function Rm(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=xo}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Fn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(No,{value:l},(0,s.createElement)(Nm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Qa,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Gd,{tagName:r,rootClientId:n,renderAppender:o}))}function Lm(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Rm,e))}Mm.__unstableElementContext=Tm;const Am=["colors","disableCustomColors","gradients","disableCustomGradients"];function Dm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:g,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,w]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",null,(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:w,label:(0,h.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,h.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,h.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:g,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function Om(e){const t={};return t.colors=po("color.palette"),t.gradients=po("color.gradients"),t.disableCustomColors=!po("color.custom"),t.disableCustomGradients=!po("color.customGradient"),(0,s.createElement)(Dm,i({},t,e))}var Fm=function(e){return(0,u.every)(Am,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Dm,e):(0,s.createElement)(Om,e)};function zm(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(Fm,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Vm(){return{disableCustomColors:!po("color.custom"),disableCustomGradients:!po("color.customGradient")}}function Hm(){const e=Vm(),t=po("color.palette.custom"),n=po("color.palette.theme"),o=po("color.palette.default"),r=po("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=po("color.gradients.custom"),i=po("color.gradients.theme"),a=po("color.gradients.default"),c=po("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}Qc([Zc,tu]);const Um=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Gm=(e,t)=>(0,u.find)(e,{color:t});function Wm(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const $m=[];function jm(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Hm(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),[a,c]=(0,s.useState)((()=>{var e,o;return null===(e=Um(l,t,null==n||null===(o=n.border)||void 0===o?void 0:o.color))||void 0===e?void 0:e.color})),u=[{label:(0,h.__)("Color"),onColorChange:e=>{c(e);const t=Gm(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:qo(r),borderColor:i})},colorValue:a,clearable:!1}];return(0,s.createElement)(zm,i({settings:u,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Km(e,t,n){var o;if(!kf(t,"color")||_f(t))return e;const{borderColor:r,style:l}=n,i=Wm("border-color",r),s=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=s||void 0,e}const qm=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=po("color.palette")||$m;if(!kf(r,"color")||_f(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Um(c,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,s.createElement)(e,i({},t,{wrapperProps:d}))}));function Ym(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Xm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseUnit)(e))),n=t.map((e=>e[0])),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Ym(o),i=0===r||r?`${r}${l}`:null;return i}function Qm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Xm(e),n=isNaN(parseFloat(t));return n}function Zm(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function Jm(e){let{onChange:t,values:n,...o}=e;const r=Xm(n),l=Zm(n)&&Qm(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return kf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Km),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!kf(e,"color")||_f(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Km(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",qm);const ef={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function tf(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(ef).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var nf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var of=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function rf(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?nf:of,iconSize:16,"aria-label":o})))}const lf={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},sf={px:100,em:20,rem:20};function af(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Zm(n)||!Qm(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseUnit)(e);return t||"px"}const t=Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseUnit)(e);return t}));return Ym(t)||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseUnit)(Xm(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Jm,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,unit:i,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:u,min:0,max:sf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(tf,{min:0,onChange:t,values:n||lf,units:l}),(0,s.createElement)(rf,{onClick:()=>r(!o),isLinked:o})))}function cf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(af,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=qo(t)),o({style:t})}})}var uf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"}));var df=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var pf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.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 mf=[{label:(0,h.__)("Solid"),icon:uf,value:"solid"},{label:(0,h.__)("Dashed"),icon:df,value:"dashed"},{label:(0,h.__)("Dotted"),icon:pf,value:"dotted"}];function ff(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,h.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},mf.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const hf=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ff,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:qo(t)})}})},gf=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)();(0,s.useEffect)((()=>{"none"!==i&&c(i)}),[i]),(0,s.useEffect)((()=>{(t||l)&&d({name:t||void 0,color:l||void 0})}),[t,l]);const m=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,h.__)("Width"),min:0,onChange:e=>{let r={...n,border:{...null==n?void 0:n.border,width:e}},l=t;const s=0===parseFloat(e);s&&(l=void 0,r.border.color=void 0,r.border.style="none"),s||"none"!==i||(r.border.style=a),s||void 0!==t||(l=null==u?void 0:u.name,r.border.color=null==u?void 0:u.color),void 0!==e&&""!==e||(r=qo(r)),o({borderColor:l,style:r})},units:m})},vf="__experimentalBorder";function bf(e){const t=yf(e),n=kf(e.name),o=po("border.color")&&kf(e.name,"color"),r=po("border.radius")&&kf(e.name,"radius"),l=po("border.style")&&kf(e.name,"style"),i=po("border.width")&&kf(e.name,"width");return t||!n?null:(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{className:"block-editor-hooks__border-controls",title:(0,h.__)("Border"),initialOpen:!1},(i||l)&&(0,s.createElement)("div",{className:"block-editor-hooks__border-controls-row"},i&&(0,s.createElement)(gf,e),l&&(0,s.createElement)(hf,e)),o&&(0,s.createElement)(jm,e),r&&(0,s.createElement)(cf,e)))}function kf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,vf);return!0===n||("any"===t?!!(null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style):!(null==n||!n[t]))}function _f(e){const t=(0,r.getBlockSupport)(e,vf);return null==t?void 0:t.__experimentalSkipSerialization}const yf=()=>[!po("border.color"),!po("border.radius"),!po("border.style"),!po("border.width")].every(Boolean);function Ef(e){if(e)return`has-${e}-gradient-background`}function Cf(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function wf(e,t){return(0,u.find)(e,["gradient",t])}function Sf(e,t){const n=wf(e,t);return n&&n.slug}function Bf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Un(),o=po("color.gradients.custom"),r=po("color.gradients.theme"),l=po("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(Fn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Fn),d=(0,s.useCallback)((o=>{const r=Sf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=Ef(a);let f;return f=a?Cf(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}const If=(0,h.__)("(%s: color %s)"),xf=(0,h.__)("(%s: gradient %s)"),Tf=["colors","disableCustomColors","gradients","disableCustomGradients"],Nf=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:a,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=Gm(c||t,l);r=(0,h.sprintf)(If,a.toLowerCase(),e&&e.name||l)}else{const e=wf(u||n,l);r=(0,h.sprintf)(xf,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},Pf=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,s.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,s.createElement)(Nf,{colors:n,gradients:o,settings:d}));return(0,s.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,s.createElement)(zm,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},Mf=e=>{const t=Vm();return t.colors=po("color.palette"),t.gradients=po("color.gradients"),(0,s.createElement)(Pf,i({},t,e))},Rf=e=>{const t=Hm();return(0,s.createElement)(Pf,i({},t,e))};var Lf=e=>(0,u.every)(Tf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Pf,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Rf,e):(0,s.createElement)(Mf,e);function Af(e){let{colordBackgroundColor:t,colordTextColor:n,backgroundColor:o,textColor:r}=e;const l=t.brightness(){(0,Nt.speak)((0,h.__)("This color combination may be hard for people to read."))}),[o,r]),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},l))}Qc([Zc,tu]);var Df=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fontSize:r,isLargeText:l,textColor:i}=e;if(!t&&!n||!i&&!o)return null;const a=Yc(t||n),c=Yc(i||o);return 1!==a.alpha()||1!==c.alpha()||c.isReadable(a,{level:"AA",size:l||!1!==l&&r>=24?"large":"small"})?null:(0,s.createElement)(Af,{backgroundColor:t,textColor:i,colordBackgroundColor:a,colordTextColor:c})};function Of(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Ff(e){let{settings:t,clientId:n,enableContrastChecking:o=!0,showTitle:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),u=Ha(n);return(0,s.useEffect)((()=>{if(!o)return;if(!u.current)return;c(Of(u.current).color);let e=u.current,t=Of(e).backgroundColor;for(;"rgba(0, 0, 0, 0)"===t&&e.parentNode&&e.parentNode.nodeType===e.parentNode.ELEMENT_NODE;)e=e.parentNode,t=Of(e).backgroundColor;i(t)})),(0,s.createElement)(er,null,(0,s.createElement)(Lf,{title:(0,h.__)("Color"),initialOpen:!1,settings:t,showTitle:r,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},o&&(0,s.createElement)(Df,{backgroundColor:l,textColor:a})))}const zf="color",Vf=e=>{const t=(0,r.getBlockSupport)(e,zf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Hf=e=>{const t=(0,r.getBlockSupport)(e,zf);return null==t?void 0:t.__experimentalSkipSerialization},Uf=e=>{const t=(0,r.getBlockSupport)(e,zf);return(0,u.isObject)(t)&&!!t.gradients};function Gf(e,t,n){var o,r,l,i,s,a;if(!Vf(t)||Hf(t))return e;const u=Uf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,h=Wm("background-color",d),g=Ef(m),v=Wm("color",p),b=c()(e.className,v,g,{[h]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!h),"has-text-color":p||(null==f||null===(r=f.color)||void 0===r?void 0:r.text),"has-background":d||(null==f||null===(l=f.color)||void 0===l?void 0:l.background)||u&&(m||(null==f||null===(i=f.color)||void 0===i?void 0:i.gradient)),"has-link-color":null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color});return e.className=b||void 0,e}const Wf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Um(e,n[1]).color:t};function $f(e){var t,n,o,l,i,a,c,d,p;const{name:m,attributes:f}=e,g=po("color.palette.custom"),v=po("color.palette.theme"),b=po("color.palette.default"),k=(0,s.useMemo)((()=>[...g||[],...v||[],...b||[]]),[g,v,b]),_=po("color.gradients.custom"),y=po("color.gradients.theme"),E=po("color.gradients.default"),C=(0,s.useMemo)((()=>[..._||[],...y||[],...E||[]]),[_,y,E]),w=po("color.custom"),S=po("color.customGradient"),B=po("color.background"),I=po("color.link"),x=po("color.text"),T=w||!v||(null==v?void 0:v.length)>0,N=S||!y||(null==y?void 0:y.length)>0,P=(0,s.useRef)(f);if((0,s.useEffect)((()=>{P.current=f}),[f]),!Vf(m))return null;const M=(e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,zf);return(0,u.isObject)(t)&&!!t.link})(m)&&I&&T,R=(e=>{const t=(0,r.getBlockSupport)(e,zf);return t&&!1!==t.text})(m)&&x&&T,L=(e=>{const t=(0,r.getBlockSupport)(e,zf);return t&&!1!==t.background})(m)&&B&&T,A=Uf(m)&&N;if(!(M||R||L||A))return null;const{style:D,textColor:O,backgroundColor:F,gradient:z}=f;let V;if(A&&z)V=Cf(C,z);else if(A){var H;V=null==D||null===(H=D.color)||void 0===H?void 0:H.gradient}const U=t=>n=>{var o,r;const l=Gm(k,n),i=t+"Color",s={...P.current.style,color:{...null===(o=P.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:qo(s),[i]:a};e.setAttributes(c),P.current={...P.current,...c}};return(0,s.createElement)(Ff,{enableContrastChecking:!("web"!==s.Platform.OS||z||null!=D&&null!==(t=D.color)&&void 0!==t&&t.gradient),clientId:e.clientId,settings:[...R?[{label:(0,h.__)("Text"),onColorChange:U("text"),colorValue:Um(k,O,null==D||null===(n=D.color)||void 0===n?void 0:n.text).color}]:[],...L||A?[{label:(0,h.__)("Background"),onColorChange:L?U("background"):void 0,colorValue:Um(k,F,null==D||null===(o=D.color)||void 0===o?void 0:o.background).color,gradientValue:V,onGradientChange:A?t=>{const n=Sf(C,t);let o;if(n){var r,l,i;const e={...null===(r=P.current)||void 0===r?void 0:r.style,color:{...null===(l=P.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:qo(e),gradient:n}}else{var s,a,c;const e={...null===(s=P.current)||void 0===s?void 0:s.style,color:{...null===(a=P.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:qo(e),gradient:void 0}}e.setAttributes(o),P.current={...P.current,...o}}:void 0}]:[],...M?[{label:(0,h.__)("Link"),onColorChange:t=>{const n=Gm(k,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=qo(function(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}(D,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Wf(k,null==D||null===(l=D.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==D||null===(c=D.elements)||void 0===c||null===(d=c.link)||void 0===d||null===(p=d.color)||void 0===p||!p.text)}]:[]]})}const jf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=po("color.palette.custom")||[],u=po("color.palette.theme")||[],d=po("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Vf(o)||Hf(o))return(0,s.createElement)(e,t);const m={};var f,h;a&&(m.color=null===(f=Um(p,a))||void 0===f?void 0:f.color);l&&(m.backgroundColor=null===(h=Um(p,l))||void 0===h?void 0:h.color);let g=t.wrapperProps;return g={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:g}))}));(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Vf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Uf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Gf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Vf(e)||Hf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Gf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",jf);const Kf=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],qf=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],Yf=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Xf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Yf(n,o),c={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Kf.forEach((t=>{let{name:n,value:o}=t;qf.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)((0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Kf.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return qf.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,h.sprintf)((0,h.__)("Currently selected font appearance: %s"),d.name):(0,h.sprintf)((0,h.__)("Currently selected font style: %s"),d.name):(0,h.sprintf)((0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}const Qf=.1;function Zf(e){let{value:t,onChange:n}=e;const o=function(e){return void 0!==e&&""!==e}(t),r=o?t:"";return(0,s.createElement)("div",{className:"block-editor-line-height-control"},(0,s.createElement)(p.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==Ma.ZERO||o||(e.preventDefault(),n("0"))},onChange:e=>{if(o)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:(0,h.__)("Line height"),placeholder:1.5,step:Qf,type:"number",value:r,min:0}))}const Jf="typography.lineHeight";function eh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Zf,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:qo(t)})}})}function th(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!po("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Jf)||t}const nh="typography.__experimentalFontStyle",oh="typography.__experimentalFontWeight";function rh(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!lh(e),i=!ih(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(Xf,{onChange:e=>{r({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function lh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,nh),n=po("typography.fontStyle");return!t||!n}function ih(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,oh),n=po("typography.fontWeight");return!t||!n}function sh(e){const t=lh(e),n=ih(e);return t&&n}function ah(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=po("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const ch="typography.__experimentalFontFamily";function uh(e,t,n){if(!(0,r.hasBlockSupport)(t,ch))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(Sp())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function dh(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=po("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(ah,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function ph(e){let{name:t}=e;const n=po("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,ch)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,ch)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",uh),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,ch))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),uh(o,e,n)},e}));const mh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function fh(e,t){const n=(0,u.find)(e,{size:t});return n||{size:t}}function hh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var gh=function(e){const t=po("typography.fontSizes"),n=!po("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const vh="typography.fontSize";function bh(e,t,n){if(!(0,r.hasBlockSupport)(t,vh))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(Sp())(e.className);o.add(hh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function kh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=po("typography.fontSizes"),a=mh(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(gh,{onChange:e=>{const t=fh(i,e).slug;l({style:qo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function _h(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=po("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,vh)||!n}const yh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=po("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,vh)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=mh(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles");(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,vh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",bh),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,vh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),bh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",yh);var Eh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var Ch=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(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"}));const wh=[{name:(0,h.__)("Underline"),value:"underline",icon:Eh},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:Ch}];function Sh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},wh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const Bh="typography.__experimentalTextDecoration";function Ih(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Sh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function xh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Bh),n=po("typography.textDecoration");return t||!n}var Th=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var Nh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var Ph=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Mh=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:Th},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:Nh},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:Ph}];function Rh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Mh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Lh="typography.__experimentalTextTransform";function Ah(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Rh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Dh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Lh),n=po("typography.textTransform");return t||!n}function Oh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["px","em","rem"],defaultValues:{px:"2",em:".2",rem:".2"}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Letter-spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Fh="typography.__experimentalLetterSpacing";function zh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Oh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:!1})}function Vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Fh),n=po("typography.letterSpacing");return t||!n}const Hh="typography",Uh=[Jf,vh,nh,oh,ch,Bh,Lh,Fh];function Gh(e){const{clientId:t}=e,n=ph(e),o=_h(e),l=sh(e),i=th(e),a=xh(e),c=Dh(e),u=Vh(e),d=!lh(e),m=!ih(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[sh(e),_h(e),th(e),ph(e),xh(e),Dh(e),Vh(e)];return t.filter(Boolean).length===t.length}(e),g=Wh(e.name);if(f||!g)return null;const v=(0,r.getBlockSupport)(e.name,[Hh,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(er,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(dh,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:qo({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(kh,e)),!l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Yf(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(rh,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(eh,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(Ih,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(Ah,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,h.__)("Letter-spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(zh,e)))}const Wh=e=>Uh.some((t=>(0,r.hasBlockSupport)(e,t)));function $h(e){const t=(0,r.getBlockSupport)(e,eg);return!!(!0===t||null!=t&&t.blockGap)}function jh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!po("spacing.blockGap");return!$h(e)||t}function Kh(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["%","px","em","rem","vw"]}),i=Ha(n);if(jh(e))return null;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function qh(e){const t=(0,r.getBlockSupport)(e,eg);return!!(!0===t||null!=t&&t.margin)}function Yh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!po("spacing.margin"),n=!ig(e,"margin");return!qh(e)||t||n}function Xh(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["%","px","em","rem","vw"]}),i=lg(n,"margin"),a=i&&i.some((e=>ng.includes(e)));if(Yh(e))return null;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Qh(e){const t=(0,r.getBlockSupport)(e,eg);return!!(!0===t||null!=t&&t.padding)}function Zh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!po("spacing.padding"),n=!ig(e,"padding");return!Qh(e)||t||n}function Jh(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["%","px","em","rem","vw"]}),i=lg(n,"padding"),a=i&&i.some((e=>ng.includes(e)));if(Zh(e))return null;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const eg="spacing",tg=["top","right","bottom","left"],ng=["vertical","horizontal"];function og(e){const t=jh(e),n=Zh(e),o=Yh(e),l=rg(e),i=function(e){if("web"!==s.Platform.OS)return!1;return $h(e)||Qh(e)||qh(e)}(e.name);if(l||!i)return null;const a=(0,r.getBlockSupport)(e.name,[eg,"__experimentalDefaultControls"]),c=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(er,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:c("padding"),isShownByDefault:null==a?void 0:a.padding,panelId:e.clientId},(0,s.createElement)(Jh,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:c("margin"),isShownByDefault:null==a?void 0:a.margin,panelId:e.clientId},(0,s.createElement)(Xh,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:c("blockGap"),isShownByDefault:null==a?void 0:a.blockGap,panelId:e.clientId},(0,s.createElement)(Kh,e)))}const rg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=jh(e),n=Zh(e),o=Yh(e);return t&&n&&o};function lg(e,t){const n=(0,r.getBlockSupport)(e,eg);if(n&&"boolean"!=typeof n[t])return n[t]}function ig(e,t){const n=lg(e,t);return!(n&&n.some((e=>tg.includes(e)))&&n.some((e=>ng.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}const sg=[...Uh,vf,zf,eg],ag=e=>sg.some((t=>(0,r.hasBlockSupport)(e,t))),cg="var:";function ug(e){if((0,u.startsWith)(e,cg)){return`var(--wp--${e.slice(cg.length).split("|").join("--")})`}return e}function dg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const r=(0,u.get)(e,l);i&&!(0,u.isString)(r)?Object.entries(i).forEach((e=>{const[t,o]=e,l=(0,u.get)(r,[o]);l&&(n[t]=ug(l))})):t.includes(l.join("."))||(n[o]=ug((0,u.get)(e,l)))}})),n}const pg={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[zf],"typography.__experimentalSkipSerialization":[Hh],[`${eg}.__experimentalSkipSerialization`]:["spacing"]},mg={...pg,[`${eg}`]:["spacing.blockGap"]};function fg(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:mg;if(!ag(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...dg(l),...e.style},e}const hg=(0,d.createHigherOrderComponent)((e=>t=>{const n=Gn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)($f,t),(0,s.createElement)(Gh,t),(0,s.createElement)(bf,t),(0,s.createElement)(og,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),gg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=dg(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(Mm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return ag(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",fg),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!ag(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),fg(o,e,n,pg)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",hg),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",gg);var vg=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Ma.DOWN||(e.preventDefault(),n())},label:(0,h.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const bg=[];function kg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Yc(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function _g(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:n},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function yg(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=po("color.duotone")||bg,a=po("color.palette")||bg,c=!po("color.custom"),u=!po("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(qn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(vg,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Qc([Zc]);const Eg=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(yg,t))}),"withDuotoneControls");const Cg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(Mm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(_g,{selector:m,id:p,values:kg(u)}),h),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Eg),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Cg);const wg="__experimentalLayout";function Sg(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=po("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Fn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,wg,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:g}=c;if(!d)return null;const v=l||g||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=Io(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(Bg,{type:k,onChange:e=>t({layout:{type:e}})}),!b&&_&&(0,s.createElement)(_.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&_&&(0,s.createElement)(_.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function Bg(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Ig=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,wg)&&(0,s.createElement)(Sg,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),xg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,wg),a=(0,d.useInstanceId)(e),u=po("layout")||{},p=(0,s.useContext)(Mm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,wg)||{},h=null!=m&&m.inherit?u:m||f||{},g=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mo,{selector:`.wp-container-${a}`,layout:h,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:g})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,wg)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",xg),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Ig);const Tg=[];function Ng(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Wm("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:dg({border:r})}}function Pg(e){const t=po("color.palette")||Tg,n=Ng(e);if(e.borderColor){const o=Um(t,e.borderColor);n.style.borderColor=o.color}return n}function Mg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Wm("background-color",s),m=Wm("color",a),f=Ef(u),h=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!h&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:dg({color:(null==d?void 0:d.color)||{}})}}const Rg={};function Lg(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=po("color.palette.custom")||[],l=po("color.palette.theme")||[],i=po("color.palette.default")||[],a=po("color.gradients")||Rg,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=Mg(e);if(t){const e=Um(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Cf(u,o)),n){const e=Um(c,n);d.style.color=e.color}return d}function Ag(e){const{style:t}=e;return{style:dg({spacing:(null==t?void 0:t.spacing)||{}})}}function Dg(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Og=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Fg=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=po("color.palette.custom"),o=po("color.palette.theme"),r=po("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function zg(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Yc(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Gm(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Um(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Wm(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Vg(e){return function(){const t=Og(e);for(var n=arguments.length,o=new Array(n),r=0;r(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=po("typography.fontSizes")||Ug;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=mh(r,l,n[t]);return e[o]={...i,class:hh(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var Wg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var $g=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var jg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Kg=[{icon:Wg,title:(0,h.__)("Align text left"),align:"left"},{icon:$g,title:(0,h.__)("Align text center"),align:"center"},{icon:jg,title:(0,h.__)("Align text right"),align:"right"}],qg={position:"bottom right",isAlternate:!0};var Yg=function(e){let{value:t,onChange:n,alignmentControls:o=Kg,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,g=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,h.isRTL)()?jg:Wg,label:r,toggleProps:{describedBy:l},popoverProps:qg,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},g))};function Xg(e){return(0,s.createElement)(Yg,i({},e,{isToolbar:!1}))}function Qg(e){return(0,s.createElement)(Yg,i({},e,{isToolbar:!0}))}var Zg={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Fn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Gu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?md(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),a=(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(oc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[a]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}};const Jg=[];function ev(e){let{completers:t=Jg}=e;const{name:n}=Un();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Zg])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var tv=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:ev(e)}))};var nv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var ov=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:nv,label:n,onClick:()=>o(!t),disabled:r})};var rv=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Ma.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var lv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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 iv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Fn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Fn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(wo,{icon:lv,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Zd,{clientId:e})),(0,s.createElement)(wo,{icon:lv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Zd,{clientId:r})))};function sv(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:h,isParentHighlighted:g}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(Fn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":g,"is-dragging-blocks":h});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const av=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),cv=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(av,null)))},uv=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Ma.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(cv,null)))}))}};var dv=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:uv(n),renderContent:()=>t})};var pv=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const mv=va(p.__experimentalTreeGridRow);function fv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=_a({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(mv,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function hv(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(wo,{icon:lv}))}var gv=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_}=t;const y=Qd(r),E=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,C=((e,t,n)=>(0,h.sprintf)((0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,m,f);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",o),onClick:i,"aria-describedby":E,ref:n,tabIndex:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_},(0,s.createElement)(hv,{onClick:a}),(0,s.createElement)(oc,{icon:null==y?void 0:y.icon,showColors:!0}),(0,s.createElement)(Zd,{clientId:r}),(null==y?void 0:y.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},y.anchor),l&&(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("(selected block)"))),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:E},C))}));const vv=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,...p}=e;const{clientId:f}=r,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,m.useSelect)((e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(Fn);return{rootClientId:t(f)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}}),[f]),v=h&&g===f,b=c()("block-editor-list-view-block-contents",{"is-dropping-before":v});return(0,s.createElement)(Jd,{clientIds:[r.clientId]},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(gv,i({ref:t,className:b,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f},p))}))}));var bv=vv;const kv=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),_v=()=>(0,s.useContext)(kv);var yv=(0,s.memo)((function(e){let{block:t,isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:l,position:i,level:a,rowCount:u,siblingBlockCount:d,showBlockMovers:f,path:h,isExpanded:g}=e;const v=(0,s.useRef)(null),[b,k]=(0,s.useState)(!1),{clientId:_}=t,{toggleBlockHighlight:y}=(0,m.useDispatch)(Fn),{__experimentalFeatures:E,__experimentalPersistentListViewFeatures:C,__experimentalHideContainerBlockActions:w,isTreeGridMounted:S,expand:B,collapse:I}=_v(),x=f&&d>0,T=c()("block-editor-list-view-block__mover-cell",{"is-visible":b||o}),N=c()("block-editor-list-view-block__menu-cell",{"is-visible":b||o});(0,s.useEffect)((()=>{C&&!S&&o&&v.current.focus()}),[]);const P=C?y:()=>{},M=(0,s.useCallback)((()=>{k(!0),P(_,!0)}),[_,k,P]),R=(0,s.useCallback)((()=>{k(!1),P(_,!1)}),[_,k,P]),L=(0,s.useCallback)((e=>{e.stopPropagation(),l(_)}),[_,l]),A=(0,s.useCallback)((e=>{e.stopPropagation(),!0===g?I(_):!1===g&&B(_)}),[_,B,I,g]),D=E&&(!w||w&&a>1),O=E&&!D;let F;x?F=2:O&&(F=3);const z=c()({"is-selected":o,"is-branch-selected":C&&r,"is-dragging":n,"has-single-cell":O});return(0,s.createElement)(fv,{className:z,onMouseEnter:M,onMouseLeave:R,onFocus:M,onBlur:R,level:a,position:i,rowCount:u,path:h,id:`list-view-block-${_}`,"data-block":_,isExpanded:g},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:F,ref:v},(e=>{let{ref:n,tabIndex:r,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(bv,{block:t,onClick:L,onToggleExpanded:A,isSelected:o,position:i,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:l}))})),x&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:T,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(pp,{orientation:"vertical",clientIds:[_],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(mp,{orientation:"vertical",clientIds:[_],ref:t,tabIndex:n,onFocus:o})})))),D&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:N},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(om,{clientIds:[_],icon:zp,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:L})})))}));function Ev(e,t,n){var o;if(null==n?void 0:n.includes(e.clientId))return 0;return null===(o=t[e.clientId])||void 0===o||o?1+e.innerBlocks.reduce(Cv(t,n),0):1}const Cv=(e,t)=>(n,o)=>{var r;if(null==t?void 0:t.includes(o.clientId))return n;return(null===(r=e[o.clientId])||void 0===r||r)&&o.innerBlocks.length>0?n+Ev(o,e,t):n+1};function wv(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p}=e,{expandedState:f,draggedClientIds:h,__experimentalPersistentListViewFeatures:g}=_v(),v=(0,u.compact)(t),b=v.length;let k=d;return(0,s.createElement)(s.Fragment,null,v.map(((e,t)=>{var d;const{clientId:_,innerBlocks:y}=e;t>0&&(k+=Ev(v[t-1],f,h));const E=g,{itemInView:C}=p,w=!E||C(k),S=t+1,B=a.length>0?`${a}_${S}`:`${S}`,I=r&&!!y&&!!y.length,x=I?null===(d=f[_])||void 0===d||d:void 0,T=!(null==h||!h.includes(_)),N=T||w,P=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(_,l),M=c||P&&I;return(0,s.createElement)(m.AsyncModeProvider,{key:_,value:!P},N&&(0,s.createElement)(yv,{block:e,selectBlock:n,isSelected:P,isBranchSelected:M,isDragged:T,level:i,position:S,rowCount:b,siblingBlockCount:b,showBlockMovers:o,path:B,isExpanded:x,listPosition:k}),!N&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,s.createElement)(wv,{blocks:y,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:B,listPosition:k+1,fixedListWindow:p,isBranchSelected:M,selectedClientIds:l}))})))}wv.defaultProps={selectBlock:()=>{}};var Sv=(0,s.memo)(wv);function Bv(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Iv(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const xv=["top","bottom"];function Tv(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Fn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=km(a,c),p=o(),f=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=ym(t,s,xv),u=Iv(t,s);if(void 0===r||a0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}const Nv=()=>{},Pv=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var Mv=(0,s.forwardRef)((function(e,t){let{blocks:n,onSelect:o=Nv,__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:u,...f}=e;const{clientIdsTree:g,draggedClientIds:v,selectedClientIds:b}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Fn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{selectBlock:k}=(0,m.useDispatch)(Fn),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Fn),o=(null==v?void 0:v.length)>0?n(v).length+1:0;return{visibleBlockCount:t()-o}}),[v]),y=(0,s.useCallback)((e=>{k(e),o(e)}),[k,o]),[E,C]=(0,s.useReducer)(Pv,{}),{ref:w,target:S}=Tv(),B=(0,s.useRef)(),I=(0,d.useMergeRefs)([B,w,t]),x=(0,s.useRef)(!1);(0,s.useEffect)((()=>{x.current=!0}),[]);const[T]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:l,windowOverscan:40}),N=(0,s.useCallback)((e=>{e&&C({type:"expand",clientId:e})}),[C]),P=(0,s.useCallback)((e=>{e&&C({type:"collapse",clientId:e})}),[C]),M=(0,s.useCallback)((e=>{var t;N(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[N]),R=(0,s.useCallback)((e=>{var t;P(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[P]),L=(0,s.useMemo)((()=>({__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:x.current,draggedClientIds:v,expandedState:E,expand:N,collapse:P})),[r,l,a,x.current,v,E,N,P]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Bv,{listViewRef:B,blockDropTarget:S}),(0,s.createElement)(p.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:I,onCollapseRow:R,onExpandRow:M},(0,s.createElement)(kv.Provider,{value:L},(0,s.createElement)(Sv,i({blocks:g,selectBlock:y,showNestedBlocks:c,showBlockMovers:u,fixedListWindow:T,selectedClientIds:b},f)))))}));function Rv(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:pv,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Lv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Fn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(Rv,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(Mv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));var Av=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));var Dv=function(e){let{icon:t=Av,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))};var Ov=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const Fv="carousel",zv="grid",Vv=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,h.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,h.__)("Choose")))},Hv=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:lp,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:rp,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Uv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Fv,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:eo,label:(0,h.__)("Carousel view"),onClick:()=>n(Fv),isPressed:u}),(0,s.createElement)(p.Button,{icon:Ov,label:(0,h.__)("Grid view"),onClick:()=>n(zv),isPressed:t===zv}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Hv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Vv,{onBlockPatternSelect:a,onStartBlank:c}))};var Gv=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Fn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])};const Wv=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,p.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===Fv){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(jv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)($v,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function $v(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,title:a,description:c,viewportWidth:u=700}=t,m=(0,d.useInstanceId)($v,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?m:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(Tu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function jv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(jv,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,s.createElement)(Tu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Kv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Fv),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(Fn),g=Gv(t,n,o);if(null==g||!g.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Uv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:g.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(g[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(Wv,{viewMode:a,activeSlide:u,patterns:g,onBlockPatternSelect:v}))};const qv=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};var Yv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(Fn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(Fn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=qv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:sp,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${d}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:c,value:n,onSelect:u})))))};const Xv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Qv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Zv={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Qv,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Xv,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Jv=["top","center","bottom"],eb={isAlternate:!0};var tb=function(e){let{value:t,onChange:n,controls:o=Jv,isCollapsed:r=!0,isToolbar:l}=e;const a=Zv[t],c=Zv.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:eb,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Zv[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function nb(e){return(0,s.createElement)(tb,i({},e,{isToolbar:!1}))}function ob(e){return(0,s.createElement)(tb,i({},e,{isToolbar:!0}))}var rb=(0,d.createHigherOrderComponent)((e=>t=>{const n=po("color.palette"),o=!po("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),lb=rb(p.ColorPalette);function ib(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(Fm,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))} +/*! ***************************************************************************** +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. +***************************************************************************** */ +var sb=function(e,t){return sb=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])},sb(e,t)};var ab=function(){return ab=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:c,height:c/r}}function pb(e,t,n,o,r){void 0===r&&(r=0);var l=Eb(t.width,t.height,r),i=l.width,s=l.height;return{x:mb(e.x,i,n.width,o),y:mb(e.y,s,n.height,o)}}function mb(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function fb(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function hb(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function gb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?vb:bb,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:ab(ab({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function vb(e,t){return Math.min(e,Math.max(0,t))}function bb(e,t){return t}function kb(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function _b(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function yb(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function Eb(e,t,n){var o=e/2,r=t/2,l=[yb(0,0,o,r,n),yb(e,0,o,r,n),yb(e,t,o,r,n),yb(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]}))),c=Math.max.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:c-a}}function Cb(){for(var e=[],t=0;t0})).join(" ").trim()}var wb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=kb(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l,i,s=n.imageRef||n.videoRef;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:s.offsetWidth,height:s.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var a=n.props.cropSize?n.props.cropSize:db(s.offsetWidth,s.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===a.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===a.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(a),n.setState({cropSize:a},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=ab({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?pb(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=ub()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?pb(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.getCropData=function(){return n.state.cropSize?gb(n.props.restrictPosition?pb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?pb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}sb(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,s,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=fb(n,o),this.lastPinchRotation=hb(n,o),this.onDragStart(_b(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=_b(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=fb(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=hb(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,s=i.x,a=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,f=m.containerStyle,h=m.cropAreaStyle,g=m.mediaStyle,v=t.classes,b=v.containerClassName,k=v.cropAreaClassName,_=v.mediaClassName,y=t.objectFit;return Gr().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:Cb("reactEasyCrop_Container",b)},n?Gr().createElement("img",ab({alt:"",className:Cb("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{src:n,ref:function(t){return e.imageRef=t},style:ab(ab({},g),{transform:l||"translate("+s+"px, "+a+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Gr().createElement("video",ab({autoPlay:!0,loop:!0,muted:!0,className:Cb("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:ab(ab({},g),{transform:l||"translate("+s+"px, "+a+"px) rotate("+c+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return Gr().createElement("source",ab({key:e.src},e))}))),this.state.cropSize&&Gr().createElement("div",{style:ab(ab({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Cb("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",k)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Gr().Component),Sb=wb;const Bb={position:"bottom right",isAlternate:!0};var Ib=window.wp.apiFetch,xb=n.n(Ib);function Tb(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,h]=(0,s.useState)(),[g,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),k(n/o)}),[n,o,d,m,h,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),h(e),v(1/g),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(1/g),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:h,rotateClockwise:y,aspect:g,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,h,y,g,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}const Nb=(0,s.createContext)({}),Pb=()=>(0,s.useContext)(Nb);function Mb(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:l,onFinishEditing:i,onSaveImage:a,children:c}=e;const u=Tb({url:n,naturalWidth:o,naturalHeight:r},l),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(qu.store),[p,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,xb()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,h.sprintf)((0,h.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:g})),[p,v,g])}({id:t,url:n,onSaveImage:a,onFinishEditing:i,...u}),p=(0,s.useMemo)((()=>({...u,...d})),[u,d]);return(0,s.createElement)(Nb.Provider,{value:p},c)}function Rb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:h,setCrop:g,setZoom:v,rotation:b}=Pb();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(Sb,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:h,onCropComplete:e=>{g(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var Lb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function Ab(){const{isInProgress:e,zoom:t,setZoom:n}=Pb();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Bb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:Lb,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Db=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var Ob=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Fb(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?Db:void 0},t)})))}function zb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Pb();return(0,s.createElement)(p.DropdownMenu,{icon:Ob,label:(0,h.__)("Aspect Ratio"),popoverProps:Bb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(Fb,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Fb,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}var Vb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));function Hb(){const{isInProgress:e,rotateClockwise:t}=Pb();return(0,s.createElement)(p.ToolbarButton,{icon:Vb,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function Ub(){const{isInProgress:e,apply:t,cancel:n}=Pb();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function Gb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rb,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(qn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Ab,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(zb,{toggleProps:e}))),(0,s.createElement)(Hb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Ub,null))))}const Wb=[25,50,75,100];function $b(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:g,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,h.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,h.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,h.__)("Width"),value:f,min:1,onChange:e=>g("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>g("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},Wb.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,h.__)("Reset")))))}var jb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));var Kb=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Currently selected link settings")),l)};class qb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,Da()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,Ed.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,h.sprintf)((0,h._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,h.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case Ma.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Ma.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Ma.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Ma.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Ma.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Ma.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,h.__)("Link selected.")));break;case Ma.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,h.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,g={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,h.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(g,v,a):(0,s.createElement)(p.BaseControl,g,(0,s.createElement)("input",v),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,h={id:d,ref:this.autocompleteRef,role:"listbox"},g=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:h,buildSuggestionItemProps:g,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},h,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},g(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var Yb=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Fn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(qb);var Xb=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?(0,u.isFunction)(a)?a(n):a:(0,s.createInterpolateElement)((0,h.sprintf)((0,h.__)("Create: %s"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(wo,{className:"block-editor-link-control__search-item-icon",icon:Ja}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null};var Qb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));var Zb=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:a="",shouldShowType:u=!1}=e;return(0,s.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,s.createElement)(wo,{className:"block-editor-link-control__search-item-icon",icon:Qb}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,s.createElement)(p.TextHighlight,{text:n.title,highlight:a})),(0,s.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,Ed.filterURLForDisplay)((0,Ed.safeDecodeURI)(n.url))||""),l&&(0,h.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},"post_tag"===n.type?"tag":n.type))};const Jb="__CREATE__",ek=[{id:"opensInNewTab",title:(0,h.__)("Open in new tab")}];function tk(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:g,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,w=f?(0,h.__)("Recently updated"):(0,h.sprintf)((0,h.__)('Search results for "%s"'),o),S=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},w));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&Jb===e.type?(0,s.createElement)(Xb,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):Jb===e.type?null:(0,s.createElement)(Zb,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E})))))}function nk(e){const t=(0,u.startsWith)(e,"#");return(0,Ed.isURL)(e)||e&&e.includes("www.")||t}const ok=()=>Promise.resolve([]),rk=e=>{let t="URL";const n=(0,Ed.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Ed.prependHTTP)(e):e,type:t}])};function lk(e,t,n,o){const{fetchSearchSuggestions:r}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Fn);return{fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?rk:ok;return(0,s.useCallback)(((t,i)=>{let{isInitialSuggestions:s}=i;return nk(t)?l(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,l)=>{const{isInitialSuggestions:i}=t;let s=await Promise.all([n(e,t),o(e)]);return s=e.includes(" ")||!l||i?s[0]:s[0].concat(s[1]),i||nk(e)||!r?s:s.concat({title:e,url:e,type:Jb})})(t,{...e,isInitialSuggestions:s},r,l,n,o)}),[l,r,n])}const ik=()=>Promise.resolve([]),sk=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=u.noop,onChange:m=u.noop,onSelect:f=u.noop,showSuggestions:g=!0,renderSuggestions:v=(e=>(0,s.createElement)(tk,e)),fetchSuggestions:b=null,allowDirectEntry:k=!0,showInitialSuggestions:_=!1,suggestionsQuery:y={},withURLSuggestion:E=!0,createSuggestionButtonText:C,useLabel:w=!1}=e;const S=lk(y,k,a,E),B=g?b||S:ik,I=(0,d.useInstanceId)(sk),[x,T]=(0,s.useState)(),N=async e=>{let t=e;if(Jb!==e.type)(k||t&&Object.keys(t).length>=1)&&f({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&f(t)}catch(e){}},P=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(Yb,{label:w?"URL":void 0,className:P,value:n,onChange:(e,t)=>{m(e),T(t)},placeholder:null!=i?i:(0,h.__)("Search or type url"),__experimentalRenderSuggestions:g?e=>v({...e,instanceId:I,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:C,suggestionsQuery:y,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),N(t)}}):null,__experimentalFetchLinkSuggestions:B,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:_,onSubmit:(e,t)=>{var o;const r=e||x;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?N(r||{url:n}):t.preventDefault()},ref:t}),o)}));var ak=sk;var ck=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));var uk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:dk,Fill:pk}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function mk(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}var fk=function(e){const[t,n]=(0,s.useReducer)(mk,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Fn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function hk(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const a=r?null==n?void 0:n.url:null,{richData:u,isFetching:d}=fk(a),m=u&&Object.keys(u).length,f=n&&(0,Ed.filterURLForDisplay)((0,Ed.safeDecodeURI)(n.url),16)||"",g=(null==u?void 0:u.title)||(null==n?void 0:n.title)||f,v=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let b;return b=null!=u&&u.icon?(0,s.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):v?(0,s.createElement)(wo,{icon:ck,size:32}):(0,s.createElement)(wo,{icon:Qb}),(0,s.createElement)("div",{"aria-label":(0,h.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":m,"is-fetching":!!d,"is-preview":!0,"is-error":v})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==u?void 0:u.icon})},b),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},v?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},"Link is empty"):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,rr.__unstableStripHTML)(g)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,s.createElement)(p.Button,{icon:uk,label:(0,h.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:of,label:(0,h.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(dk,{fillProps:n})),(m&&((null==u?void 0:u.image)||(null==u?void 0:u.description))||d)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==u?void 0:u.image)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=u&&u.image)})},(null==u?void 0:u.image)&&(0,s.createElement)("img",{src:null==u?void 0:u.image,alt:""})),((null==u?void 0:u.description)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=u&&u.description)})},(null==u?void 0:u.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}const gk=e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}};function vk(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=ek,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:g,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:w=!1,hasTextControl:S=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,s.useRef)(!0),x=(0,s.useRef)(),T=(0,s.useRef)(),[N,P]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length);function z(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(rr.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const{createPage:V,isCreatingPage:H,errorMessage:U}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=gk(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,h.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b),G=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||a({url:L,title:M}),z()},W=d&&l&&!A&&!H,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,s.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},H&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,h.__)("Creating"),"…"),(A||!l)&&!H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==Ma.ENTER||F||(e.preventDefault(),G())}}),(0,s.createElement)(ak,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:V,onChange:P,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),z()},showInitialSuggestions:g,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:G,label:(0,h.__)("Submit"),icon:jb,className:"block-editor-link-control__search-submit",disabled:F})))),U&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},U)),l&&!A&&!H&&(0,s.createElement)(hk,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:w,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Kb,{value:l,settings:i,onChange:a})),B&&B())}vk.ViewerFill=pk;var bk=vk;var kk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var _k=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));var yk=(0,p.withFilters)("editor.MediaUpload")((()=>null));var Ek=function(e){let{fallback:t=null,children:n}=e;const o=(0,m.useSelect)((e=>{const{getSettings:t}=e(Fn);return!!t().mediaUpload}),[]);return o?n:t};var Ck=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(qu.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,allowedTypes:o,accept:r,onSelect:l,onSelectURL:i,onFilesUpload:a=u.noop,name:c=(0,h.__)("Replace"),createNotice:d,removeNotice:f,children:g}=e;const[v,b]=(0,s.useState)(t),k=(0,m.useSelect)((e=>e(Fn).getSettings().mediaUpload),[]),_=(0,s.createRef)(),y=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),E=e=>{const t=document.createElement("div");t.innerHTML=(0,s.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{d("error",n,{speak:!0,id:y,isDismissible:!0})}),1e3)},C=e=>{b(e.url),l(e),(0,Nt.speak)((0,h.__)("The media file has been replaced")),f(y)},w=e=>{e.keyCode===Ma.DOWN&&(e.preventDefault(),e.target.click())};return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{ref:_,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:w},c)},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(yk,{value:n,onSelect:e=>C(e),allowedTypes:o,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:kk,onClick:t},(0,h.__)("Open Media Library"))}}),(0,s.createElement)(Ek,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{(e=>{const t=e.target.files;a(t),k({allowedTypes:o,filesList:t,onFileChange:e=>{let[t]=e;C(t)},onError:E})})(e)},accept:r,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:_k,onClick:()=>{t()}},(0,h.__)("Upload"))}})),g),i&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,h.__)("Current media URL:")),(0,s.createElement)(bk,{value:{url:v},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;b(t),i(t),_.current.focus()}})))}})}));function wk(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,s.createElement)(p.ExternalLink,{className:r,href:t},n||(0,Ed.filterURLForDisplay)((0,Ed.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function Sk(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...a}=e;const[c,u]=(0,s.useState)(!1),d=!!o&&c;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},a),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:sp,label:(0,h.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}Sk.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)(Yb,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:jb,label:(0,h.__)("Apply"),type:"submit"}))},Sk.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(wk,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:uk,label:(0,h.__)("Edit"),onClick:o}))};var Bk=Sk;const Ik=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(Bk,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,h.__)("URL"),placeholder:(0,h.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:jb,label:(0,h.__)("Apply"),type:"submit"})))};var xk=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:g,multiple:v=!1,handleUpload:b=!0,dropZoneUIOnly:k,disableDropZone:_,disableMediaButtons:y,onError:E,onSelect:C,onCancel:w,onSelectURL:S,onDoubleClick:B,onFilesPreUpload:I=u.noop,onHTMLDrop:x=u.noop,children:T,mediaLibraryButton:N,placeholder:P,style:M}=e;const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(Fn);return t().mediaUpload}),[]),[L,A]=(0,s.useState)(""),[D,O]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;A(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const F=e=>{A(e.target.value)},z=()=>{O(!0)},V=()=>{O(!1)},H=e=>{e.preventDefault(),L&&S&&(S(L),V())},U=e=>{if(!b)return C(e);let o;if(I(e),v)if(g){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));C(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=C;else o=e=>{let[t]=e;return C(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:E})},G=e=>{U(e.target.files)},W=null!=P?P:e=>{let{instructions:t,title:u}=l;if(R||S||(t=(0,h.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&R&&(t=(0,h.__)("Upload a media file or pick one from your media library."),l?t=(0,h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,h.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,h.__)("Media"),l?u=(0,h.__)("Audio"):i?u=(0,h.__)("Image"):s&&(u=(0,h.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:B,preview:i,style:M},e,T)},$=()=>_?null:(0,s.createElement)(p.DropZone,{onFilesDrop:U,onHTMLDrop:x}),j=()=>w&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,h.__)("Cancel"),variant:"link",onClick:w},(0,h.__)("Cancel")),K=()=>S&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:D,variant:"tertiary"},(0,h.__)("Insert from URL")),D&&(0,s.createElement)(Ik,{src:L,onChange:F,onSubmit:H,onClose:V}));return k||y?(k&&Rt()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),(0,s.createElement)(Ek,null,$())):(0,s.createElement)(Ek,{fallback:W(K())},(()=>{const e=null!=N?N:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Media Library"))},o=(0,s.createElement)(yk,{addToGallery:g,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:C,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(R&&d)return(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{onChange:G,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,h.__)("Upload")),o,K(),j());return W(n)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:f,multiple:v},(0,h.__)("Upload")),o,K(),j());return W(e)}return W(o)})())}));var Tk=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{let{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(Lf,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const Nk={position:"bottom right",isAlternate:!0};var Pk=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:sp,label:(0,h.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,h.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:Nk})))})));var Mk=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Pk,null)))):(0,s.createElement)(qn,{group:"inline"},(0,s.createElement)(Pk,null))};function Rk(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(Fn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==Ma.DELETE&&o!==Ma.BACKSPACE&&o!==Ma.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function Lk(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif)$/.test(t)})).map((e=>``)).join("")}var Ak=window.wp.shortcode;function Dk(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function Ok(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Fk(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?Fk.EMPTY_ARRAY:t||n?t||(Rt()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),n.map((e=>`core/${e}`))):void 0}Fk.EMPTY_ARRAY=[];function zk(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const s=[],[a,c]=(0,Pt.split)(t),u=n.length>0;let d=-1;const p=(0,Pt.isEmpty)(a)&&!(0,Pt.isEmpty)(c);u&&(0,Pt.isEmpty)(a)||(s.push(r((0,Pt.toHTMLString)({value:a,multilineTag:i}),!p)),d+=1),u?(s.push(...n),d+=n.length):l&&s.push(l()),(u||l)&&(0,Pt.isEmpty)(c)||s.push(r((0,Pt.toHTMLString)({value:c,multilineTag:i}),p));o(s,u?d:1,u?-1:0)}function Vk(e,t){return t?(0,Pt.replace)(e,/\n+/g,Pt.__UNSTABLE_LINE_SEPARATOR):(0,Pt.replace)(e,new RegExp(Pt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function Hk(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:h}=t.current;if(!n)return void e.preventDefault();const{clipboardData:g}=e;let v="",b="";try{v=g.getData("text/plain"),b=g.getData("text/html")}catch(e){try{b=g.getData("Text")}catch(e){return}}if(b=function(e){const t=/.*/s,n=/.*/s;return e.replace(t,"").replace(n,"")}(b),b=function(e){const t="";if(e.startsWith(t))return e.slice(t.length);return e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,Pt.insert)(i,v));const k=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,rr.getFilesFromDataTransfer)(g)];if("true"===g.getData("rich-text")){const e=g.getData("rich-text-multi-line-tag")||void 0;let t=(0,Pt.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=Vk(t,!!m),Dk(t,i.activeFormats),void l((0,Pt.insert)(i,t))}if(h)return void l((0,Pt.insert)(i,(0,Pt.create)({text:v})));if(_&&_.length&&!b){const e=(0,r.pasteHandler)({HTML:Lk(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,Pt.isEmpty)(i)?c(e):zk({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,Pt.isEmpty)(i)&&(E=v,(0,Ak.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,Pt.isEmpty)(i)&&(0,Ed.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,Pt.create)({html:C});e=Vk(e,!!m),Dk(e,i.activeFormats),l((0,Pt.insert)(i,e))}else C.length>0&&(c&&(0,Pt.isEmpty)(i)?c(C,C.length-1,-1):zk({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function Uk(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(Fn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),a=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),c=(0,r.findTransform)(a,(e=>{let{prefix:t}=e;return s===t}));if(!c)return;const u=(0,Pt.toHTMLString)({value:(0,Pt.slice)(e,l,i.length)});t([c.transform(u)]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),s);d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function Gk(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(Fn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==Ma.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Pt.insert)(m,"\n")):f&&(0,Pt.__unstableIsEmptyLine)(m)?zk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,Pt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Pt.insert)(m,"\n")):!f&&r?p():f&&zk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function Wk(e){return e(Pt.store).getFormatTypes()}const $k=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function jk(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function Kk(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function qk(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,Pt.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,Pt.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,Pt.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const Yk=(0,s.createContext)(),Xk=(0,s.createContext)();const Qk=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:f,isSelected:h,multiline:g,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:w,onRemove:S,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const z=(0,d.useInstanceId)(e);N=N||z,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const V=(0,s.useRef)(),{clientId:H}=Un(),{selectionStart:U,selectionEnd:G,isSelected:W,disabled:$}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(Fn),l=t(),i=n();let s;return void 0===h?s=l.clientId===H&&l.attributeKey===N:h&&(s=l.clientId===H),{selectionStart:s?l.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s,disabled:o()||r()}})),{selectionChange:j}=(0,m.useDispatch)(Fn),K=Ok(g),q=Fk({allowedFormats:E,formattingControls:C,disableFormats:L}),Y=!q||q.length>0;let X=a,Q=f;Array.isArray(a)&&(X=r.children.toHTML(a),Q=e=>f(r.children.fromDOM((0,Pt.__unstableCreateElement)(document,e).childNodes)));const Z=(0,s.useCallback)(((e,t)=>{j(H,N,e,t)}),[H,N]),{formatTypes:J,prepareHandlers:ee,valueHandlers:te,changeHandlers:ne,dependencies:oe}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(Wk,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&$k.has(n))}))),[l,r,$k]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:H,identifier:N,withoutInteractiveFormatting:w,allowedFormats:q});function re(e){return J.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Pt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:le,onChange:ie,ref:se}=(0,Pt.__unstableUseRichText)({value:X,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;Q(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:U,selectionEnd:G,onSelectionChange:Z,placeholder:y,__unstableIsSelected:W,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...oe,l],__unstableAfterParse:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:re,__unstableAddInvisibleFormats:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ae=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:ev(e)})}({onReplace:_,completers:k,record:le,onChange:ie});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(Fn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(Fn);(0,s.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:le}),function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(Fn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:X,value:le});const ce=(0,s.useRef)(new Set),ue=(0,s.useRef)(new Set);function de(){V.current.focus()}const pe=l,me=(0,s.createElement)(s.Fragment,null,W&&(0,s.createElement)(Yk.Provider,{value:ce},(0,s.createElement)(Xk.Provider,{value:ue},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,s.createElement)(qk,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:V})))),W&&Y&&(0,s.createElement)(Mk,{inline:v,anchorRef:V.current}),(0,s.createElement)(pe,i({role:"textbox","aria-multiline":!0,"aria-label":y},F,ae,{ref:(0,d.useMergeRefs)([ae.ref,F.ref,se,Uk({value:le,onChange:ie,__unstableAllowPrefixTransformations:O,formatTypes:J,onReplace:_}),(0,d.useRefEffect)((e=>{function t(e){(Ma.isKeyboardEvent.primary(e,"z")||Ma.isKeyboardEvent.primary(e,"y")||Ma.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),jk(ce),Kk(ue),Rk(),Hk({isSelected:W,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:K,preserveWhiteSpace:P,pastePlainText:M}),Gk({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:K,onChange:ie,disableLineBreaks:A,onSplitAtEnd:x}),V,n]),contentEditable:!$||void 0,suppressContentEditableWarning:!$,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===Ma.DELETE||t===Ma.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===Ma.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,Pt.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),S&&(0,Pt.isEmpty)(le)&&l&&S(!l),e.preventDefault()}}})));if(!b)return me;Rt()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const fe=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:fe},me)}));Qk.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=Ok(o);!t&&i&&(t=`<${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},Qk.isEmpty=e=>!e||0===e.length;var Zk=Qk;const Jk=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Zk,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));Jk.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};var e_=Jk;var t_=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(e_,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(Er.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function n_(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(n_),l=o||(0,h.sprintf)((0,h._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var o_=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",label:(0,h.__)("All")},viewports:d=[{id:"small",label:(0,h.__)("Small screens")},{id:"medium",label:(0,h.__)("Medium screens")},{id:"large",label:(0,h.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,h.sprintf)((0,h.__)("Use the same %s on all screensizes."),n),f=(0,h.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,s.createElement)(n_,{property:n,viewport:u}),u);return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&g,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(n_,{property:n,viewport:e}),e))))))))};function r_(e){let{character:t,type:n,onUse:o}=e;const r=(0,s.useContext)(Yk),l=(0,s.useRef)();return l.current=o,(0,s.useEffect)((()=>{function e(e){Ma.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function l_(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,a="RichText.ToolbarControls";return n&&(a+=`.${n}`),o&&r&&(t=Ma.displayShortcut[o](r)),(0,s.createElement)(p.Fill,{name:a},(0,s.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function i_(e){let{inputType:t,onInput:n}=e;const o=(0,s.useContext)(Xk),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const s_=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var a_=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(Fn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(Fn),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?s_:uk,"aria-expanded":r,"aria-haspopup":"true",onClick:l,label:(0,h.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,h.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wo,{icon:uk}),(0,h.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,s_,(0,h.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,h.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function c_(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:po("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,s.createElement)(p.__experimentalUnitControl,i({units:o},n))}var u_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class d_ extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,h.__)("Edit link"):(0,h.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:nf,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:u_,label:(0,h.__)("Close"),onClick:this.toggle}),(0,s.createElement)(Yb,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:jb,label:(0,h.__)("Submit"),type:"submit"}))))}}var p_=d_;var m_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const f_="none",h_="custom",g_="media",v_="attachment",b_=["noreferrer","noopener"],k_=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),__=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:c,rel:d}=e;const[m,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!0)})),[v,b]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),y=(0,s.useRef)(null),E=(0,s.useCallback)((()=>{t!==g_&&t!==v_||_(""),b(!0)})),C=(0,s.useCallback)((()=>{b(!1)})),w=(0,s.useCallback)((()=>{_(null),C(),f(!1)})),S=e=>{let t=e;return void 0===e||(0,u.isEmpty)(t)||(0,u.isEmpty)(t)||((0,u.each)(b_,(e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")})),t!==e&&(t=t.trim()),(0,u.isEmpty)(t)&&(t=void 0)),t},B=(0,s.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),I=(0,s.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=T().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||h_;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),x=(0,s.useCallback)((()=>{n({linkDestination:f_,href:""})})),T=()=>{const e=[{linkDestination:g_,title:(0,h.__)("Media File"),url:"image"===r?l:void 0,icon:k_}];return"image"===r&&i&&e.push({linkDestination:v_,title:(0,h.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},N=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;return n=t||d?S(d):void 0,{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link Rel"),value:S(d)||"",onChange:e=>{n({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),P=null!==k?k:o,M=((0,u.find)(T(),["linkDestination",t])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:nf,className:"components-toolbar__control",label:o?(0,h.__)("Edit link"):(0,h.__)("Insert link"),"aria-expanded":m,onClick:g}),m&&(0,s.createElement)(Bk,{onFocusOutside:B(),onClose:w,renderSettings:()=>N,additionalControls:!P&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(T(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=T();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:h_}).linkDestination:f_,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,s.createElement)(Bk.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:P,onChangeInputValue:_,onSubmit:I(),autocompleteRef:y}),o&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bk.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:M}),(0,s.createElement)(p.Button,{icon:m_,label:(0,h.__)("Remove link"),onClick:x}))))};function y_(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,children:(0,h.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&Db},(0,h.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&Db},(0,h.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&Db},(0,h.__)("Mobile"))),t)))}function E_(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var C_=(0,m.withSelect)((e=>({selectedBlockClientId:e(Fn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Ha(t);return t?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,h.__)("Skip to the selected block")):null})),w_=window.wp.wordcount;var S_=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Fn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,w_.count)((0,r.serialize)(t),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(oc,{icon:yp,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,h.sprintf)((0,h._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,h.sprintf)((0,h._n)("%d word","%d words",n),n))))}));function B_(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(Fn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,h.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return o&&(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,h.__)("Default Style"),onChange:a})}const I_=e=>{let{clientId:t,blockName:n,hasBlockStyles:o,bubblesVirtually:l}=e;const i=Qd(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(rc,i),(0,s.createElement)(Yv,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Styles")},(0,s.createElement)(xp,{clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(B_,{blockName:n}))),(0,s.createElement)(er.Slot,{bubblesVirtually:l}),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",bubblesVirtually:l,label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",bubblesVirtually:l,label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(x_,{bubblesVirtually:l})),(0,s.createElement)(C_,{key:"back"}))},x_=e=>{let{bubblesVirtually:t}=e;const n=(0,p.__experimentalUseSlot)(Jo.slotName);return Boolean(n.fills&&n.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,h.__)("Advanced"),initialOpen:!1},(0,s.createElement)(er.Slot,{__experimentalGroup:"advanced",bubblesVirtually:t})):null};var T_=e=>{let{showNoBlockSelectedMessage:t=!0,bubblesVirtually:n=!0}=e;const{count:o,hasBlockStyles:l,selectedBlockName:i,selectedBlockClientId:a,blockType:c}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(Fn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(o>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(S_,null),(0,s.createElement)(er.Slot,null),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}));const u=i===(0,r.getUnregisteredTypeHandlerName)();return c&&a&&!u?(0,s.createElement)(I_,{clientId:a,blockName:c.name,hasBlockStyles:l,bubblesVirtually:n}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,h.__)("No block selected.")):null};function N_(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(Fn).getSettings().hasFixedToolbar),[]),a=(0,gc.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(Fn),{duplicateBlocks:h,removeBlocks:g,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(Fn);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(a("core/block-editor/delete-multi-selection",e)){if(["INPUT","TEXTAREA"].includes(e.target.nodeName)||e.defaultPrevented)return;const t=c();t.length>1&&(e.preventDefault(),g(t))}else if(a("core/block-editor/unselect",e)){c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}}),(0,s.createElement)(Kd,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)(im,{isFixed:!0}),(0,s.createElement)(um,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:Wd(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:Wd(n)})))}var P_=function(e){let{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:l=!1,__experimentalInsertionIndex:i,__experimentalFilterValue:a,onSelect:c=u.noop,shouldFocusBlock:d=!1}=e;const p=(0,m.useSelect)((e=>{const{getBlockRootClientId:o}=e(Fn);return t||o(n)||void 0}),[n,t]);return(0,s.createElement)(Ld,{onSelect:c,rootClientId:p,clientId:n,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:l,__experimentalInsertionIndex:i,__experimentalFilterValue:a,shouldFocusBlock:d})};function M_(){return null}M_.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(gc.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,h.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,h.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,h.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,h.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,h.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,h.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,h.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,h.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,h.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,h.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var R_=M_;function L_(){return Rt()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in."}),null}const A_=new Set([Ma.UP,Ma.RIGHT,Ma.DOWN,Ma.LEFT,Ma.ENTER,Ma.BACKSPACE]);function D_(){const e=(0,m.useSelect)((e=>e(Fn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(Fn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function O_(){const e=(0,m.useSelect)((e=>e(Fn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(Fn),o=D_(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let s;function a(e){const{target:t}=e;s=l.setTimeout((()=>{(0,rr.isTextField)(t)||n()}))}function c(e){const{keyCode:t}=e;t!==Ma.ESCAPE&&t!==Ma.TAB||n()}function u(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",a),o.addEventListener("keydown",c),r.addEventListener("selectionchange",u),()=>{l.clearTimeout(s),o.removeEventListener("focus",a),o.removeEventListener("keydown",c),r.removeEventListener("selectionchange",u)}}function i(e){const{type:n,target:r}=e;(0,rr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&A_.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var F_=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:O_()},t)};function z_(){return Rt()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const V_=-1!==window.navigator.userAgent.indexOf("Trident"),H_=new Set([Ma.UP,Ma.DOWN,Ma.LEFT,Ma.RIGHT]);function U_(){const e=(0,m.useSelect)((e=>e(Fn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,rr.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(H_.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,rr.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const f=c?o.innerHeight:a.clientHeight;i.top+i.height>d+f||i.top{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var G_=V_?e=>e.children:function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:U_(),className:"block-editor__typewriter"},t)};const W_=(0,u.overEvery)([rr.isTextField,rr.focus.tabbable.isTabbableIndex]);function $_(){return(0,d.useRefEffect)((e=>{function t(t){if(t.target!==e)return;const n=rr.focus.focusable.find(e),o=(0,u.findLast)(n,W_);if(!o)return;const{bottom:r}=o.getBoundingClientRect();t.clientY{e.addEventListener("mousedown",t)}}),[])}const j_=(0,s.createContext)({});function K_(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function q_(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,s.useContext)(j_),{name:r}=Un();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,s.useMemo)((()=>K_(o,n,e)),[o,n,e]),a=(0,s.useCallback)((e=>{let{children:t}=e;return(0,s.createElement)(j_.Provider,{value:i},t)}),[i]);return[l,a]}function Y_(e){if(void 0===e)e=v.colors;else{const t=e.filter((e=>e.color));0===t.length?e=v.colors:t.lengthe.gradient));0===t.length?e=v.gradients:t.lengthQ_(oy(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function J_(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=Z_(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return Q_(e)}function ey(e){for(let t=0;tr.height?r.width:r.height)*o,"%":("font"===r.type?r.fontSize:r.width)*o,ch:8,ex:7.15625,lh:r.lineHeight},i={in:n,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":i[e.unit]?(i[e.unit]*e.value).toFixed(0)+"px":null}function oy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=Q_(e);return n.unit||(n=J_(e)),ey(e)&&!n.unit?ty(e):ny(n,t)}const ry={};function ly(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var iy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+ly(t);return ry[n]||(ry[n]=oy(e,t)),ry[n]}}(),(window.wp=window.wp||{}).blockEditor=o}(); \ No newline at end of file diff --git a/wp-includes/js/dist/block-library.js b/wp-includes/js/dist/block-library.js index 6e2f0aeaae..9a00121be9 100644 --- a/wp-includes/js/dist/block-library.js +++ b/wp-includes/js/dist/block-library.js @@ -1,403 +1,9 @@ -this["wp"] = this["wp"] || {}; this["wp"]["blockLibrary"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "K51g"); -/******/ }) -/************************************************************************/ -/******/ ({ +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ -/***/ "+WrK": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const symbol = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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 */ __webpack_exports__["a"] = (symbol); - - -/***/ }), - -/***/ "//kF": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const footer = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (footer); - - -/***/ }), - -/***/ "1CF3": +/***/ 3827: /***/ (function(module, exports) { -(function() { module.exports = window["wp"]["dom"]; }()); - -/***/ }), - -/***/ "1Yn1": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const code = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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 */ __webpack_exports__["a"] = (code); - - -/***/ }), - -/***/ "1ZqX": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["data"]; }()); - -/***/ }), - -/***/ "1iEr": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const chevronRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" -})); -/* harmony default export */ __webpack_exports__["a"] = (chevronRight); - - -/***/ }), - -/***/ "2gm7": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const chevronLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (chevronLeft); - - -/***/ }), - -/***/ "4eJC": -/***/ (function(module, exports, __webpack_require__) { - -/** - * Memize options object. - * - * @typedef MemizeOptions - * - * @property {number} [maxSize] Maximum size of the cache. - */ - -/** - * Internal cache entry. - * - * @typedef MemizeCacheNode - * - * @property {?MemizeCacheNode|undefined} [prev] Previous node. - * @property {?MemizeCacheNode|undefined} [next] Next node. - * @property {Array<*>} args Function arguments for cache - * entry. - * @property {*} val Function result. - */ - -/** - * Properties of the enhanced function for controlling cache. - * - * @typedef MemizeMemoizedFunction - * - * @property {()=>void} clear Clear the cache. - */ - -/** - * Accepts a function to be memoized, and returns a new memoized function, with - * optional options. - * - * @template {Function} F - * - * @param {F} fn Function to memoize. - * @param {MemizeOptions} [options] Options object. - * - * @return {F & MemizeMemoizedFunction} Memoized function. - */ -function memize( fn, options ) { - var size = 0; - - /** @type {?MemizeCacheNode|undefined} */ - var head; - - /** @type {?MemizeCacheNode|undefined} */ - var tail; - - options = options || {}; - - function memoized( /* ...args */ ) { - var node = head, - len = arguments.length, - args, i; - - searchCache: while ( node ) { - // Perform a shallow equality test to confirm that whether the node - // under test is a candidate for the arguments passed. Two arrays - // are shallowly equal if their length matches and each entry is - // strictly equal between the two sets. Avoid abstracting to a - // function which could incur an arguments leaking deoptimization. - - // Check whether node arguments match arguments length - if ( node.args.length !== arguments.length ) { - node = node.next; - continue; - } - - // Check whether node arguments match arguments values - for ( i = 0; i < len; i++ ) { - if ( node.args[ i ] !== arguments[ i ] ) { - node = node.next; - continue searchCache; - } - } - - // At this point we can assume we've found a match - - // Surface matched node to head if not already - if ( node !== head ) { - // As tail, shift to previous. Must only shift if not also - // head, since if both head and tail, there is no previous. - if ( node === tail ) { - tail = node.prev; - } - - // Adjust siblings to point to each other. If node was tail, - // this also handles new tail's empty `next` assignment. - /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next; - if ( node.next ) { - node.next.prev = node.prev; - } - - node.next = head; - node.prev = null; - /** @type {MemizeCacheNode} */ ( head ).prev = node; - head = node; - } - - // Return immediately - return node.val; - } - - // No cached value found. Continue to insertion phase: - - // Create a copy of arguments (avoid leaking deoptimization) - args = new Array( len ); - for ( i = 0; i < len; i++ ) { - args[ i ] = arguments[ i ]; - } - - node = { - args: args, - - // Generate the result from original function - val: fn.apply( null, args ), - }; - - // Don't need to check whether node is already head, since it would - // have been returned above already if it was - - // Shift existing head down list - if ( head ) { - head.prev = node; - node.next = head; - } else { - // If no head, follows that there's no tail (at initial or reset) - tail = node; - } - - // Trim tail if we're reached max size and are pending cache insertion - if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) { - tail = /** @type {MemizeCacheNode} */ ( tail ).prev; - /** @type {MemizeCacheNode} */ ( tail ).next = null; - } else { - size++; - } - - head = node; - - return node.val; - } - - memoized.clear = function() { - head = null; - tail = null; - size = 0; - }; - - if ( false ) {} - - // Ignore reason: There's not a clear solution to create an intersection of - // the function with additional properties, where the goal is to retain the - // function signature of the incoming argument and add control properties - // on the return value. - - // @ts-ignore - return memoized; -} - -module.exports = memize; - - -/***/ }), - -/***/ "A/WM": -/***/ (function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see @@ -508,106 +114,84 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), -/***/ "B9Az": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 4403: +/***/ (function(module, exports) { -"use strict"; +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); +(function () { + 'use strict'; -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); + var hasOwn = {}.hasOwnProperty; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js + function classNames() { + var classes = []; + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; -/** - * WordPress dependencies - */ + var argType = typeof arg; -const pencil = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z" -})); -/* harmony default export */ var library_pencil = (pencil); + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === 'object') { + if (arg.toString === Object.prototype.toString) { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } else { + classes.push(arg.toString()); + } + } + } -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js -/** - * Internal dependencies - */ + return classes.join(' '); + } -/* harmony default export */ var edit = __webpack_exports__["a"] = (library_pencil); + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); /***/ }), -/***/ "Bpkj": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (link); - - -/***/ }), - -/***/ "Civd": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const layout = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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 */ __webpack_exports__["a"] = (layout); - - -/***/ }), - -/***/ "FEKF": -/***/ (function(module, exports, __webpack_require__) { +/***/ 5027: +/***/ (function(module) { /*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */ (function (global, factory) { true ? module.exports = factory() : - undefined; + 0; }(this, (function () { 'use strict'; function _classCallCheck(instance, Constructor) { @@ -1056,592 +640,908 @@ return FastAverageColor; /***/ }), -/***/ "FqII": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["date"]; }()); - -/***/ }), - -/***/ "G8mJ": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - +/***/ 9756: +/***/ (function(module) { /** - * WordPress dependencies + * Memize options object. + * + * @typedef MemizeOptions + * + * @property {number} [maxSize] Maximum size of the cache. */ -const header = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["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" -})); -/* harmony default export */ __webpack_exports__["a"] = (header); +/** + * Internal cache entry. + * + * @typedef MemizeCacheNode + * + * @property {?MemizeCacheNode|undefined} [prev] Previous node. + * @property {?MemizeCacheNode|undefined} [next] Next node. + * @property {Array<*>} args Function arguments for cache + * entry. + * @property {*} val Function result. + */ + +/** + * Properties of the enhanced function for controlling cache. + * + * @typedef MemizeMemoizedFunction + * + * @property {()=>void} clear Clear the cache. + */ + +/** + * Accepts a function to be memoized, and returns a new memoized function, with + * optional options. + * + * @template {Function} F + * + * @param {F} fn Function to memoize. + * @param {MemizeOptions} [options] Options object. + * + * @return {F & MemizeMemoizedFunction} Memoized function. + */ +function memize( fn, options ) { + var size = 0; + + /** @type {?MemizeCacheNode|undefined} */ + var head; + + /** @type {?MemizeCacheNode|undefined} */ + var tail; + + options = options || {}; + + function memoized( /* ...args */ ) { + var node = head, + len = arguments.length, + args, i; + + searchCache: while ( node ) { + // Perform a shallow equality test to confirm that whether the node + // under test is a candidate for the arguments passed. Two arrays + // are shallowly equal if their length matches and each entry is + // strictly equal between the two sets. Avoid abstracting to a + // function which could incur an arguments leaking deoptimization. + + // Check whether node arguments match arguments length + if ( node.args.length !== arguments.length ) { + node = node.next; + continue; + } + + // Check whether node arguments match arguments values + for ( i = 0; i < len; i++ ) { + if ( node.args[ i ] !== arguments[ i ] ) { + node = node.next; + continue searchCache; + } + } + + // At this point we can assume we've found a match + + // Surface matched node to head if not already + if ( node !== head ) { + // As tail, shift to previous. Must only shift if not also + // head, since if both head and tail, there is no previous. + if ( node === tail ) { + tail = node.prev; + } + + // Adjust siblings to point to each other. If node was tail, + // this also handles new tail's empty `next` assignment. + /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next; + if ( node.next ) { + node.next.prev = node.prev; + } + + node.next = head; + node.prev = null; + /** @type {MemizeCacheNode} */ ( head ).prev = node; + head = node; + } + + // Return immediately + return node.val; + } + + // No cached value found. Continue to insertion phase: + + // Create a copy of arguments (avoid leaking deoptimization) + args = new Array( len ); + for ( i = 0; i < len; i++ ) { + args[ i ] = arguments[ i ]; + } + + node = { + args: args, + + // Generate the result from original function + val: fn.apply( null, args ), + }; + + // Don't need to check whether node is already head, since it would + // have been returned above already if it was + + // Shift existing head down list + if ( head ) { + head.prev = node; + node.next = head; + } else { + // If no head, follows that there's no tail (at initial or reset) + tail = node; + } + + // Trim tail if we're reached max size and are pending cache insertion + if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) { + tail = /** @type {MemizeCacheNode} */ ( tail ).prev; + /** @type {MemizeCacheNode} */ ( tail ).next = null; + } else { + size++; + } + + head = node; + + return node.val; + } + + memoized.clear = function() { + head = null; + tail = null; + size = 0; + }; + + if ( false ) {} + + // Ignore reason: There's not a clear solution to create an intersection of + // the function with additional properties, where the goal is to retain the + // function signature of the incoming argument and add control properties + // on the return value. + + // @ts-ignore + return memoized; +} + +module.exports = memize; -/***/ }), - -/***/ "GRId": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["element"]; }()); - -/***/ }), - -/***/ "HSyU": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["blocks"]; }()); - -/***/ }), - -/***/ "JREk": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["serverSideRender"]; }()); - -/***/ }), - -/***/ "K51g": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ }) +/******/ }); +/************************************************************************/ +/******/ // 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].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(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 */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +!function() { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS -__webpack_require__.d(__webpack_exports__, "__experimentalGetCoreBlocks", function() { return /* binding */ __experimentalGetCoreBlocks; }); -__webpack_require__.d(__webpack_exports__, "registerCoreBlocks", function() { return /* binding */ registerCoreBlocks; }); -__webpack_require__.d(__webpack_exports__, "__experimentalRegisterExperimentalCoreBlocks", function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; }); +__webpack_require__.d(__webpack_exports__, { + "__experimentalGetCoreBlocks": function() { return /* binding */ __experimentalGetCoreBlocks; }, + "__experimentalRegisterExperimentalCoreBlocks": function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; }, + "registerCoreBlocks": function() { return /* binding */ registerCoreBlocks; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js var archives_namespaceObject = {}; __webpack_require__.r(archives_namespaceObject); -__webpack_require__.d(archives_namespaceObject, "metadata", function() { return archives_metadata; }); -__webpack_require__.d(archives_namespaceObject, "name", function() { return archives_name; }); -__webpack_require__.d(archives_namespaceObject, "settings", function() { return archives_settings; }); +__webpack_require__.d(archives_namespaceObject, { + "metadata": function() { return metadata; }, + "name": function() { return archives_name; }, + "settings": function() { return settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js var build_module_audio_namespaceObject = {}; __webpack_require__.r(build_module_audio_namespaceObject); -__webpack_require__.d(build_module_audio_namespaceObject, "metadata", function() { return audio_metadata; }); -__webpack_require__.d(build_module_audio_namespaceObject, "name", function() { return audio_name; }); -__webpack_require__.d(build_module_audio_namespaceObject, "settings", function() { return audio_settings; }); +__webpack_require__.d(build_module_audio_namespaceObject, { + "metadata": function() { return audio_metadata; }, + "name": function() { return audio_name; }, + "settings": function() { return audio_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js -var button_namespaceObject = {}; -__webpack_require__.r(button_namespaceObject); -__webpack_require__.d(button_namespaceObject, "metadata", function() { return button_metadata; }); -__webpack_require__.d(button_namespaceObject, "name", function() { return button_name; }); -__webpack_require__.d(button_namespaceObject, "settings", function() { return button_settings; }); +var build_module_button_namespaceObject = {}; +__webpack_require__.r(build_module_button_namespaceObject); +__webpack_require__.d(build_module_button_namespaceObject, { + "metadata": function() { return button_metadata; }, + "name": function() { return button_name; }, + "settings": function() { return button_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js var build_module_buttons_namespaceObject = {}; __webpack_require__.r(build_module_buttons_namespaceObject); -__webpack_require__.d(build_module_buttons_namespaceObject, "metadata", function() { return buttons_metadata; }); -__webpack_require__.d(build_module_buttons_namespaceObject, "name", function() { return buttons_name; }); -__webpack_require__.d(build_module_buttons_namespaceObject, "settings", function() { return buttons_settings; }); +__webpack_require__.d(build_module_buttons_namespaceObject, { + "metadata": function() { return buttons_metadata; }, + "name": function() { return buttons_name; }, + "settings": function() { return buttons_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js var build_module_calendar_namespaceObject = {}; __webpack_require__.r(build_module_calendar_namespaceObject); -__webpack_require__.d(build_module_calendar_namespaceObject, "metadata", function() { return calendar_metadata; }); -__webpack_require__.d(build_module_calendar_namespaceObject, "name", function() { return calendar_name; }); -__webpack_require__.d(build_module_calendar_namespaceObject, "settings", function() { return calendar_settings; }); +__webpack_require__.d(build_module_calendar_namespaceObject, { + "metadata": function() { return calendar_metadata; }, + "name": function() { return calendar_name; }, + "settings": function() { return calendar_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js var categories_namespaceObject = {}; __webpack_require__.r(categories_namespaceObject); -__webpack_require__.d(categories_namespaceObject, "metadata", function() { return categories_metadata; }); -__webpack_require__.d(categories_namespaceObject, "name", function() { return categories_name; }); -__webpack_require__.d(categories_namespaceObject, "settings", function() { return categories_settings; }); +__webpack_require__.d(categories_namespaceObject, { + "metadata": function() { return categories_metadata; }, + "name": function() { return categories_name; }, + "settings": function() { return categories_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js var freeform_namespaceObject = {}; __webpack_require__.r(freeform_namespaceObject); -__webpack_require__.d(freeform_namespaceObject, "metadata", function() { return freeform_metadata; }); -__webpack_require__.d(freeform_namespaceObject, "name", function() { return freeform_name; }); -__webpack_require__.d(freeform_namespaceObject, "settings", function() { return freeform_settings; }); +__webpack_require__.d(freeform_namespaceObject, { + "metadata": function() { return freeform_metadata; }, + "name": function() { return freeform_name; }, + "settings": function() { return freeform_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js -var code_namespaceObject = {}; -__webpack_require__.r(code_namespaceObject); -__webpack_require__.d(code_namespaceObject, "metadata", function() { return code_metadata; }); -__webpack_require__.d(code_namespaceObject, "name", function() { return code_name; }); -__webpack_require__.d(code_namespaceObject, "settings", function() { return code_settings; }); +var build_module_code_namespaceObject = {}; +__webpack_require__.r(build_module_code_namespaceObject); +__webpack_require__.d(build_module_code_namespaceObject, { + "metadata": function() { return code_metadata; }, + "name": function() { return code_name; }, + "settings": function() { return code_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js var build_module_column_namespaceObject = {}; __webpack_require__.r(build_module_column_namespaceObject); -__webpack_require__.d(build_module_column_namespaceObject, "metadata", function() { return column_metadata; }); -__webpack_require__.d(build_module_column_namespaceObject, "name", function() { return column_name; }); -__webpack_require__.d(build_module_column_namespaceObject, "settings", function() { return column_settings; }); +__webpack_require__.d(build_module_column_namespaceObject, { + "metadata": function() { return column_metadata; }, + "name": function() { return column_name; }, + "settings": function() { return column_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js var build_module_columns_namespaceObject = {}; __webpack_require__.r(build_module_columns_namespaceObject); -__webpack_require__.d(build_module_columns_namespaceObject, "metadata", function() { return columns_metadata; }); -__webpack_require__.d(build_module_columns_namespaceObject, "name", function() { return columns_name; }); -__webpack_require__.d(build_module_columns_namespaceObject, "settings", function() { return columns_settings; }); +__webpack_require__.d(build_module_columns_namespaceObject, { + "metadata": function() { return columns_metadata; }, + "name": function() { return columns_name; }, + "settings": function() { return columns_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js var build_module_cover_namespaceObject = {}; __webpack_require__.r(build_module_cover_namespaceObject); -__webpack_require__.d(build_module_cover_namespaceObject, "metadata", function() { return cover_metadata; }); -__webpack_require__.d(build_module_cover_namespaceObject, "name", function() { return cover_name; }); -__webpack_require__.d(build_module_cover_namespaceObject, "settings", function() { return cover_settings; }); +__webpack_require__.d(build_module_cover_namespaceObject, { + "metadata": function() { return cover_metadata; }, + "name": function() { return cover_name; }, + "settings": function() { return cover_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js var embed_namespaceObject = {}; __webpack_require__.r(embed_namespaceObject); -__webpack_require__.d(embed_namespaceObject, "metadata", function() { return embed_metadata; }); -__webpack_require__.d(embed_namespaceObject, "name", function() { return embed_name; }); -__webpack_require__.d(embed_namespaceObject, "settings", function() { return embed_settings; }); +__webpack_require__.d(embed_namespaceObject, { + "metadata": function() { return embed_metadata; }, + "name": function() { return embed_name; }, + "settings": function() { return embed_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js var build_module_file_namespaceObject = {}; __webpack_require__.r(build_module_file_namespaceObject); -__webpack_require__.d(build_module_file_namespaceObject, "metadata", function() { return file_metadata; }); -__webpack_require__.d(build_module_file_namespaceObject, "name", function() { return file_name; }); -__webpack_require__.d(build_module_file_namespaceObject, "settings", function() { return file_settings; }); +__webpack_require__.d(build_module_file_namespaceObject, { + "metadata": function() { return file_metadata; }, + "name": function() { return file_name; }, + "settings": function() { return file_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js var build_module_gallery_namespaceObject = {}; __webpack_require__.r(build_module_gallery_namespaceObject); -__webpack_require__.d(build_module_gallery_namespaceObject, "metadata", function() { return gallery_metadata; }); -__webpack_require__.d(build_module_gallery_namespaceObject, "name", function() { return gallery_name; }); -__webpack_require__.d(build_module_gallery_namespaceObject, "settings", function() { return gallery_settings; }); +__webpack_require__.d(build_module_gallery_namespaceObject, { + "metadata": function() { return gallery_metadata; }, + "name": function() { return gallery_name; }, + "settings": function() { return gallery_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js -var group_namespaceObject = {}; -__webpack_require__.r(group_namespaceObject); -__webpack_require__.d(group_namespaceObject, "metadata", function() { return group_metadata; }); -__webpack_require__.d(group_namespaceObject, "name", function() { return group_name; }); -__webpack_require__.d(group_namespaceObject, "settings", function() { return group_settings; }); +var build_module_group_namespaceObject = {}; +__webpack_require__.r(build_module_group_namespaceObject); +__webpack_require__.d(build_module_group_namespaceObject, { + "metadata": function() { return group_metadata; }, + "name": function() { return group_name; }, + "settings": function() { return group_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js var build_module_heading_namespaceObject = {}; __webpack_require__.r(build_module_heading_namespaceObject); -__webpack_require__.d(build_module_heading_namespaceObject, "metadata", function() { return heading_metadata; }); -__webpack_require__.d(build_module_heading_namespaceObject, "name", function() { return heading_name; }); -__webpack_require__.d(build_module_heading_namespaceObject, "settings", function() { return heading_settings; }); +__webpack_require__.d(build_module_heading_namespaceObject, { + "metadata": function() { return heading_metadata; }, + "name": function() { return heading_name; }, + "settings": function() { return heading_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js var build_module_html_namespaceObject = {}; __webpack_require__.r(build_module_html_namespaceObject); -__webpack_require__.d(build_module_html_namespaceObject, "metadata", function() { return html_metadata; }); -__webpack_require__.d(build_module_html_namespaceObject, "name", function() { return html_name; }); -__webpack_require__.d(build_module_html_namespaceObject, "settings", function() { return html_settings; }); +__webpack_require__.d(build_module_html_namespaceObject, { + "metadata": function() { return html_metadata; }, + "name": function() { return html_name; }, + "settings": function() { return html_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js var build_module_image_namespaceObject = {}; __webpack_require__.r(build_module_image_namespaceObject); -__webpack_require__.d(build_module_image_namespaceObject, "metadata", function() { return image_metadata; }); -__webpack_require__.d(build_module_image_namespaceObject, "name", function() { return image_name; }); -__webpack_require__.d(build_module_image_namespaceObject, "settings", function() { return image_settings; }); +__webpack_require__.d(build_module_image_namespaceObject, { + "metadata": function() { return image_metadata; }, + "name": function() { return image_name; }, + "settings": function() { return image_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js var latest_comments_namespaceObject = {}; __webpack_require__.r(latest_comments_namespaceObject); -__webpack_require__.d(latest_comments_namespaceObject, "metadata", function() { return latest_comments_metadata; }); -__webpack_require__.d(latest_comments_namespaceObject, "name", function() { return latest_comments_name; }); -__webpack_require__.d(latest_comments_namespaceObject, "settings", function() { return latest_comments_settings; }); +__webpack_require__.d(latest_comments_namespaceObject, { + "metadata": function() { return latest_comments_metadata; }, + "name": function() { return latest_comments_name; }, + "settings": function() { return latest_comments_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js var latest_posts_namespaceObject = {}; __webpack_require__.r(latest_posts_namespaceObject); -__webpack_require__.d(latest_posts_namespaceObject, "metadata", function() { return latest_posts_metadata; }); -__webpack_require__.d(latest_posts_namespaceObject, "name", function() { return latest_posts_name; }); -__webpack_require__.d(latest_posts_namespaceObject, "settings", function() { return latest_posts_settings; }); +__webpack_require__.d(latest_posts_namespaceObject, { + "metadata": function() { return latest_posts_metadata; }, + "name": function() { return latest_posts_name; }, + "settings": function() { return latest_posts_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js var build_module_list_namespaceObject = {}; __webpack_require__.r(build_module_list_namespaceObject); -__webpack_require__.d(build_module_list_namespaceObject, "metadata", function() { return list_metadata; }); -__webpack_require__.d(build_module_list_namespaceObject, "name", function() { return list_name; }); -__webpack_require__.d(build_module_list_namespaceObject, "settings", function() { return list_settings; }); +__webpack_require__.d(build_module_list_namespaceObject, { + "metadata": function() { return list_metadata; }, + "name": function() { return list_name; }, + "settings": function() { return list_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js var loginout_namespaceObject = {}; __webpack_require__.r(loginout_namespaceObject); -__webpack_require__.d(loginout_namespaceObject, "metadata", function() { return loginout_metadata; }); -__webpack_require__.d(loginout_namespaceObject, "name", function() { return loginout_name; }); -__webpack_require__.d(loginout_namespaceObject, "settings", function() { return loginout_settings; }); +__webpack_require__.d(loginout_namespaceObject, { + "metadata": function() { return loginout_metadata; }, + "name": function() { return loginout_name; }, + "settings": function() { return loginout_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js var media_text_namespaceObject = {}; __webpack_require__.r(media_text_namespaceObject); -__webpack_require__.d(media_text_namespaceObject, "metadata", function() { return media_text_metadata; }); -__webpack_require__.d(media_text_namespaceObject, "name", function() { return media_text_name; }); -__webpack_require__.d(media_text_namespaceObject, "settings", function() { return media_text_settings; }); +__webpack_require__.d(media_text_namespaceObject, { + "metadata": function() { return media_text_metadata; }, + "name": function() { return media_text_name; }, + "settings": function() { return media_text_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js var missing_namespaceObject = {}; __webpack_require__.r(missing_namespaceObject); -__webpack_require__.d(missing_namespaceObject, "metadata", function() { return missing_metadata; }); -__webpack_require__.d(missing_namespaceObject, "name", function() { return missing_name; }); -__webpack_require__.d(missing_namespaceObject, "settings", function() { return missing_settings; }); +__webpack_require__.d(missing_namespaceObject, { + "metadata": function() { return missing_metadata; }, + "name": function() { return missing_name; }, + "settings": function() { return missing_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js var build_module_more_namespaceObject = {}; __webpack_require__.r(build_module_more_namespaceObject); -__webpack_require__.d(build_module_more_namespaceObject, "metadata", function() { return more_metadata; }); -__webpack_require__.d(build_module_more_namespaceObject, "name", function() { return more_name; }); -__webpack_require__.d(build_module_more_namespaceObject, "settings", function() { return more_settings; }); +__webpack_require__.d(build_module_more_namespaceObject, { + "metadata": function() { return more_metadata; }, + "name": function() { return more_name; }, + "settings": function() { return more_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js var build_module_navigation_namespaceObject = {}; __webpack_require__.r(build_module_navigation_namespaceObject); -__webpack_require__.d(build_module_navigation_namespaceObject, "metadata", function() { return navigation_metadata; }); -__webpack_require__.d(build_module_navigation_namespaceObject, "name", function() { return navigation_name; }); -__webpack_require__.d(build_module_navigation_namespaceObject, "settings", function() { return navigation_settings; }); +__webpack_require__.d(build_module_navigation_namespaceObject, { + "metadata": function() { return navigation_metadata; }, + "name": function() { return navigation_name; }, + "settings": function() { return navigation_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js var navigation_link_namespaceObject = {}; __webpack_require__.r(navigation_link_namespaceObject); -__webpack_require__.d(navigation_link_namespaceObject, "metadata", function() { return navigation_link_metadata; }); -__webpack_require__.d(navigation_link_namespaceObject, "name", function() { return navigation_link_name; }); -__webpack_require__.d(navigation_link_namespaceObject, "settings", function() { return navigation_link_settings; }); +__webpack_require__.d(navigation_link_namespaceObject, { + "metadata": function() { return navigation_link_metadata; }, + "name": function() { return navigation_link_name; }, + "settings": function() { return navigation_link_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js var navigation_submenu_namespaceObject = {}; __webpack_require__.r(navigation_submenu_namespaceObject); -__webpack_require__.d(navigation_submenu_namespaceObject, "metadata", function() { return navigation_submenu_metadata; }); -__webpack_require__.d(navigation_submenu_namespaceObject, "name", function() { return navigation_submenu_name; }); -__webpack_require__.d(navigation_submenu_namespaceObject, "settings", function() { return navigation_submenu_settings; }); +__webpack_require__.d(navigation_submenu_namespaceObject, { + "metadata": function() { return navigation_submenu_metadata; }, + "name": function() { return navigation_submenu_name; }, + "settings": function() { return navigation_submenu_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js var nextpage_namespaceObject = {}; __webpack_require__.r(nextpage_namespaceObject); -__webpack_require__.d(nextpage_namespaceObject, "metadata", function() { return nextpage_metadata; }); -__webpack_require__.d(nextpage_namespaceObject, "name", function() { return nextpage_name; }); -__webpack_require__.d(nextpage_namespaceObject, "settings", function() { return nextpage_settings; }); +__webpack_require__.d(nextpage_namespaceObject, { + "metadata": function() { return nextpage_metadata; }, + "name": function() { return nextpage_name; }, + "settings": function() { return nextpage_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js var pattern_namespaceObject = {}; __webpack_require__.r(pattern_namespaceObject); -__webpack_require__.d(pattern_namespaceObject, "metadata", function() { return pattern_metadata; }); -__webpack_require__.d(pattern_namespaceObject, "name", function() { return pattern_name; }); -__webpack_require__.d(pattern_namespaceObject, "settings", function() { return pattern_settings; }); +__webpack_require__.d(pattern_namespaceObject, { + "metadata": function() { return pattern_metadata; }, + "name": function() { return pattern_name; }, + "settings": function() { return pattern_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js var page_list_namespaceObject = {}; __webpack_require__.r(page_list_namespaceObject); -__webpack_require__.d(page_list_namespaceObject, "metadata", function() { return page_list_metadata; }); -__webpack_require__.d(page_list_namespaceObject, "name", function() { return page_list_name; }); -__webpack_require__.d(page_list_namespaceObject, "settings", function() { return page_list_settings; }); +__webpack_require__.d(page_list_namespaceObject, { + "metadata": function() { return page_list_metadata; }, + "name": function() { return page_list_name; }, + "settings": function() { return page_list_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js var build_module_paragraph_namespaceObject = {}; __webpack_require__.r(build_module_paragraph_namespaceObject); -__webpack_require__.d(build_module_paragraph_namespaceObject, "metadata", function() { return paragraph_metadata; }); -__webpack_require__.d(build_module_paragraph_namespaceObject, "name", function() { return paragraph_name; }); -__webpack_require__.d(build_module_paragraph_namespaceObject, "settings", function() { return paragraph_settings; }); +__webpack_require__.d(build_module_paragraph_namespaceObject, { + "metadata": function() { return paragraph_metadata; }, + "name": function() { return paragraph_name; }, + "settings": function() { return paragraph_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js var build_module_post_author_namespaceObject = {}; __webpack_require__.r(build_module_post_author_namespaceObject); -__webpack_require__.d(build_module_post_author_namespaceObject, "metadata", function() { return post_author_metadata; }); -__webpack_require__.d(build_module_post_author_namespaceObject, "name", function() { return post_author_name; }); -__webpack_require__.d(build_module_post_author_namespaceObject, "settings", function() { return post_author_settings; }); +__webpack_require__.d(build_module_post_author_namespaceObject, { + "metadata": function() { return post_author_metadata; }, + "name": function() { return post_author_name; }, + "settings": function() { return post_author_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js var build_module_post_comments_namespaceObject = {}; __webpack_require__.r(build_module_post_comments_namespaceObject); -__webpack_require__.d(build_module_post_comments_namespaceObject, "metadata", function() { return post_comments_metadata; }); -__webpack_require__.d(build_module_post_comments_namespaceObject, "name", function() { return post_comments_name; }); -__webpack_require__.d(build_module_post_comments_namespaceObject, "settings", function() { return post_comments_settings; }); +__webpack_require__.d(build_module_post_comments_namespaceObject, { + "metadata": function() { return post_comments_metadata; }, + "name": function() { return post_comments_name; }, + "settings": function() { return post_comments_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js var build_module_post_content_namespaceObject = {}; __webpack_require__.r(build_module_post_content_namespaceObject); -__webpack_require__.d(build_module_post_content_namespaceObject, "metadata", function() { return post_content_metadata; }); -__webpack_require__.d(build_module_post_content_namespaceObject, "name", function() { return post_content_name; }); -__webpack_require__.d(build_module_post_content_namespaceObject, "settings", function() { return post_content_settings; }); +__webpack_require__.d(build_module_post_content_namespaceObject, { + "metadata": function() { return post_content_metadata; }, + "name": function() { return post_content_name; }, + "settings": function() { return post_content_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js var build_module_post_date_namespaceObject = {}; __webpack_require__.r(build_module_post_date_namespaceObject); -__webpack_require__.d(build_module_post_date_namespaceObject, "metadata", function() { return post_date_metadata; }); -__webpack_require__.d(build_module_post_date_namespaceObject, "name", function() { return post_date_name; }); -__webpack_require__.d(build_module_post_date_namespaceObject, "settings", function() { return post_date_settings; }); +__webpack_require__.d(build_module_post_date_namespaceObject, { + "metadata": function() { return post_date_metadata; }, + "name": function() { return post_date_name; }, + "settings": function() { return post_date_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js var build_module_post_excerpt_namespaceObject = {}; __webpack_require__.r(build_module_post_excerpt_namespaceObject); -__webpack_require__.d(build_module_post_excerpt_namespaceObject, "metadata", function() { return post_excerpt_metadata; }); -__webpack_require__.d(build_module_post_excerpt_namespaceObject, "name", function() { return post_excerpt_name; }); -__webpack_require__.d(build_module_post_excerpt_namespaceObject, "settings", function() { return post_excerpt_settings; }); +__webpack_require__.d(build_module_post_excerpt_namespaceObject, { + "metadata": function() { return post_excerpt_metadata; }, + "name": function() { return post_excerpt_name; }, + "settings": function() { return post_excerpt_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js var build_module_post_featured_image_namespaceObject = {}; __webpack_require__.r(build_module_post_featured_image_namespaceObject); -__webpack_require__.d(build_module_post_featured_image_namespaceObject, "metadata", function() { return post_featured_image_metadata; }); -__webpack_require__.d(build_module_post_featured_image_namespaceObject, "name", function() { return post_featured_image_name; }); -__webpack_require__.d(build_module_post_featured_image_namespaceObject, "settings", function() { return post_featured_image_settings; }); +__webpack_require__.d(build_module_post_featured_image_namespaceObject, { + "metadata": function() { return post_featured_image_metadata; }, + "name": function() { return post_featured_image_name; }, + "settings": function() { return post_featured_image_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js var post_navigation_link_namespaceObject = {}; __webpack_require__.r(post_navigation_link_namespaceObject); -__webpack_require__.d(post_navigation_link_namespaceObject, "metadata", function() { return post_navigation_link_metadata; }); -__webpack_require__.d(post_navigation_link_namespaceObject, "name", function() { return post_navigation_link_name; }); -__webpack_require__.d(post_navigation_link_namespaceObject, "settings", function() { return post_navigation_link_settings; }); +__webpack_require__.d(post_navigation_link_namespaceObject, { + "metadata": function() { return post_navigation_link_metadata; }, + "name": function() { return post_navigation_link_name; }, + "settings": function() { return post_navigation_link_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js var post_template_namespaceObject = {}; __webpack_require__.r(post_template_namespaceObject); -__webpack_require__.d(post_template_namespaceObject, "metadata", function() { return post_template_metadata; }); -__webpack_require__.d(post_template_namespaceObject, "name", function() { return post_template_name; }); -__webpack_require__.d(post_template_namespaceObject, "settings", function() { return post_template_settings; }); +__webpack_require__.d(post_template_namespaceObject, { + "metadata": function() { return post_template_metadata; }, + "name": function() { return post_template_name; }, + "settings": function() { return post_template_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js var post_terms_namespaceObject = {}; __webpack_require__.r(post_terms_namespaceObject); -__webpack_require__.d(post_terms_namespaceObject, "metadata", function() { return post_terms_metadata; }); -__webpack_require__.d(post_terms_namespaceObject, "name", function() { return post_terms_name; }); -__webpack_require__.d(post_terms_namespaceObject, "settings", function() { return post_terms_settings; }); +__webpack_require__.d(post_terms_namespaceObject, { + "metadata": function() { return post_terms_metadata; }, + "name": function() { return post_terms_name; }, + "settings": function() { return post_terms_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js var build_module_post_title_namespaceObject = {}; __webpack_require__.r(build_module_post_title_namespaceObject); -__webpack_require__.d(build_module_post_title_namespaceObject, "metadata", function() { return post_title_metadata; }); -__webpack_require__.d(build_module_post_title_namespaceObject, "name", function() { return post_title_name; }); -__webpack_require__.d(build_module_post_title_namespaceObject, "settings", function() { return post_title_settings; }); +__webpack_require__.d(build_module_post_title_namespaceObject, { + "metadata": function() { return post_title_metadata; }, + "name": function() { return post_title_name; }, + "settings": function() { return post_title_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js var build_module_preformatted_namespaceObject = {}; __webpack_require__.r(build_module_preformatted_namespaceObject); -__webpack_require__.d(build_module_preformatted_namespaceObject, "metadata", function() { return preformatted_metadata; }); -__webpack_require__.d(build_module_preformatted_namespaceObject, "name", function() { return preformatted_name; }); -__webpack_require__.d(build_module_preformatted_namespaceObject, "settings", function() { return preformatted_settings; }); +__webpack_require__.d(build_module_preformatted_namespaceObject, { + "metadata": function() { return preformatted_metadata; }, + "name": function() { return preformatted_name; }, + "settings": function() { return preformatted_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js var build_module_pullquote_namespaceObject = {}; __webpack_require__.r(build_module_pullquote_namespaceObject); -__webpack_require__.d(build_module_pullquote_namespaceObject, "metadata", function() { return pullquote_metadata; }); -__webpack_require__.d(build_module_pullquote_namespaceObject, "name", function() { return pullquote_name; }); -__webpack_require__.d(build_module_pullquote_namespaceObject, "settings", function() { return pullquote_settings; }); +__webpack_require__.d(build_module_pullquote_namespaceObject, { + "metadata": function() { return pullquote_metadata; }, + "name": function() { return pullquote_name; }, + "settings": function() { return pullquote_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js var query_namespaceObject = {}; __webpack_require__.r(query_namespaceObject); -__webpack_require__.d(query_namespaceObject, "metadata", function() { return query_metadata; }); -__webpack_require__.d(query_namespaceObject, "name", function() { return query_name; }); -__webpack_require__.d(query_namespaceObject, "settings", function() { return query_settings; }); +__webpack_require__.d(query_namespaceObject, { + "metadata": function() { return query_metadata; }, + "name": function() { return query_name; }, + "settings": function() { return query_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js var build_module_query_pagination_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_namespaceObject); -__webpack_require__.d(build_module_query_pagination_namespaceObject, "metadata", function() { return query_pagination_metadata; }); -__webpack_require__.d(build_module_query_pagination_namespaceObject, "name", function() { return query_pagination_name; }); -__webpack_require__.d(build_module_query_pagination_namespaceObject, "settings", function() { return query_pagination_settings; }); +__webpack_require__.d(build_module_query_pagination_namespaceObject, { + "metadata": function() { return query_pagination_metadata; }, + "name": function() { return query_pagination_name; }, + "settings": function() { return query_pagination_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js var build_module_query_pagination_next_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_next_namespaceObject); -__webpack_require__.d(build_module_query_pagination_next_namespaceObject, "metadata", function() { return query_pagination_next_metadata; }); -__webpack_require__.d(build_module_query_pagination_next_namespaceObject, "name", function() { return query_pagination_next_name; }); -__webpack_require__.d(build_module_query_pagination_next_namespaceObject, "settings", function() { return query_pagination_next_settings; }); +__webpack_require__.d(build_module_query_pagination_next_namespaceObject, { + "metadata": function() { return query_pagination_next_metadata; }, + "name": function() { return query_pagination_next_name; }, + "settings": function() { return query_pagination_next_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js var build_module_query_pagination_numbers_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject); -__webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, "metadata", function() { return query_pagination_numbers_metadata; }); -__webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, "name", function() { return query_pagination_numbers_name; }); -__webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, "settings", function() { return query_pagination_numbers_settings; }); +__webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, { + "metadata": function() { return query_pagination_numbers_metadata; }, + "name": function() { return query_pagination_numbers_name; }, + "settings": function() { return query_pagination_numbers_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js var build_module_query_pagination_previous_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_previous_namespaceObject); -__webpack_require__.d(build_module_query_pagination_previous_namespaceObject, "metadata", function() { return query_pagination_previous_metadata; }); -__webpack_require__.d(build_module_query_pagination_previous_namespaceObject, "name", function() { return query_pagination_previous_name; }); -__webpack_require__.d(build_module_query_pagination_previous_namespaceObject, "settings", function() { return query_pagination_previous_settings; }); +__webpack_require__.d(build_module_query_pagination_previous_namespaceObject, { + "metadata": function() { return query_pagination_previous_metadata; }, + "name": function() { return query_pagination_previous_name; }, + "settings": function() { return query_pagination_previous_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js var query_title_namespaceObject = {}; __webpack_require__.r(query_title_namespaceObject); -__webpack_require__.d(query_title_namespaceObject, "metadata", function() { return query_title_metadata; }); -__webpack_require__.d(query_title_namespaceObject, "name", function() { return query_title_name; }); -__webpack_require__.d(query_title_namespaceObject, "settings", function() { return query_title_settings; }); +__webpack_require__.d(query_title_namespaceObject, { + "metadata": function() { return query_title_metadata; }, + "name": function() { return query_title_name; }, + "settings": function() { return query_title_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js var build_module_quote_namespaceObject = {}; __webpack_require__.r(build_module_quote_namespaceObject); -__webpack_require__.d(build_module_quote_namespaceObject, "metadata", function() { return quote_metadata; }); -__webpack_require__.d(build_module_quote_namespaceObject, "name", function() { return quote_name; }); -__webpack_require__.d(build_module_quote_namespaceObject, "settings", function() { return quote_settings; }); +__webpack_require__.d(build_module_quote_namespaceObject, { + "metadata": function() { return quote_metadata; }, + "name": function() { return quote_name; }, + "settings": function() { return quote_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js var block_namespaceObject = {}; __webpack_require__.r(block_namespaceObject); -__webpack_require__.d(block_namespaceObject, "metadata", function() { return block_metadata; }); -__webpack_require__.d(block_namespaceObject, "name", function() { return block_name; }); -__webpack_require__.d(block_namespaceObject, "settings", function() { return block_settings; }); +__webpack_require__.d(block_namespaceObject, { + "metadata": function() { return block_metadata; }, + "name": function() { return block_name; }, + "settings": function() { return block_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js var build_module_rss_namespaceObject = {}; __webpack_require__.r(build_module_rss_namespaceObject); -__webpack_require__.d(build_module_rss_namespaceObject, "metadata", function() { return rss_metadata; }); -__webpack_require__.d(build_module_rss_namespaceObject, "name", function() { return rss_name; }); -__webpack_require__.d(build_module_rss_namespaceObject, "settings", function() { return rss_settings; }); +__webpack_require__.d(build_module_rss_namespaceObject, { + "metadata": function() { return rss_metadata; }, + "name": function() { return rss_name; }, + "settings": function() { return rss_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js -var search_namespaceObject = {}; -__webpack_require__.r(search_namespaceObject); -__webpack_require__.d(search_namespaceObject, "metadata", function() { return search_metadata; }); -__webpack_require__.d(search_namespaceObject, "name", function() { return search_name; }); -__webpack_require__.d(search_namespaceObject, "settings", function() { return search_settings; }); +var build_module_search_namespaceObject = {}; +__webpack_require__.r(build_module_search_namespaceObject); +__webpack_require__.d(build_module_search_namespaceObject, { + "metadata": function() { return search_metadata; }, + "name": function() { return search_name; }, + "settings": function() { return search_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js var build_module_separator_namespaceObject = {}; __webpack_require__.r(build_module_separator_namespaceObject); -__webpack_require__.d(build_module_separator_namespaceObject, "metadata", function() { return separator_metadata; }); -__webpack_require__.d(build_module_separator_namespaceObject, "name", function() { return separator_name; }); -__webpack_require__.d(build_module_separator_namespaceObject, "settings", function() { return build_module_separator_settings; }); +__webpack_require__.d(build_module_separator_namespaceObject, { + "metadata": function() { return separator_metadata; }, + "name": function() { return separator_name; }, + "settings": function() { return build_module_separator_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js var build_module_shortcode_namespaceObject = {}; __webpack_require__.r(build_module_shortcode_namespaceObject); -__webpack_require__.d(build_module_shortcode_namespaceObject, "metadata", function() { return shortcode_metadata; }); -__webpack_require__.d(build_module_shortcode_namespaceObject, "name", function() { return shortcode_name; }); -__webpack_require__.d(build_module_shortcode_namespaceObject, "settings", function() { return shortcode_settings; }); +__webpack_require__.d(build_module_shortcode_namespaceObject, { + "metadata": function() { return shortcode_metadata; }, + "name": function() { return shortcode_name; }, + "settings": function() { return shortcode_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js var build_module_site_logo_namespaceObject = {}; __webpack_require__.r(build_module_site_logo_namespaceObject); -__webpack_require__.d(build_module_site_logo_namespaceObject, "metadata", function() { return site_logo_metadata; }); -__webpack_require__.d(build_module_site_logo_namespaceObject, "name", function() { return site_logo_name; }); -__webpack_require__.d(build_module_site_logo_namespaceObject, "settings", function() { return site_logo_settings; }); +__webpack_require__.d(build_module_site_logo_namespaceObject, { + "metadata": function() { return site_logo_metadata; }, + "name": function() { return site_logo_name; }, + "settings": function() { return site_logo_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js var site_tagline_namespaceObject = {}; __webpack_require__.r(site_tagline_namespaceObject); -__webpack_require__.d(site_tagline_namespaceObject, "metadata", function() { return site_tagline_metadata; }); -__webpack_require__.d(site_tagline_namespaceObject, "name", function() { return site_tagline_name; }); -__webpack_require__.d(site_tagline_namespaceObject, "settings", function() { return site_tagline_settings; }); +__webpack_require__.d(site_tagline_namespaceObject, { + "metadata": function() { return site_tagline_metadata; }, + "name": function() { return site_tagline_name; }, + "settings": function() { return site_tagline_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js var site_title_namespaceObject = {}; __webpack_require__.r(site_title_namespaceObject); -__webpack_require__.d(site_title_namespaceObject, "metadata", function() { return site_title_metadata; }); -__webpack_require__.d(site_title_namespaceObject, "name", function() { return site_title_name; }); -__webpack_require__.d(site_title_namespaceObject, "settings", function() { return site_title_settings; }); +__webpack_require__.d(site_title_namespaceObject, { + "metadata": function() { return site_title_metadata; }, + "name": function() { return site_title_name; }, + "settings": function() { return site_title_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js var social_link_namespaceObject = {}; __webpack_require__.r(social_link_namespaceObject); -__webpack_require__.d(social_link_namespaceObject, "metadata", function() { return social_link_metadata; }); -__webpack_require__.d(social_link_namespaceObject, "name", function() { return social_link_name; }); -__webpack_require__.d(social_link_namespaceObject, "settings", function() { return social_link_settings; }); +__webpack_require__.d(social_link_namespaceObject, { + "metadata": function() { return social_link_metadata; }, + "name": function() { return social_link_name; }, + "settings": function() { return social_link_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js var social_links_namespaceObject = {}; __webpack_require__.r(social_links_namespaceObject); -__webpack_require__.d(social_links_namespaceObject, "metadata", function() { return social_links_metadata; }); -__webpack_require__.d(social_links_namespaceObject, "name", function() { return social_links_name; }); -__webpack_require__.d(social_links_namespaceObject, "settings", function() { return social_links_settings; }); +__webpack_require__.d(social_links_namespaceObject, { + "metadata": function() { return social_links_metadata; }, + "name": function() { return social_links_name; }, + "settings": function() { return social_links_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js var spacer_namespaceObject = {}; __webpack_require__.r(spacer_namespaceObject); -__webpack_require__.d(spacer_namespaceObject, "metadata", function() { return spacer_metadata; }); -__webpack_require__.d(spacer_namespaceObject, "name", function() { return spacer_name; }); -__webpack_require__.d(spacer_namespaceObject, "settings", function() { return spacer_settings; }); +__webpack_require__.d(spacer_namespaceObject, { + "metadata": function() { return spacer_metadata; }, + "name": function() { return spacer_name; }, + "settings": function() { return spacer_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js var build_module_table_namespaceObject = {}; __webpack_require__.r(build_module_table_namespaceObject); -__webpack_require__.d(build_module_table_namespaceObject, "metadata", function() { return table_metadata; }); -__webpack_require__.d(build_module_table_namespaceObject, "name", function() { return table_name; }); -__webpack_require__.d(build_module_table_namespaceObject, "settings", function() { return table_settings; }); +__webpack_require__.d(build_module_table_namespaceObject, { + "metadata": function() { return table_metadata; }, + "name": function() { return table_name; }, + "settings": function() { return table_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js var tag_cloud_namespaceObject = {}; __webpack_require__.r(tag_cloud_namespaceObject); -__webpack_require__.d(tag_cloud_namespaceObject, "metadata", function() { return tag_cloud_metadata; }); -__webpack_require__.d(tag_cloud_namespaceObject, "name", function() { return tag_cloud_name; }); -__webpack_require__.d(tag_cloud_namespaceObject, "settings", function() { return tag_cloud_settings; }); +__webpack_require__.d(tag_cloud_namespaceObject, { + "metadata": function() { return tag_cloud_metadata; }, + "name": function() { return tag_cloud_name; }, + "settings": function() { return tag_cloud_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js var template_part_namespaceObject = {}; __webpack_require__.r(template_part_namespaceObject); -__webpack_require__.d(template_part_namespaceObject, "metadata", function() { return template_part_metadata; }); -__webpack_require__.d(template_part_namespaceObject, "name", function() { return template_part_name; }); -__webpack_require__.d(template_part_namespaceObject, "settings", function() { return template_part_settings; }); +__webpack_require__.d(template_part_namespaceObject, { + "metadata": function() { return template_part_metadata; }, + "name": function() { return template_part_name; }, + "settings": function() { return template_part_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js var build_module_term_description_namespaceObject = {}; __webpack_require__.r(build_module_term_description_namespaceObject); -__webpack_require__.d(build_module_term_description_namespaceObject, "metadata", function() { return term_description_metadata; }); -__webpack_require__.d(build_module_term_description_namespaceObject, "name", function() { return term_description_name; }); -__webpack_require__.d(build_module_term_description_namespaceObject, "settings", function() { return term_description_settings; }); +__webpack_require__.d(build_module_term_description_namespaceObject, { + "metadata": function() { return term_description_metadata; }, + "name": function() { return term_description_name; }, + "settings": function() { return term_description_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js var text_columns_namespaceObject = {}; __webpack_require__.r(text_columns_namespaceObject); -__webpack_require__.d(text_columns_namespaceObject, "metadata", function() { return text_columns_metadata; }); -__webpack_require__.d(text_columns_namespaceObject, "name", function() { return text_columns_name; }); -__webpack_require__.d(text_columns_namespaceObject, "settings", function() { return text_columns_settings; }); +__webpack_require__.d(text_columns_namespaceObject, { + "metadata": function() { return text_columns_metadata; }, + "name": function() { return text_columns_name; }, + "settings": function() { return text_columns_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js var build_module_verse_namespaceObject = {}; __webpack_require__.r(build_module_verse_namespaceObject); -__webpack_require__.d(build_module_verse_namespaceObject, "metadata", function() { return verse_metadata; }); -__webpack_require__.d(build_module_verse_namespaceObject, "name", function() { return verse_name; }); -__webpack_require__.d(build_module_verse_namespaceObject, "settings", function() { return verse_settings; }); +__webpack_require__.d(build_module_verse_namespaceObject, { + "metadata": function() { return verse_metadata; }, + "name": function() { return verse_name; }, + "settings": function() { return verse_settings; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js var build_module_video_namespaceObject = {}; __webpack_require__.r(build_module_video_namespaceObject); -__webpack_require__.d(build_module_video_namespaceObject, "metadata", function() { return video_metadata; }); -__webpack_require__.d(build_module_video_namespaceObject, "name", function() { return video_name; }); -__webpack_require__.d(build_module_video_namespaceObject, "settings", function() { return video_settings; }); +__webpack_require__.d(build_module_video_namespaceObject, { + "metadata": function() { return video_metadata; }, + "name": function() { return video_name; }, + "settings": function() { return video_settings; } +}); -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js +;// CONCATENATED MODULE: external ["wp","blocks"] +var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; +;// CONCATENATED MODULE: external ["wp","element"] +var external_wp_element_namespaceObject = window["wp"]["element"]; +;// CONCATENATED MODULE: external ["wp","primitives"] +var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js /** * WordPress dependencies */ -const archive = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const archive = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z" })); /* harmony default export */ var library_archive = (archive); -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// EXTERNAL MODULE: external ["wp","blockEditor"] -var external_wp_blockEditor_ = __webpack_require__("axFQ"); - -// EXTERNAL MODULE: external ["wp","serverSideRender"] -var external_wp_serverSideRender_ = __webpack_require__("JREk"); -var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js +;// CONCATENATED MODULE: external ["wp","components"] +var external_wp_components_namespaceObject = window["wp"]["components"]; +;// CONCATENATED MODULE: external ["wp","i18n"] +var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +;// CONCATENATED MODULE: external ["wp","blockEditor"] +var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; +;// CONCATENATED MODULE: external ["wp","serverSideRender"] +var external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; +var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js /** @@ -1660,27 +1560,27 @@ function ArchivesEdit(_ref) { showPostCounts, displayAsDropdown } = attributes; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Archives settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Display as dropdown'), + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Archives settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), checked: displayAsDropdown, onChange: () => setAttributes({ displayAsDropdown: !displayAsDropdown }) - }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Show post counts'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), checked: showPostCounts, onChange: () => setAttributes({ showPostCounts: !showPostCounts }) - }))), Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], null, Object(external_wp_element_["createElement"])(external_wp_serverSideRender_default.a, { + }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), { block: "core/archives", attributes: attributes })))); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js /** * WordPress dependencies */ @@ -1689,7 +1589,7 @@ function ArchivesEdit(_ref) { * Internal dependencies */ -const archives_metadata = { +const metadata = { apiVersion: 2, name: "core/archives", title: "Archives", @@ -1715,30 +1615,30 @@ const archives_metadata = { const { name: archives_name -} = archives_metadata; +} = metadata; -const archives_settings = { +const settings = { icon: library_archive, example: {}, edit: ArchivesEdit }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js /** * WordPress dependencies */ -const audio = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const audio = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" })); /* harmony default export */ var library_audio = (audio); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js /** @@ -1795,13 +1695,13 @@ const audio = Object(external_wp_element_["createElement"])(external_wp_primitiv preload, src } = attributes; - return Object(external_wp_element_["createElement"])("figure", null, Object(external_wp_element_["createElement"])("audio", { + return (0,external_wp_element_namespaceObject.createElement)("figure", null, (0,external_wp_element_namespaceObject.createElement)("audio", { controls: "controls", src: src, autoPlay: autoplay, loop: loop, preload: preload - }), !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })); @@ -1809,13 +1709,11 @@ const audio = Object(external_wp_element_["createElement"])(external_wp_primitiv }]); -// EXTERNAL MODULE: external ["wp","blob"] -var external_wp_blob_ = __webpack_require__("xTGt"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js +;// CONCATENATED MODULE: external ["wp","blob"] +var external_wp_blob_namespaceObject = window["wp"]["blob"]; +;// CONCATENATED MODULE: external ["wp","data"] +var external_wp_data_namespaceObject = window["wp"]["data"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js const ASPECT_RATIOS = [// Common video resolutions. { ratio: '2.33', @@ -1842,18 +1740,15 @@ const ASPECT_RATIOS = [// Common video resolutions. }]; const WP_EMBED_TYPE = 'wp-embed'; -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - +;// CONCATENATED MODULE: external "lodash" +var external_lodash_namespaceObject = window["lodash"]; // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js -var dedupe = __webpack_require__("A/WM"); +var dedupe = __webpack_require__(3827); var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe); - // EXTERNAL MODULE: ./node_modules/memize/index.js -var memize = __webpack_require__("4eJC"); +var memize = __webpack_require__(9756); var memize_default = /*#__PURE__*/__webpack_require__.n(memize); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js /** @@ -1933,7 +1828,7 @@ const { const getEmbedInfoByProvider = provider => { var _getBlockVariations; - return (_getBlockVariations = Object(external_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => { + return (_getBlockVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => { let { name } = _ref; @@ -1963,7 +1858,7 @@ const matchesPatterns = function (url) { const findMoreSuitableBlock = url => { var _getBlockVariations2; - return (_getBlockVariations2 = Object(external_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => { + return (_getBlockVariations2 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => { let { patterns } = _ref2; @@ -1975,12 +1870,12 @@ const getPhotoHtml = photo => { // 100% width for the preview so it fits nicely into the document, some "thumbnails" are // actually the full size photo. If thumbnails not found, use full image. const imageUrl = photo.thumbnail_url || photo.url; - const photoPreview = Object(external_wp_element_["createElement"])("p", null, Object(external_wp_element_["createElement"])("img", { + const photoPreview = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("img", { src: imageUrl, alt: photo.title, width: "100%" })); - return Object(external_wp_element_["renderToString"])(photoPreview); + return (0,external_wp_element_namespaceObject.renderToString)(photoPreview); }; /** * Creates a more suitable embed block based on the passed in props @@ -2011,7 +1906,7 @@ const createUpgradedEmbedBlock = function (props) { type, ...restAttributes } = attributes; - if (!url || !Object(external_wp_blocks_["getBlockType"])(DEFAULT_EMBED_BLOCK)) return; + if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return; const matchedBlock = findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns, // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL. @@ -2021,14 +1916,14 @@ const createUpgradedEmbedBlock = function (props) { const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); if (shouldCreateNewBlock) { - return Object(external_wp_blocks_["createBlock"])(DEFAULT_EMBED_BLOCK, { + return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { url, ...restAttributes, ...matchedBlock.attributes }); } - const wpVariation = (_getBlockVariations3 = Object(external_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => { + const wpVariation = (_getBlockVariations3 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => { let { name } = _ref3; @@ -2040,7 +1935,7 @@ const createUpgradedEmbedBlock = function (props) { } // This is not the WordPress embed block so transform it into one. - return Object(external_wp_blocks_["createBlock"])(DEFAULT_EMBED_BLOCK, { + return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { url, ...wpVariation.attributes, // By now we have the preview, but when the new block first renders, it @@ -2132,12 +2027,12 @@ function getClassNames(html, existingClassNames) { * @param {Function} onReplace Function to call with the created fallback block. */ -function util_fallback(url, onReplace) { - const link = Object(external_wp_element_["createElement"])("a", { +function fallback(url, onReplace) { + const link = (0,external_wp_element_namespaceObject.createElement)("a", { href: url }, url); - onReplace(Object(external_wp_blocks_["createBlock"])('core/paragraph', { - content: Object(external_wp_element_["renderToString"])(link) + onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { + content: (0,external_wp_element_namespaceObject.renderToString)(link) })); } /*** @@ -2169,7 +2064,7 @@ const getAttributesFromPreview = memize_default()(function (preview, title, curr html, provider_name: providerName } = preview; - const providerNameSlug = Object(external_lodash_["kebabCase"])((providerName || title).toLowerCase()); + const providerNameSlug = (0,external_lodash_namespaceObject.kebabCase)((providerName || title).toLowerCase()); if (isFromWordPress(html)) { type = WP_EMBED_TYPE; @@ -2184,7 +2079,7 @@ const getAttributesFromPreview = memize_default()(function (preview, title, curr return attributes; }); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js /** @@ -2223,16 +2118,16 @@ function AudioEdit(_ref) { preload, src } = attributes; - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); - const mediaUpload = Object(external_wp_data_["useSelect"])(select => { + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); + const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings - } = select(external_wp_blockEditor_["store"]); + } = select(external_wp_blockEditor_namespaceObject.store); return getSettings().mediaUpload; }, []); - Object(external_wp_element_["useEffect"])(() => { - if (!id && Object(external_wp_blob_["isBlobURL"])(src)) { - const file = Object(external_wp_blob_["getBlobByURL"])(src); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) { + const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src); if (file) { mediaUpload({ @@ -2297,7 +2192,7 @@ function AudioEdit(_ref) { } function getAutoplayHelp(checked) { - return checked ? Object(external_wp_i18n_["__"])('Autoplay may cause usability issues for some users.') : null; + return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null; } // const { setAttributes, isSelected, noticeUI } = this.props; @@ -2321,8 +2216,8 @@ function AudioEdit(_ref) { } if (!src) { - return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], { - icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { + return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_audio }), onSelect: onSelectAudio, @@ -2335,9 +2230,9 @@ function AudioEdit(_ref) { })); } - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaReplaceFlow"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: src, allowedTypes: ALLOWED_MEDIA_TYPES, @@ -2345,19 +2240,19 @@ function AudioEdit(_ref) { onSelect: onSelectAudio, onSelectURL: onSelectURL, onError: onUploadError - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Audio settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Autoplay'), + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Audio settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), onChange: toggleAttribute('autoplay'), checked: autoplay, help: getAutoplayHelp - }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Loop'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Loop'), onChange: toggleAttribute('loop'), checked: loop - }), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["_x"])('Preload', 'noun; Audio block parameter'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'), value: preload || '' // `undefined` is required for the preload attribute to be unset. , onChange: value => setAttributes({ @@ -2365,38 +2260,38 @@ function AudioEdit(_ref) { }), options: [{ value: '', - label: Object(external_wp_i18n_["__"])('Browser default') + label: (0,external_wp_i18n_namespaceObject.__)('Browser default') }, { value: 'auto', - label: Object(external_wp_i18n_["__"])('Auto') + label: (0,external_wp_i18n_namespaceObject.__)('Auto') }, { value: 'metadata', - label: Object(external_wp_i18n_["__"])('Metadata') + label: (0,external_wp_i18n_namespaceObject.__)('Metadata') }, { value: 'none', - label: Object(external_wp_i18n_["_x"])('None', '"Preload" value') + label: (0,external_wp_i18n_namespaceObject._x)('None', '"Preload" value') }] - }))), Object(external_wp_element_["createElement"])("figure", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], { + }))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, { isDisabled: !isSelected - }, Object(external_wp_element_["createElement"])("audio", { + }, (0,external_wp_element_namespaceObject.createElement)("audio", { controls: "controls", src: src - })), (!external_wp_blockEditor_["RichText"].isEmpty(caption) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { + })), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "figcaption", - "aria-label": Object(external_wp_i18n_["__"])('Audio caption text'), - placeholder: Object(external_wp_i18n_["__"])('Add caption'), + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Audio caption text'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'), value: caption, onChange: value => setAttributes({ caption: value }), inlineToolbar: true, - __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph')) + __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')) }))); } -/* harmony default export */ var edit = (Object(external_wp_components_["withNotices"])(AudioEdit)); +/* harmony default export */ var edit = ((0,external_wp_components_namespaceObject.withNotices)(AudioEdit)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js /** @@ -2414,25 +2309,25 @@ function save(_ref) { preload, src } = attributes; - return src && Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])("audio", { + return src && (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("audio", { controls: "controls", src: src, autoPlay: autoplay, loop: loop, preload: preload - }), !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js /** * WordPress dependencies */ -const transforms_transforms = { +const transforms = { from: [{ type: 'files', @@ -2445,8 +2340,8 @@ const transforms_transforms = { // It's already done as part of the `componentDidMount` // in the audio block - const block = Object(external_wp_blocks_["createBlock"])('core/audio', { - src: Object(external_wp_blob_["createBlobURL"])(file) + const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { + src: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); return block; } @@ -2507,9 +2402,9 @@ const transforms_transforms = { } }] }; -/* harmony default export */ var audio_transforms = (transforms_transforms); +/* harmony default export */ var audio_transforms = (transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js /** * WordPress dependencies */ @@ -2588,17 +2483,27 @@ const audio_settings = { save: save }; -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js -var library_button = __webpack_require__("oMoS"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js + + +/** + * WordPress dependencies + */ + +const button_button = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z" +})); +/* harmony default export */ var library_button = (button_button); // EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); +var classnames = __webpack_require__(4403); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js +;// CONCATENATED MODULE: external ["wp","compose"] +var external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js /** * External dependencies */ @@ -2611,17 +2516,17 @@ var external_wp_compose_ = __webpack_require__("K9lf"); */ const cleanEmptyObject = object => { - if (!Object(external_lodash_["isObject"])(object) || Array.isArray(object)) { + if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) { return object; } - const cleanedNestedObjects = Object(external_lodash_["pickBy"])(Object(external_lodash_["mapValues"])(object, cleanEmptyObject), external_lodash_["identity"]); - return Object(external_lodash_["isEmpty"])(cleanedNestedObjects) ? undefined : cleanedNestedObjects; + const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity); + return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects; }; /* harmony default export */ var clean_empty_object = (cleanEmptyObject); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js /** * External dependencies */ @@ -2640,7 +2545,7 @@ const cleanEmptyObject = object => { * @return {Object} The updated attributes. */ -/* harmony default export */ var migrate_font_family = (function (attributes) { +/* harmony default export */ function migrate_font_family(attributes) { var _attributes$style, _attributes$style$typ; if (!(attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && (_attributes$style$typ = _attributes$style.typography) !== null && _attributes$style$typ !== void 0 && _attributes$style$typ.fontFamily)) { @@ -2651,16 +2556,16 @@ const cleanEmptyObject = object => { // we don't want to alter the original attributes. - const atts = Object(external_lodash_["cloneDeep"])(attributes); + const atts = (0,external_lodash_namespaceObject.cloneDeep)(attributes); const fontFamily = atts.style.typography.fontFamily.split('|').pop(); delete atts.style.typography.fontFamily; atts.style = clean_empty_object(atts.style); return { ...atts, fontFamily }; -}); +} -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js /** @@ -2727,19 +2632,19 @@ const migrateCustomColorsAndGradients = attributes => { style.color.gradient = attributes.customGradient; } - return { ...Object(external_lodash_["omit"])(attributes, ['customTextColor', 'customBackgroundColor', 'customGradient']), + return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customGradient']), style }; }; const oldColorsMigration = attributes => { - return migrateCustomColorsAndGradients(Object(external_lodash_["omit"])({ ...attributes, + return migrateCustomColorsAndGradients((0,external_lodash_namespaceObject.omit)({ ...attributes, customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined }, ['color', 'textColor'])); }; -const deprecated_blockAttributes = { +const blockAttributes = { url: { type: 'string', source: 'attribute', @@ -2854,9 +2759,9 @@ const v10 = { return null; } - const borderProps = Object(external_wp_blockEditor_["__experimentalGetBorderClassesAndStyles"])(attributes); - const colorProps = Object(external_wp_blockEditor_["__experimentalGetColorClassesAndStyles"])(attributes); - const spacingProps = Object(external_wp_blockEditor_["__experimentalGetSpacingClassesAndStyles"])(attributes); + const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); + const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, { // For backwards compatibility add style that isn't provided via // block support. @@ -2873,9 +2778,9 @@ const v10 = { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize) }); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -2915,7 +2820,7 @@ const deprecated_deprecated = [v10, { reusable: false, __experimentalSelector: '.wp-block-button__link' }, - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -2977,7 +2882,7 @@ const deprecated_deprecated = [v10, { } const borderRadius = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.radius; - const colorProps = Object(external_wp_blockEditor_["__experimentalGetColorClassesAndStyles"])(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : _style$border4.radius) === 0 }); @@ -2992,9 +2897,9 @@ const deprecated_deprecated = [v10, { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography3 = style.typography) === null || _style$typography3 === void 0 ? void 0 : _style$typography3.fontSize) }); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3006,7 +2911,7 @@ const deprecated_deprecated = [v10, { })); }, - migrate: Object(external_wp_compose_["compose"])(migrate_font_family, migrateBorderRadius) + migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { anchor: true, @@ -3018,7 +2923,7 @@ const deprecated_deprecated = [v10, { reusable: false, __experimentalSelector: '.wp-block-button__link' }, - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3068,7 +2973,7 @@ const deprecated_deprecated = [v10, { url, width } = attributes; - const colorProps = Object(external_wp_blockEditor_["__experimentalGetColorClassesAndStyles"])(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { 'no-border-radius': borderRadius === 0 }); @@ -3082,9 +2987,9 @@ const deprecated_deprecated = [v10, { const wrapperClasses = classnames_default()(className, { [`has-custom-width wp-block-button__width-${width}`]: width }); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3096,7 +3001,7 @@ const deprecated_deprecated = [v10, { })); }, - migrate: Object(external_wp_compose_["compose"])(migrate_font_family, migrateBorderRadius) + migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { anchor: true, @@ -3108,7 +3013,7 @@ const deprecated_deprecated = [v10, { reusable: false, __experimentalSelector: '.wp-block-button__link' }, - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3158,7 +3063,7 @@ const deprecated_deprecated = [v10, { url, width } = attributes; - const colorProps = Object(external_wp_blockEditor_["__experimentalGetColorClassesAndStyles"])(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { 'no-border-radius': borderRadius === 0 }); @@ -3172,9 +3077,9 @@ const deprecated_deprecated = [v10, { const wrapperClasses = classnames_default()(className, { [`has-custom-width wp-block-button__width-${width}`]: width }); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3186,7 +3091,7 @@ const deprecated_deprecated = [v10, { })); }, - migrate: Object(external_wp_compose_["compose"])(migrate_font_family, migrateBorderRadius) + migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { align: true, @@ -3195,7 +3100,7 @@ const deprecated_deprecated = [v10, { gradients: true } }, - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3246,7 +3151,7 @@ const deprecated_deprecated = [v10, { const buttonStyle = { borderRadius: borderRadius ? borderRadius + 'px' : undefined }; - return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3264,7 +3169,7 @@ const deprecated_deprecated = [v10, { align: true, alignWide: false }, - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3303,7 +3208,7 @@ const deprecated_deprecated = [v10, { } }, isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient, - migrate: Object(external_wp_compose_["compose"])(migrateBorderRadius, migrateCustomColorsAndGradients), + migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients), save(_ref8) { let { @@ -3323,10 +3228,10 @@ const deprecated_deprecated = [v10, { title, url } = attributes; - const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); - const backgroundClass = !customGradient && Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); + const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); + const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); - const gradientClass = Object(external_wp_blockEditor_["__experimentalGetGradientClass"])(gradient); + const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const buttonClasses = classnames_default()('wp-block-button__link', { 'has-text-color': textColor || customTextColor, @@ -3345,7 +3250,7 @@ const deprecated_deprecated = [v10, { // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. - return Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3358,7 +3263,7 @@ const deprecated_deprecated = [v10, { } }, { - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, align: { type: 'string', default: 'none' @@ -3424,8 +3329,8 @@ const deprecated_deprecated = [v10, { title, url } = attributes; - const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); - const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); + const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); + const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const buttonClasses = classnames_default()('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, @@ -3436,7 +3341,7 @@ const deprecated_deprecated = [v10, { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3449,7 +3354,7 @@ const deprecated_deprecated = [v10, { } }, { - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, align: { type: 'string', default: 'none' @@ -3482,8 +3387,8 @@ const deprecated_deprecated = [v10, { customBackgroundColor, customTextColor } = attributes; - const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); - const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); + const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); + const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const buttonClasses = classnames_default()('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, @@ -3494,7 +3399,7 @@ const deprecated_deprecated = [v10, { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3505,7 +3410,7 @@ const deprecated_deprecated = [v10, { } }, { - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, color: { type: 'string' }, @@ -3535,9 +3440,9 @@ const deprecated_deprecated = [v10, { color: textColor }; const linkClass = 'wp-block-button__link'; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: `align${align}` - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: linkClass, href: url, @@ -3549,7 +3454,7 @@ const deprecated_deprecated = [v10, { migrate: oldColorsMigration }, { - attributes: { ...deprecated_blockAttributes, + attributes: { ...blockAttributes, color: { type: 'string' }, @@ -3574,12 +3479,12 @@ const deprecated_deprecated = [v10, { color, textColor } = attributes; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: `align${align}`, style: { backgroundColor: color } - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", href: url, title: title, @@ -3594,19 +3499,57 @@ const deprecated_deprecated = [v10, { }]; /* harmony default export */ var button_deprecated = (deprecated_deprecated); -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); +;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js -var library_link = __webpack_require__("Bpkj"); + return target; + }; -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js -var link_off = __webpack_require__("Mp0b"); + return _extends.apply(this, arguments); +} +;// CONCATENATED MODULE: external ["wp","keycodes"] +var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js + +/** + * WordPress dependencies + */ + +const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" +})); +/* harmony default export */ var library_link = (link_link); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js + + +/** + * WordPress dependencies + */ + +const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" +})); +/* harmony default export */ var link_off = (linkOff); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js @@ -3642,12 +3585,12 @@ function WidthPanel(_ref) { }); } - return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Width settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["ButtonGroup"], { - "aria-label": Object(external_wp_i18n_["__"])('Button width') + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Width settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width') }, [25, 50, 75, 100].map(widthValue => { - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { key: widthValue, isSmall: true, variant: widthValue === selectedWidth ? 'primary' : undefined, @@ -3676,7 +3619,7 @@ function ButtonEdit(props) { url, width } = attributes; - const onSetLinkRel = Object(external_wp_element_["useCallback"])(value => { + const onSetLinkRel = (0,external_wp_element_namespaceObject.useCallback)(value => { setAttributes({ rel: value }); @@ -3706,9 +3649,9 @@ function ButtonEdit(props) { } function onKeyDown(event) { - if (external_wp_keycodes_["isKeyboardEvent"].primary(event, 'k')) { + if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { startEditing(event); - } else if (external_wp_keycodes_["isKeyboardEvent"].primaryShift(event, 'k')) { + } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) { var _richTextRef$current; unlink(); @@ -3716,16 +3659,16 @@ function ButtonEdit(props) { } } - const borderProps = Object(external_wp_blockEditor_["__experimentalUseBorderProps"])(attributes); - const colorProps = Object(external_wp_blockEditor_["__experimentalUseColorProps"])(attributes); - const spacingProps = Object(external_wp_blockEditor_["__experimentalGetSpacingClassesAndStyles"])(attributes); - const ref = Object(external_wp_element_["useRef"])(); - const richTextRef = Object(external_wp_element_["useRef"])(); - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ + const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); + const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const richTextRef = (0,external_wp_element_namespaceObject.useRef)(); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref, onKeyDown }); - const [isEditingURL, setIsEditingURL] = Object(external_wp_element_["useState"])(false); + const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); const isURLSet = !!url; const opensInNewTab = linkTarget === '_blank'; @@ -3743,20 +3686,20 @@ function ButtonEdit(props) { setIsEditingURL(false); } - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected) { setIsEditingURL(false); } }, [isSelected]); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, blockProps, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, { className: classnames_default()(blockProps.className, { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: blockProps.style.fontSize }) - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { ref: richTextRef, - "aria-label": Object(external_wp_i18n_["__"])('Button text'), - placeholder: placeholder || Object(external_wp_i18n_["__"])('Add text…'), + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), + placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'), value: text, onChange: value => setButtonText(value), withoutInteractiveFormatting: true, @@ -3769,28 +3712,28 @@ function ButtonEdit(props) { ...colorProps.style, ...spacingProps.style }, - onSplit: value => Object(external_wp_blocks_["createBlock"])('core/button', { ...attributes, + onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { ...attributes, text: value }), onReplace: onReplace, onMerge: mergeBlocks, identifier: "text" - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], { + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block" - }, !isURLSet && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { + }, !isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { name: "link", - icon: library_link["a" /* default */], - title: Object(external_wp_i18n_["__"])('Link'), - shortcut: external_wp_keycodes_["displayShortcut"].primary('k'), + icon: library_link, + title: (0,external_wp_i18n_namespaceObject.__)('Link'), + shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), onClick: startEditing - }), isURLSet && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { + }), isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { name: "link", - icon: link_off["a" /* default */], - title: Object(external_wp_i18n_["__"])('Unlink'), - shortcut: external_wp_keycodes_["displayShortcut"].primaryShift('k'), + icon: link_off, + title: (0,external_wp_i18n_namespaceObject.__)('Unlink'), + shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'), onClick: unlink, isActive: true - })), isSelected && (isEditingURL || isURLSet) && Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { + })), isSelected && (isEditingURL || isURLSet) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { position: "bottom center", onClose: () => { var _richTextRef$current2; @@ -3800,7 +3743,7 @@ function ButtonEdit(props) { }, anchorRef: ref === null || ref === void 0 ? void 0 : ref.current, focusOnMount: isEditingURL ? 'firstElement' : false - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLinkControl"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { className: "wp-block-navigation-link__inline-link-input", value: { url, @@ -3826,13 +3769,13 @@ function ButtonEdit(props) { (_richTextRef$current3 = richTextRef.current) === null || _richTextRef$current3 === void 0 ? void 0 : _richTextRef$current3.focus(); }, forceIsEditingLink: isEditingURL - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(WidthPanel, { + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(WidthPanel, { selectedWidth: width, setAttributes: setAttributes - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], { + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { __experimentalGroup: "advanced" - }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { - label: Object(external_wp_i18n_["__"])('Link rel'), + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), value: rel || '', onChange: onSetLinkRel }))); @@ -3840,7 +3783,7 @@ function ButtonEdit(props) { /* harmony default export */ var button_edit = (ButtonEdit); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js /** @@ -3874,9 +3817,9 @@ function save_save(_ref) { return null; } - const borderProps = Object(external_wp_blockEditor_["__experimentalGetBorderClassesAndStyles"])(attributes); - const colorProps = Object(external_wp_blockEditor_["__experimentalGetColorClassesAndStyles"])(attributes); - const spacingProps = Object(external_wp_blockEditor_["__experimentalGetSpacingClassesAndStyles"])(attributes); + const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); + const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, { // For backwards compatibility add style that isn't provided via // block support. @@ -3893,9 +3836,9 @@ function save_save(_ref) { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize) }); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3907,7 +3850,7 @@ function save_save(_ref) { })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js /** * WordPress dependencies */ @@ -4020,11 +3963,11 @@ const { } = button_metadata; const button_settings = { - icon: library_button["a" /* default */], + icon: library_button, example: { attributes: { className: 'is-style-fill', - text: Object(external_wp_i18n_["__"])('Call to Action') + text: (0,external_wp_i18n_namespaceObject.__)('Call to Action') } }, edit: button_edit, @@ -4040,22 +3983,22 @@ const button_settings = { } }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js /** * WordPress dependencies */ -const buttons_buttons = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const buttons = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z" })); -/* harmony default export */ var library_buttons = (buttons_buttons); +/* harmony default export */ var library_buttons = (buttons); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js /** @@ -4137,12 +4080,12 @@ const buttons_deprecated_deprecated = [{ orientation } } = _ref2; - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classnames_default()({ [`is-content-justification-${contentJustification}`]: contentJustification, 'is-vertical': orientation === 'vertical' }) - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)); + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); } }, { @@ -4152,7 +4095,7 @@ const buttons_deprecated_deprecated = [{ }, save() { - return Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)); + return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); }, isEligible(_ref3) { @@ -4178,10 +4121,9 @@ const buttons_deprecated_deprecated = [{ }]; /* harmony default export */ var buttons_deprecated = (buttons_deprecated_deprecated); -// EXTERNAL MODULE: external ["wp","richText"] -var external_wp_richText_ = __webpack_require__("qRz9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js +;// CONCATENATED MODULE: external ["wp","richText"] +var external_wp_richText_namespaceObject = window["wp"]["richText"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js /** * WordPress dependencies */ @@ -4223,37 +4165,37 @@ const { editorStyle: "wp-block-buttons-editor", style: "wp-block-buttons" }; -const buttons_transforms_transforms = { +const transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['core/button'], transform: buttons => // Creates the buttons block - Object(external_wp_blocks_["createBlock"])(transforms_name, {}, // Loop the selected buttons + (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons buttons.map(attributes => // Create singular button in the buttons block - Object(external_wp_blocks_["createBlock"])('core/button', attributes))) + (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes))) }, { type: 'block', isMultiBlock: true, blocks: ['core/paragraph'], transform: buttons => // Creates the buttons block - Object(external_wp_blocks_["createBlock"])(transforms_name, {}, // Loop the selected buttons + (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons buttons.map(attributes => { - const element = Object(external_wp_richText_["__unstableCreateElement"])(document, attributes.content); // Remove any HTML tags + const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); // Remove any HTML tags const text = element.innerText || ''; // Get first url const link = element.querySelector('a'); const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block - return Object(external_wp_blocks_["createBlock"])('core/button', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { text, url }); })), isMatch: paragraphs => { return paragraphs.every(attributes => { - const element = Object(external_wp_richText_["__unstableCreateElement"])(document, attributes.content); + const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); const text = element.innerText || ''; const links = element.querySelectorAll('a'); return text.length <= 30 && links.length <= 1; @@ -4261,9 +4203,9 @@ const buttons_transforms_transforms = { } }] }; -/* harmony default export */ var buttons_transforms = (buttons_transforms_transforms); +/* harmony default export */ var buttons_transforms = (transforms_transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js /** @@ -4284,15 +4226,15 @@ function ButtonsEdit(_ref) { layout = {} } } = _ref; - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); - const preferredStyle = Object(external_wp_data_["useSelect"])(select => { + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); + const preferredStyle = (0,external_wp_data_namespaceObject.useSelect)(select => { var _preferredStyleVariat; - const preferredStyleVariations = select(external_wp_blockEditor_["store"]).getSettings().__experimentalPreferredStyleVariations; + const preferredStyleVariations = select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations; return preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[button_name]; }, []); - const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, { + const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { allowedBlocks: ALLOWED_BLOCKS, template: [[button_name, { className: preferredStyle && `is-style-${preferredStyle}` @@ -4300,12 +4242,12 @@ function ButtonsEdit(_ref) { __experimentalLayout: layout, templateInsertUpdatesSelection: true }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", innerBlocksProps)); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); } /* harmony default export */ var buttons_edit = (ButtonsEdit); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js /** @@ -4313,11 +4255,11 @@ function ButtonsEdit(_ref) { */ function buttons_save_save() { - const innerBlocksProps = external_wp_blockEditor_["useInnerBlocksProps"].save(external_wp_blockEditor_["useBlockProps"].save()); - return Object(external_wp_element_["createElement"])("div", innerBlocksProps); + const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()); + return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js /** * WordPress dependencies */ @@ -4371,12 +4313,12 @@ const buttons_settings = { innerBlocks: [{ name: 'core/button', attributes: { - text: Object(external_wp_i18n_["__"])('Find out more') + text: (0,external_wp_i18n_namespaceObject.__)('Find out more') } }, { name: 'core/button', attributes: { - text: Object(external_wp_i18n_["__"])('Contact us') + text: (0,external_wp_i18n_namespaceObject.__)('Contact us') } }] }, @@ -4386,29 +4328,27 @@ const buttons_settings = { save: buttons_save_save }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js /** * WordPress dependencies */ -const calendar = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const calendar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" })); /* harmony default export */ var library_calendar = (calendar); -// EXTERNAL MODULE: external "moment" -var external_moment_ = __webpack_require__("wy2R"); -var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_); - -// EXTERNAL MODULE: external ["wp","coreData"] -var external_wp_coreData_ = __webpack_require__("jZUy"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js +;// CONCATENATED MODULE: external "moment" +var external_moment_namespaceObject = window["moment"]; +var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_namespaceObject); +;// CONCATENATED MODULE: external ["wp","coreData"] +var external_wp_coreData_namespaceObject = window["wp"]["coreData"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js /** @@ -4442,16 +4382,16 @@ function CalendarEdit(_ref) { let { attributes } = _ref; - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const { date, hasPosts, hasPostsResolved - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords, hasFinishedResolution - } = select(external_wp_coreData_["store"]); + } = select(external_wp_coreData_namespaceObject.store); const singlePublishedPostQuery = { status: 'publish', per_page: 1 @@ -4484,13 +4424,13 @@ function CalendarEdit(_ref) { }, []); if (!hasPosts) { - return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], { + return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { icon: library_calendar, - label: Object(external_wp_i18n_["__"])('Calendar') - }, !hasPostsResolved ? Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null) : Object(external_wp_i18n_["__"])('No published posts found.'))); + label: (0,external_wp_i18n_namespaceObject.__)('Calendar') + }, !hasPostsResolved ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.'))); } - return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], null, Object(external_wp_element_["createElement"])(external_wp_serverSideRender_default.a, { + return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), { block: "core/calendar", attributes: { ...attributes, ...getYearMonth(date) @@ -4498,7 +4438,7 @@ function CalendarEdit(_ref) { }))); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js /** * WordPress dependencies */ @@ -4539,39 +4479,39 @@ const calendar_settings = { edit: CalendarEdit }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js /** * WordPress dependencies */ -const category_category = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const category = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" })); -/* harmony default export */ var library_category = (category_category); +/* harmony default export */ var library_category = (category); -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js /** * WordPress dependencies */ -const pin = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const pin = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z" })); /* harmony default export */ var library_pin = (pin); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js /** @@ -4599,15 +4539,15 @@ function CategoriesEdit(_ref) { }, setAttributes } = _ref; - const selectId = Object(external_wp_compose_["useInstanceId"])(CategoriesEdit, 'blocks-category-select'); + const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select'); const { categories, isRequesting - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords, isResolving - } = select(external_wp_coreData_["store"]); + } = select(external_wp_coreData_namespaceObject.store); const query = { per_page: -1, hide_empty: true, @@ -4649,12 +4589,12 @@ function CategoriesEdit(_ref) { [attributeName]: newValue }); - const renderCategoryName = name => !name ? Object(external_wp_i18n_["__"])('(Untitled)') : Object(external_lodash_["unescape"])(name).trim(); + const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_lodash_namespaceObject.unescape)(name).trim(); const renderCategoryList = () => { const parentId = showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); - return Object(external_wp_element_["createElement"])("ul", { + return (0,external_wp_element_namespaceObject.createElement)("ul", { className: getCategoryListClassName(0) }, categoriesList.map(category => renderCategoryListItem(category, 0))); }; @@ -4667,15 +4607,15 @@ function CategoriesEdit(_ref) { count, name } = category; - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: id - }, Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("a", { href: link, target: "_blank", rel: "noreferrer noopener" - }, renderCategoryName(name)), showPostCounts && Object(external_wp_element_["createElement"])("span", { + }, renderCategoryName(name)), showPostCounts && (0,external_wp_element_namespaceObject.createElement)("span", { className: "wp-block-categories__post-count" - }, ` (${count})`), showHierarchy && !!childCategories.length && Object(external_wp_element_["createElement"])("ul", { + }, ` (${count})`), showHierarchy && !!childCategories.length && (0,external_wp_element_namespaceObject.createElement)("ul", { className: getCategoryListClassName(level + 1) }, childCategories.map(childCategory => renderCategoryListItem(childCategory, level + 1)))); }; @@ -4683,10 +4623,10 @@ function CategoriesEdit(_ref) { const renderCategoryDropdown = () => { const parentId = showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { as: "label", htmlFor: selectId - }, Object(external_wp_i18n_["__"])('Categories')), Object(external_wp_element_["createElement"])("select", { + }, (0,external_wp_i18n_namespaceObject.__)('Categories')), (0,external_wp_element_namespaceObject.createElement)("select", { id: selectId, className: "wp-block-categories__dropdown" }, categoriesList.map(category => renderCategoryDropdownItem(category, 0)))); @@ -4699,36 +4639,36 @@ function CategoriesEdit(_ref) { name } = category; const childCategories = getCategoriesList(id); - return [Object(external_wp_element_["createElement"])("option", { + return [(0,external_wp_element_namespaceObject.createElement)("option", { key: id - }, Object(external_lodash_["times"])(level * 3, () => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; + }, (0,external_lodash_namespaceObject.times)(level * 3, () => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; }; - return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Categories settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Display as dropdown'), + return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Categories settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), checked: displayAsDropdown, onChange: toggleAttribute('displayAsDropdown') - }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Show post counts'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), checked: showPostCounts, onChange: toggleAttribute('showPostCounts') - }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Show only top level categories'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'), checked: showOnlyTopLevel, onChange: toggleAttribute('showOnlyTopLevel') - }), !showOnlyTopLevel && Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Show hierarchy'), + }), !showOnlyTopLevel && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), checked: showHierarchy, onChange: toggleAttribute('showHierarchy') - }))), isRequesting && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], { + }))), isRequesting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { icon: library_pin, - label: Object(external_wp_i18n_["__"])('Categories') - }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)), !isRequesting && (categories === null || categories === void 0 ? void 0 : categories.length) === 0 && Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Your site does not have any posts, so there is nothing to display here at the moment.')), !isRequesting && (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())); + label: (0,external_wp_i18n_namespaceObject.__)('Categories') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), !isRequesting && (categories === null || categories === void 0 ? void 0 : categories.length) === 0 && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.')), !isRequesting && (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js /** * WordPress dependencies */ @@ -4780,22 +4720,22 @@ const categories_settings = { edit: CategoriesEdit }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js /** * WordPress dependencies */ -const classic = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const classic = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z" })); /* harmony default export */ var library_classic = (classic); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js /** @@ -4813,20 +4753,20 @@ const ConvertToBlocksButton = _ref => { } = _ref; const { replaceBlocks - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); - const block = Object(external_wp_data_["useSelect"])(select => { - return select(external_wp_blockEditor_["store"]).getBlock(clientId); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const block = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId); }, [clientId]); - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { - onClick: () => replaceBlocks(block.clientId, Object(external_wp_blocks_["rawHandler"])({ - HTML: Object(external_wp_blocks_["serialize"])(block) + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({ + HTML: (0,external_wp_blocks_namespaceObject.serialize)(block) })) - }, Object(external_wp_i18n_["__"])('Convert to blocks')); + }, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks')); }; /* harmony default export */ var convert_to_blocks_button = (ConvertToBlocksButton); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js /** @@ -4882,9 +4822,9 @@ function ClassicEdit(_ref) { } = _ref; const { getMultiSelectedBlockClientIds - } = Object(external_wp_data_["useSelect"])(external_wp_blockEditor_["store"]); - const didMount = Object(external_wp_element_["useRef"])(false); - Object(external_wp_element_["useEffect"])(() => { + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + const didMount = (0,external_wp_element_namespaceObject.useRef)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!didMount.current) { return; } @@ -4896,7 +4836,7 @@ function ClassicEdit(_ref) { editor.setContent(content || ''); } }, [content]); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { const { baseURL, suffix @@ -4945,7 +4885,7 @@ function ClassicEdit(_ref) { editor.on('mousedown touchstart', () => { bookmark = null; }); - const debouncedOnChange = Object(external_lodash_["debounce"])(() => { + const debouncedOnChange = (0,external_lodash_namespaceObject.debounce)(() => { const value = editor.getContent(); if (value !== editor._lastChange) { @@ -4961,12 +4901,12 @@ function ClassicEdit(_ref) { editor.on('remove', debouncedOnChange.cancel); editor.on('keydown', event => { - if (external_wp_keycodes_["isKeyboardEvent"].primary(event, 'z')) { + if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) { // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected event.stopPropagation(); } - if ((event.keyCode === external_wp_keycodes_["BACKSPACE"] || event.keyCode === external_wp_keycodes_["DELETE"]) && isTmceEmpty(editor)) { + if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) { // delete the block onReplace([]); event.preventDefault(); @@ -4981,7 +4921,7 @@ function ClassicEdit(_ref) { * `alt+f10` shortcut to focus its toolbar. */ - if (altKey && event.keyCode === external_wp_keycodes_["F10"]) { + if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) { event.stopPropagation(); } }); @@ -5049,16 +4989,16 @@ function ClassicEdit(_ref) { /* eslint-disable jsx-a11y/no-static-element-interactions */ - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(convert_to_blocks_button, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(convert_to_blocks_button, { clientId: clientId - }))), Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), Object(external_wp_element_["createElement"])("div", { + }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", { key: "toolbar", id: `toolbar-${clientId}`, className: "block-library-classic__toolbar", onClick: focus, - "data-placeholder": Object(external_wp_i18n_["__"])('Classic'), + "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'), onKeyDown: onToolbarKeyDown - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { key: "editor", id: `editor-${clientId}`, className: "wp-block-freeform block-library-rich-text__tinymce" @@ -5066,7 +5006,7 @@ function ClassicEdit(_ref) { /* eslint-enable jsx-a11y/no-static-element-interactions */ } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js /** @@ -5080,10 +5020,10 @@ function freeform_save_save(_ref) { const { content } = attributes; - return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, content); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js /** * WordPress dependencies */ @@ -5124,10 +5064,22 @@ const freeform_settings = { save: freeform_save_save }; -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js -var code = __webpack_require__("1Yn1"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js + +/** + * WordPress dependencies + */ + +const code = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var library_code = (code); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js /** @@ -5141,22 +5093,22 @@ function CodeEdit(_ref) { setAttributes, onRemove } = _ref; - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); - return Object(external_wp_element_["createElement"])("pre", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); + return (0,external_wp_element_namespaceObject.createElement)("pre", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "code", value: attributes.content, onChange: content => setAttributes({ content }), onRemove: onRemove, - placeholder: Object(external_wp_i18n_["__"])('Write code…'), - "aria-label": Object(external_wp_i18n_["__"])('Code'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'), + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'), preserveWhiteSpace: true, __unstablePastePlainText: true })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js /** * External dependencies */ @@ -5169,7 +5121,7 @@ function CodeEdit(_ref) { */ function utils_escape(content) { - return Object(external_lodash_["flow"])(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || ''); + return (0,external_lodash_namespaceObject.flow)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || ''); } /** * Returns the given content with all opening shortcode characters converted @@ -5208,7 +5160,7 @@ function escapeProtocolInIsolatedUrls(content) { return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1//$2'); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js /** @@ -5224,13 +5176,13 @@ function code_save_save(_ref) { let { attributes } = _ref; - return Object(external_wp_element_["createElement"])("pre", external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "code", value: utils_escape(attributes.content) })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js /** * WordPress dependencies */ @@ -5239,7 +5191,7 @@ const code_transforms_transforms = { from: [{ type: 'enter', regExp: /^```$/, - transform: () => Object(external_wp_blocks_["createBlock"])('core/code') + transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code') }, { type: 'block', blocks: ['core/html'], @@ -5247,7 +5199,7 @@ const code_transforms_transforms = { let { content } = _ref; - return Object(external_wp_blocks_["createBlock"])('core/code', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { content }); } @@ -5269,7 +5221,7 @@ const code_transforms_transforms = { }; /* harmony default export */ var code_transforms = (code_transforms_transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js /** * WordPress dependencies */ @@ -5333,12 +5285,12 @@ const { } = code_metadata; const code_settings = { - icon: code["a" /* default */], + icon: library_code, example: { attributes: { /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ // translators: Preserve \n markers for line breaks - content: Object(external_wp_i18n_["__"])('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );') + content: (0,external_wp_i18n_namespaceObject.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );') /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ } @@ -5348,22 +5300,22 @@ const code_settings = { save: code_save_save }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js /** * WordPress dependencies */ -const column = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const column = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z" })); /* harmony default export */ var library_column = (column); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js /** @@ -5414,16 +5366,16 @@ const column_deprecated_deprecated = [{ const style = { flexBasis: width + '%' }; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: wrapperClasses, style: style - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); } }]; /* harmony default export */ var column_deprecated = (column_deprecated_deprecated); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js /** @@ -5453,18 +5405,18 @@ function ColumnEdit(_ref) { const classes = classnames_default()('block-core-columns', { [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); - const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({ - availableUnits: Object(external_wp_blockEditor_["useSetting"])('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] }); const { columnsIds, hasChildBlocks, rootClientId - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockOrder, getBlockRootClientId - } = select(external_wp_blockEditor_["store"]); + } = select(external_wp_blockEditor_namespaceObject.store); const rootId = getBlockRootClientId(clientId); return { hasChildBlocks: getBlockOrder(clientId).length > 0, @@ -5474,7 +5426,7 @@ function ColumnEdit(_ref) { }, [clientId]); const { updateBlockAttributes - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const updateAlignment = value => { // Update own alignment. @@ -5488,7 +5440,7 @@ function ColumnEdit(_ref) { }; const widthWithUnit = Number.isFinite(width) ? width + '%' : width; - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes, style: widthWithUnit ? { flexBasis: widthWithUnit @@ -5496,23 +5448,23 @@ function ColumnEdit(_ref) { }); const columnsCount = columnsIds.length; const currentColumnPosition = columnsIds.indexOf(clientId) + 1; - const label = Object(external_wp_i18n_["sprintf"])( + const label = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ - Object(external_wp_i18n_["__"])('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount); - const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])({ ...blockProps, + (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount); + const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps, 'aria-label': label }, { templateLock, allowedBlocks, - renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender + renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockVerticalAlignmentToolbar"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { onChange: updateAlignment, value: verticalAlignment - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Column settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], { - label: Object(external_wp_i18n_["__"])('Width'), + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Column settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Width'), labelPosition: "edge", __unstableInputWidth: "80px", value: width || '', @@ -5523,12 +5475,12 @@ function ColumnEdit(_ref) { }); }, units: units - }))), Object(external_wp_element_["createElement"])("div", innerBlocksProps)); + }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); } /* harmony default export */ var column_edit = (ColumnEdit); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js /** @@ -5568,15 +5520,15 @@ function column_save_save(_ref) { }; } - const blockProps = external_wp_blockEditor_["useBlockProps"].save({ + const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses, style }); - const innerBlocksProps = external_wp_blockEditor_["useInnerBlocksProps"].save(blockProps); - return Object(external_wp_element_["createElement"])("div", innerBlocksProps); + const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); + return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js /** * WordPress dependencies */ @@ -5638,22 +5590,22 @@ const column_settings = { deprecated: column_deprecated }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js /** * WordPress dependencies */ -const columns_columns = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const columns = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z" })); -/* harmony default export */ var library_columns = (columns_columns); +/* harmony default export */ var library_columns = (columns); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js /** @@ -5714,7 +5666,7 @@ const migrateCustomColors = attributes => { style.color.background = attributes.customBackgroundColor; } - return { ...Object(external_lodash_["omit"])(attributes, ['customTextColor', 'customBackgroundColor']), + return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']), style, isStackedOnMobile: true }; @@ -5751,8 +5703,8 @@ const migrateCustomColors = attributes => { textColor, customTextColor } = attributes; - const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); - const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); + const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); + const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = classnames_default()({ 'has-background': backgroundColor || customBackgroundColor, 'has-text-color': textColor || customTextColor, @@ -5764,10 +5716,10 @@ const migrateCustomColors = attributes => { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: className ? className : undefined, style: style - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); } }, { @@ -5812,8 +5764,8 @@ const migrateCustomColors = attributes => { accumulator[columnIndex].push(innerBlock); return accumulator; }, []); - const migratedInnerBlocks = columns.map(columnBlocks => Object(external_wp_blocks_["createBlock"])('core/column', {}, columnBlocks)); - return [{ ...Object(external_lodash_["omit"])(attributes, ['columns']), + const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks)); + return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']), isStackedOnMobile: true }, migratedInnerBlocks]; }, @@ -5825,9 +5777,9 @@ const migrateCustomColors = attributes => { const { columns } = attributes; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: `has-${columns}-columns` - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); } }, { @@ -5839,7 +5791,7 @@ const migrateCustomColors = attributes => { }, migrate(attributes, innerBlocks) { - attributes = { ...Object(external_lodash_["omit"])(attributes, ['columns']), + attributes = { ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']), isStackedOnMobile: true }; return [attributes, innerBlocks]; @@ -5856,14 +5808,14 @@ const migrateCustomColors = attributes => { const wrapperClasses = classnames_default()(`has-${columns}-columns`, { [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: wrapperClasses - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); } }]); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js /** * External dependencies */ @@ -5909,7 +5861,7 @@ function getEffectiveColumnWidth(block, totalBlockCount) { function getTotalColumnsWidth(blocks) { let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length; - return Object(external_lodash_["sumBy"])(blocks, block => getEffectiveColumnWidth(block, totalBlockCount)); + return (0,external_lodash_namespaceObject.sumBy)(blocks, block => getEffectiveColumnWidth(block, totalBlockCount)); } /** * Returns an object of `clientId` → `width` of effective column widths. @@ -5946,7 +5898,7 @@ function getColumnWidths(blocks) { function getRedistributedColumnWidths(blocks, availableWidth) { let totalBlockCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : blocks.length; const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount); - return Object(external_lodash_["mapValues"])(getColumnWidths(blocks, totalBlockCount), width => { + return (0,external_lodash_namespaceObject.mapValues)(getColumnWidths(blocks, totalBlockCount), width => { const newWidth = availableWidth * width / totalWidth; return toWidthPrecision(newWidth); }); @@ -5979,7 +5931,7 @@ function hasExplicitPercentColumnWidths(blocks) { */ function getMappedColumnWidths(blocks, widths) { - return blocks.map(block => Object(external_lodash_["merge"])({}, block, { + return blocks.map(block => (0,external_lodash_namespaceObject.merge)({}, block, { attributes: { width: `${widths[block.clientId]}%` } @@ -6031,7 +5983,7 @@ function isPercentageUnit(unit) { return unit === '%'; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js /** @@ -6079,45 +6031,45 @@ function ColumnsEditContainer(_ref) { } = attributes; const { count - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { - count: select(external_wp_blockEditor_["store"]).getBlockCount(clientId) + count: select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId) }; }, [clientId]); const classes = classnames_default()({ [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment, [`is-not-stacked-on-mobile`]: !isStackedOnMobile }); - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); - const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, { + const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { allowedBlocks: edit_ALLOWED_BLOCKS, orientation: 'horizontal', renderAppender: false }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockVerticalAlignmentToolbar"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { onChange: updateAlignment, value: verticalAlignment - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], null, Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], { - label: Object(external_wp_i18n_["__"])('Columns'), + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: count, onChange: value => updateColumns(count, value), min: 1, max: Math.max(6, count) - }), count > 6 && Object(external_wp_element_["createElement"])(external_wp_components_["Notice"], { + }), count > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false - }, Object(external_wp_i18n_["__"])('This column count exceeds the recommended amount and may cause visual breakage.')), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Stack on mobile'), + }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), checked: isStackedOnMobile, onChange: () => setAttributes({ isStackedOnMobile: !isStackedOnMobile }) - }))), Object(external_wp_element_["createElement"])("div", innerBlocksProps)); + }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); } -const ColumnsEditContainerWrapper = Object(external_wp_data_["withDispatch"])((dispatch, ownProps, registry) => ({ +const ColumnsEditContainerWrapper = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => ({ /** * Update all child Column blocks with a new vertical alignment setting * based on whatever alignment is passed in. This allows change to parent @@ -6132,10 +6084,10 @@ const ColumnsEditContainerWrapper = Object(external_wp_data_["withDispatch"])((d } = ownProps; const { updateBlockAttributes - } = dispatch(external_wp_blockEditor_["store"]); + } = dispatch(external_wp_blockEditor_namespaceObject.store); const { getBlockOrder - } = registry.select(external_wp_blockEditor_["store"]); // Update own alignment. + } = registry.select(external_wp_blockEditor_namespaceObject.store); // Update own alignment. setAttributes({ verticalAlignment @@ -6162,10 +6114,10 @@ const ColumnsEditContainerWrapper = Object(external_wp_data_["withDispatch"])((d } = ownProps; const { replaceInnerBlocks - } = dispatch(external_wp_blockEditor_["store"]); + } = dispatch(external_wp_blockEditor_namespaceObject.store); const { getBlocks - } = registry.select(external_wp_blockEditor_["store"]); + } = registry.select(external_wp_blockEditor_namespaceObject.store); let innerBlocks = getBlocks(clientId); const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks. @@ -6178,18 +6130,18 @@ const ColumnsEditContainerWrapper = Object(external_wp_data_["withDispatch"])((d // constraining the available working width. const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth); - innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Object(external_lodash_["times"])(newColumns - previousColumns, () => { - return Object(external_wp_blocks_["createBlock"])('core/column', { + innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', { width: `${newColumnWidth}%` }); })]; } else if (isAddingColumn) { - innerBlocks = [...innerBlocks, ...Object(external_lodash_["times"])(newColumns - previousColumns, () => { - return Object(external_wp_blocks_["createBlock"])('core/column'); + innerBlocks = [...innerBlocks, ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/column'); })]; } else { // The removed column will be the last of the inner blocks. - innerBlocks = Object(external_lodash_["dropRight"])(innerBlocks, previousColumns - newColumns); + innerBlocks = (0,external_lodash_namespaceObject.dropRight)(innerBlocks, previousColumns - newColumns); if (hasExplicitWidths) { // Redistribute as if block is already removed. @@ -6213,12 +6165,12 @@ function Placeholder(_ref2) { blockType, defaultVariation, variations - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockVariations, getBlockType, getDefaultBlockVariation - } = select(external_wp_blocks_["store"]); + } = select(external_wp_blocks_namespaceObject.store); return { blockType: getBlockType(name), defaultVariation: getDefaultBlockVariation(name, 'block'), @@ -6227,11 +6179,11 @@ function Placeholder(_ref2) { }, [name]); const { replaceInnerBlocks - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); - return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockVariationPicker"], { - icon: Object(external_lodash_["get"])(blockType, ['icon', 'src']), - label: Object(external_lodash_["get"])(blockType, ['title']), + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); + return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { + icon: (0,external_lodash_namespaceObject.get)(blockType, ['icon', 'src']), + label: (0,external_lodash_namespaceObject.get)(blockType, ['title']), variations: variations, onSelect: function () { let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation; @@ -6241,7 +6193,7 @@ function Placeholder(_ref2) { } if (nextVariation.innerBlocks) { - replaceInnerBlocks(clientId, Object(external_wp_blocks_["createBlocksFromInnerBlocksTemplate"])(nextVariation.innerBlocks), true); + replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true); } }, allowSkip: true @@ -6252,14 +6204,14 @@ const ColumnsEdit = props => { const { clientId } = props; - const hasInnerBlocks = Object(external_wp_data_["useSelect"])(select => select(external_wp_blockEditor_["store"]).getBlocks(clientId).length > 0, [clientId]); + const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]); const Component = hasInnerBlocks ? ColumnsEditContainerWrapper : Placeholder; - return Object(external_wp_element_["createElement"])(Component, props); + return (0,external_wp_element_namespaceObject.createElement)(Component, props); }; /* harmony default export */ var columns_edit = (ColumnsEdit); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js /** @@ -6283,14 +6235,14 @@ function columns_save_save(_ref) { [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment, [`is-not-stacked-on-mobile`]: !isStackedOnMobile }); - const blockProps = external_wp_blockEditor_["useBlockProps"].save({ + const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }); - const innerBlocksProps = external_wp_blockEditor_["useInnerBlocksProps"].save(blockProps); - return Object(external_wp_element_["createElement"])("div", innerBlocksProps); + const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); + return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js /** @@ -6306,16 +6258,16 @@ function columns_save_save(_ref) { * @type {WPBlockVariation[]} */ -const variations_variations = [{ +const variations = [{ name: 'one-column-full', - title: Object(external_wp_i18n_["__"])('100'), - description: Object(external_wp_i18n_["__"])('One column'), - icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + title: (0,external_wp_i18n_namespaceObject.__)('100'), + description: (0,external_wp_i18n_namespaceObject.__)('One column'), + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { width: "48", height: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z" @@ -6324,14 +6276,14 @@ const variations_variations = [{ scope: ['block'] }, { name: 'two-columns-equal', - title: Object(external_wp_i18n_["__"])('50 / 50'), - description: Object(external_wp_i18n_["__"])('Two columns; equal split'), - icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'), + description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'), + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { width: "48", height: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z" @@ -6341,14 +6293,14 @@ const variations_variations = [{ scope: ['block'] }, { name: 'two-columns-one-third-two-thirds', - title: Object(external_wp_i18n_["__"])('30 / 70'), - description: Object(external_wp_i18n_["__"])('Two columns; one-third, two-thirds split'), - icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + title: (0,external_wp_i18n_namespaceObject.__)('30 / 70'), + description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'), + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { width: "48", height: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z" @@ -6361,14 +6313,14 @@ const variations_variations = [{ scope: ['block'] }, { name: 'two-columns-two-thirds-one-third', - title: Object(external_wp_i18n_["__"])('70 / 30'), - description: Object(external_wp_i18n_["__"])('Two columns; two-thirds, one-third split'), - icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + title: (0,external_wp_i18n_namespaceObject.__)('70 / 30'), + description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'), + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { width: "48", height: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z" @@ -6381,14 +6333,14 @@ const variations_variations = [{ scope: ['block'] }, { name: 'three-columns-equal', - title: Object(external_wp_i18n_["__"])('33 / 33 / 33'), - description: Object(external_wp_i18n_["__"])('Three columns; equal split'), - icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'), + description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'), + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { width: "48", height: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z" })), @@ -6396,14 +6348,14 @@ const variations_variations = [{ scope: ['block'] }, { name: 'three-columns-wider-center', - title: Object(external_wp_i18n_["__"])('25 / 50 / 25'), - description: Object(external_wp_i18n_["__"])('Three columns; wide center column'), - icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'), + description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'), + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { width: "48", height: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z" })), @@ -6416,9 +6368,9 @@ const variations_variations = [{ }]], scope: ['block'] }]; -/* harmony default export */ var columns_variations = (variations_variations); +/* harmony default export */ var columns_variations = (variations); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js /** * WordPress dependencies */ @@ -6442,7 +6394,7 @@ const columns_transforms_transforms = { }, [[name, { ...attributes }, innerBlocks]]]; }); - return Object(external_wp_blocks_["createBlock"])('core/columns', {}, Object(external_wp_blocks_["createBlocksFromInnerBlocksTemplate"])(innerBlocksTemplate)); + return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); }, isMatch: _ref2 => { let { @@ -6505,19 +6457,19 @@ const columns_transforms_transforms = { innerBlocksTemplate.reverse(); } - return Object(external_wp_blocks_["createBlock"])('core/columns', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { align, backgroundColor, textColor, style, verticalAlignment - }, Object(external_wp_blocks_["createBlocksFromInnerBlocksTemplate"])(innerBlocksTemplate)); + }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); } }] }; /* harmony default export */ var columns_transforms = (columns_transforms_transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js /** * WordPress dependencies */ @@ -6583,7 +6535,7 @@ const columns_settings = { name: 'core/paragraph', attributes: { /* translators: example text. */ - content: Object(external_wp_i18n_["__"])('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.') + content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.') } }, { name: 'core/image', @@ -6594,7 +6546,7 @@ const columns_settings = { name: 'core/paragraph', attributes: { /* translators: example text. */ - content: Object(external_wp_i18n_["__"])('Suspendisse commodo neque lacus, a dictum orci interdum et.') + content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.') } }] }, { @@ -6603,13 +6555,13 @@ const columns_settings = { name: 'core/paragraph', attributes: { /* translators: example text. */ - content: Object(external_wp_i18n_["__"])('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.') + content: (0,external_wp_i18n_namespaceObject.__)('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.') } }, { name: 'core/paragraph', attributes: { /* translators: example text. */ - content: Object(external_wp_i18n_["__"])('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.') + content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.') } }] }] @@ -6620,22 +6572,22 @@ const columns_settings = { transforms: columns_transforms }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js /** * WordPress dependencies */ -const cover = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const cover = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z" })); /* harmony default export */ var library_cover = (cover); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js /** * WordPress dependencies */ @@ -6676,8 +6628,8 @@ function attributesFromMedia(setAttributes, dimRatio) { return; } - if (Object(external_wp_blob_["isBlobURL"])(media.url)) { - media.type = Object(external_wp_blob_["getBlobTypeByURL"])(media.url); + if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { + media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); } let mediaType; // for media selections originated from a file upload. @@ -6738,7 +6690,7 @@ function getPositionClassName(contentPosition) { return POSITION_CLASSNAMES[contentPosition]; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js /** @@ -6777,7 +6729,7 @@ function migrateDimRatio(attributes) { }; } -const cover_deprecated_blockAttributes = { +const deprecated_blockAttributes = { url: { type: 'string' }, @@ -6807,7 +6759,7 @@ const cover_deprecated_blockAttributes = { } }; const v7 = { - attributes: { ...cover_deprecated_blockAttributes, + attributes: { ...deprecated_blockAttributes, isRepeated: { type: 'boolean', default: false @@ -6873,9 +6825,9 @@ const v7 = { minHeight: minHeightProp, minHeightUnit } = attributes; - const overlayColorClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayColor); + const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); - const gradientClass = Object(external_wp_blockEditor_["__experimentalGetGradientClass"])(gradient); + const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; @@ -6896,16 +6848,16 @@ const v7 = { [gradientClass]: !url && gradientClass, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style - }), url && (gradient || customGradient) && dimRatio !== 0 && Object(external_wp_element_["createElement"])("span", { + }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", { "aria-hidden": "true", className: classnames_default()('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined - }), isImageBackground && isImgElement && url && Object(external_wp_element_["createElement"])("img", { + }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", { className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, @@ -6914,7 +6866,7 @@ const v7 = { }, "data-object-fit": "cover", "data-object-position": objectPosition - }), isVideoBackground && url && Object(external_wp_element_["createElement"])("video", { + }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", { className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, @@ -6926,15 +6878,15 @@ const v7 = { }, "data-object-fit": "cover", "data-object-position": objectPosition - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-cover__inner-container" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); }, migrate: migrateDimRatio }; const v6 = { - attributes: { ...cover_deprecated_blockAttributes, + attributes: { ...deprecated_blockAttributes, isRepeated: { type: 'boolean', default: false @@ -6978,9 +6930,9 @@ const v6 = { minHeight: minHeightProp, minHeightUnit } = attributes; - const overlayColorClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayColor); + const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); - const gradientClass = Object(external_wp_blockEditor_["__experimentalGetGradientClass"])(gradient); + const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; @@ -7019,16 +6971,16 @@ const v6 = { [gradientClass]: !url && gradientClass, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style - }), url && (gradient || customGradient) && dimRatio !== 0 && Object(external_wp_element_["createElement"])("span", { + }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", { "aria-hidden": "true", className: classnames_default()('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined - }), isVideoBackground && url && Object(external_wp_element_["createElement"])("video", { + }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, @@ -7036,15 +6988,15 @@ const v6 = { playsInline: true, src: url, style: videoStyle - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-cover__inner-container" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); }, migrate: migrateDimRatio }; const v5 = { - attributes: { ...cover_deprecated_blockAttributes, + attributes: { ...deprecated_blockAttributes, minHeight: { type: 'number' }, @@ -7075,9 +7027,9 @@ const v5 = { url, minHeight } = attributes; - const overlayColorClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayColor); + const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); - const gradientClass = Object(external_wp_blockEditor_["__experimentalGetGradientClass"])(gradient); + const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; @@ -7100,30 +7052,30 @@ const v5 = { 'has-background-gradient': customGradient, [gradientClass]: !url && gradientClass }); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: classes, style: style - }, url && (gradient || customGradient) && dimRatio !== 0 && Object(external_wp_element_["createElement"])("span", { + }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", { "aria-hidden": "true", className: classnames_default()('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined - }), VIDEO_BACKGROUND_TYPE === backgroundType && url && Object(external_wp_element_["createElement"])("video", { + }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-cover__inner-container" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); }, migrate: migrateDimRatio }; const v4 = { - attributes: { ...cover_deprecated_blockAttributes, + attributes: { ...deprecated_blockAttributes, minHeight: { type: 'number' }, @@ -7154,9 +7106,9 @@ const v4 = { url, minHeight } = attributes; - const overlayColorClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayColor); + const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); - const gradientClass = Object(external_wp_blockEditor_["__experimentalGetGradientClass"])(gradient); + const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; @@ -7179,30 +7131,30 @@ const v4 = { 'has-background-gradient': customGradient, [gradientClass]: !url && gradientClass }); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: classes, style: style - }, url && (gradient || customGradient) && dimRatio !== 0 && Object(external_wp_element_["createElement"])("span", { + }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", { "aria-hidden": "true", className: classnames_default()('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined - }), VIDEO_BACKGROUND_TYPE === backgroundType && url && Object(external_wp_element_["createElement"])("video", { + }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-cover__inner-container" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); }, migrate: migrateDimRatio }; const v3 = { - attributes: { ...cover_deprecated_blockAttributes, + attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', @@ -7232,7 +7184,7 @@ const v3 = { title, url } = attributes; - const overlayColorClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayColor); + const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; if (!overlayColorClass) { @@ -7248,16 +7200,16 @@ const v3 = { 'has-parallax': hasParallax, [`has-${contentAlign}-content`]: contentAlign !== 'center' }); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: classes, style: style - }, VIDEO_BACKGROUND_TYPE === backgroundType && url && Object(external_wp_element_["createElement"])("video", { + }, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url - }), !external_wp_blockEditor_["RichText"].isEmpty(title) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", className: "wp-block-cover-text", value: title @@ -7268,17 +7220,17 @@ const v3 = { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio }; - return [Object(external_lodash_["omit"])(newAttribs, ['title', 'contentAlign']), [Object(external_wp_blocks_["createBlock"])('core/paragraph', { + return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', - placeholder: Object(external_wp_i18n_["__"])('Write title…') + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; const v2 = { - attributes: { ...cover_deprecated_blockAttributes, + attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', @@ -7310,7 +7262,7 @@ const v2 = { overlayColor, customOverlayColor } = attributes; - const overlayColorClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayColor); + const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const style = backgroundImageStyles(url); if (!overlayColorClass) { @@ -7322,10 +7274,10 @@ const v2 = { 'has-parallax': hasParallax, [`has-${contentAlign}-content`]: contentAlign !== 'center' }, align ? `align${align}` : null); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: classes, style: style - }, !external_wp_blockEditor_["RichText"].isEmpty(title) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", className: "wp-block-cover-image-text", value: title @@ -7336,17 +7288,17 @@ const v2 = { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio }; - return [Object(external_lodash_["omit"])(newAttribs, ['title', 'contentAlign', 'align']), [Object(external_wp_blocks_["createBlock"])('core/paragraph', { + return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', - placeholder: Object(external_wp_i18n_["__"])('Write title…') + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; const v1 = { - attributes: { ...cover_deprecated_blockAttributes, + attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', @@ -7380,10 +7332,10 @@ const v1 = { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax }, align ? `align${align}` : null); - return Object(external_wp_element_["createElement"])("section", { + return (0,external_wp_element_namespaceObject.createElement)("section", { className: classes, style: style - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "h2", value: title })); @@ -7393,11 +7345,11 @@ const v1 = { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio }; - return [Object(external_lodash_["omit"])(newAttribs, ['title', 'contentAlign', 'align']), [Object(external_wp_blocks_["createBlock"])('core/paragraph', { + return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', - placeholder: Object(external_wp_i18n_["__"])('Write title…') + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } @@ -7405,16 +7357,15 @@ const v1 = { /* harmony default export */ var cover_deprecated = ([v7, v6, v5, v4, v3, v2, v1]); // EXTERNAL MODULE: ./node_modules/fast-average-color/dist/index.js -var dist = __webpack_require__("FEKF"); +var dist = __webpack_require__(5027); var dist_default = /*#__PURE__*/__webpack_require__.n(dist); +;// CONCATENATED MODULE: ./node_modules/colord/index.mjs +var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^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,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({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(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; -// EXTERNAL MODULE: ./node_modules/colord/index.mjs -var colord = __webpack_require__("fHnH"); +;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs +/* harmony default export */ function names(e,f){var a={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 d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u 1 && arguments[1] !== undefined ? arguments[1] : 50; let overlayColor = arguments.length > 2 ? arguments[2] : undefined; let elementRef = arguments.length > 3 ? arguments[3] : undefined; - const [isDark, setIsDark] = Object(external_wp_element_["useState"])(false); - Object(external_wp_element_["useEffect"])(() => { + const [isDark, setIsDark] = (0,external_wp_element_namespaceObject.useState)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { // If opacity is lower than 50 the dominant color is the image or video color, // so use that color for the dark mode computation. if (url && dimRatio <= 50 && elementRef.current) { @@ -7600,7 +7551,7 @@ function useCoverIsDark(url) { }); } }, [url, url && dimRatio <= 50 && elementRef.current, setIsDark]); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { // If opacity is greater than 50 the dominant color is the overlay color, // so use that color for the dark mode computation. if (dimRatio > 50 || !url) { @@ -7610,10 +7561,10 @@ function useCoverIsDark(url) { return; } - setIsDark(Object(colord["a" /* colord */])(overlayColor).isDark()); + setIsDark(w(overlayColor).isDark()); } }, [overlayColor, dimRatio > 50 || !url, setIsDark]); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!url && !overlayColor) { // Reset isDark setIsDark(false); @@ -7622,7 +7573,7 @@ function useCoverIsDark(url) { return isDark; } -function edit_mediaPosition(_ref3) { +function mediaPosition(_ref3) { let { x, y @@ -7640,7 +7591,7 @@ function edit_mediaPosition(_ref3) { */ -const edit_isTemporaryMedia = (id, url) => !id && Object(external_wp_blob_["isBlobURL"])(url); +const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); function CoverPlaceholder(_ref4) { let { @@ -7655,13 +7606,13 @@ function CoverPlaceholder(_ref4) { removeAllNotices, createErrorNotice } = noticeOperations; - return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], { - icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_cover }), labels: { - title: Object(external_wp_i18n_["__"])('Cover'), - instructions: Object(external_wp_i18n_["__"])('Drag and drop onto this block, upload, or select existing media from your library.') + title: (0,external_wp_i18n_namespaceObject.__)('Cover'), + instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.') }, onSelect: onSelectMedia, accept: "image/*,video/*", @@ -7713,12 +7664,12 @@ function CoverEdit(_ref5) { gradientClass, gradientValue, setGradient - } = Object(external_wp_blockEditor_["__experimentalUseGradient"])(); + } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); const onSelectMedia = attributesFromMedia(setAttributes, dimRatio); - const isUploadingMedia = edit_isTemporaryMedia(id, url); - const [prevMinHeightValue, setPrevMinHeightValue] = Object(external_wp_element_["useState"])(minHeight); - const [prevMinHeightUnit, setPrevMinHeightUnit] = Object(external_wp_element_["useState"])(minHeightUnit); + const isUploadingMedia = isTemporaryMedia(id, url); + const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight); + const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit); const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100; const toggleMinFullHeight = () => { @@ -7762,9 +7713,9 @@ function CoverEdit(_ref5) { }); }; - const isDarkElement = Object(external_wp_element_["useRef"])(); + const isDarkElement = (0,external_wp_element_namespaceObject.useRef)(); const isCoverDark = useCoverIsDark(url, dimRatio, overlayColor.color, isDarkElement); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { // This side-effect should not create an undo level. markNextChangeAsNotPersistent(); setAttributes({ @@ -7773,7 +7724,7 @@ function CoverEdit(_ref5) { }, [isCoverDark]); const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; - const [temporaryMinHeight, setTemporaryMinHeight] = Object(external_wp_element_["useState"])(null); + const [temporaryMinHeight, setTemporaryMinHeight] = (0,external_wp_element_namespaceObject.useState)(null); const minHeightWithUnit = minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : undefined), @@ -7783,51 +7734,51 @@ function CoverEdit(_ref5) { backgroundColor: overlayColor.color }; const mediaStyle = { - objectPosition: focalPoint && isImgElement ? edit_mediaPosition(focalPoint) : undefined + objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined }; const hasBackground = !!(url || overlayColor.color || gradientValue); const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated); const imperativeFocalPointPreview = value => { const [styleOfRef, property] = isDarkElement.current ? [isDarkElement.current.style, 'objectPosition'] : [ref.current.style, 'backgroundPosition']; - styleOfRef[property] = edit_mediaPosition(value); + styleOfRef[property] = mediaPosition(value); }; - const hasInnerBlocks = Object(external_wp_data_["useSelect"])(select => select(external_wp_blockEditor_["store"]).getBlock(clientId).innerBlocks.length > 0, [clientId]); - const controls = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], { + const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]); + const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockAlignmentMatrixControl"], { - label: Object(external_wp_i18n_["__"])('Change content position'), + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Change content position'), value: contentPosition, onChange: nextPosition => setAttributes({ contentPosition: nextPosition }), isDisabled: !hasInnerBlocks - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockFullHeightAligmentControl"], { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, { isActive: isMinFullHeight, onToggle: toggleMinFullHeight, isDisabled: !hasInnerBlocks - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], { + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaReplaceFlow"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: url, allowedTypes: shared_ALLOWED_MEDIA_TYPES, accept: "image/*,video/*", onSelect: onSelectMedia, - name: !url ? Object(external_wp_i18n_["__"])('Add Media') : Object(external_wp_i18n_["__"])('Replace') - })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, !!url && Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Media settings') - }, isImageBackground && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Fixed background'), + name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace') + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, !!url && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Media settings') + }, isImageBackground && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), checked: hasParallax, onChange: toggleParallax - }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Repeated background'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'), checked: isRepeated, onChange: toggleIsRepeated - })), showFocalPointPicker && Object(external_wp_element_["createElement"])(external_wp_components_["FocalPointPicker"], { - label: Object(external_wp_i18n_["__"])('Focal point picker'), + })), showFocalPointPicker && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, { + label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'), url: url, value: focalPoint, onDragStart: imperativeFocalPointPreview, @@ -7835,16 +7786,16 @@ function CoverEdit(_ref5) { onChange: newFocalPoint => setAttributes({ focalPoint: newFocalPoint }) - }), url && isImageBackground && isImgElement && Object(external_wp_element_["createElement"])(external_wp_components_["TextareaControl"], { - label: Object(external_wp_i18n_["__"])('Alt text (alternative text)'), + }), url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'), value: alt, onChange: newAlt => setAttributes({ alt: newAlt }), - help: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { + help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { href: "https://www.w3.org/WAI/tutorials/images/decision-tree" - }, Object(external_wp_i18n_["__"])('Describe the purpose of the image')), Object(external_wp_i18n_["__"])('Leave empty if the image is purely decorative.')) - }), Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.')) + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { variant: "secondary", isSmall: true, className: "block-library-cover__reset-button", @@ -7856,20 +7807,20 @@ function CoverEdit(_ref5) { hasParallax: undefined, isRepeated: undefined }) - }, Object(external_wp_i18n_["__"])('Clear Media')))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalPanelColorGradientSettings"], { + }, (0,external_wp_i18n_namespaceObject.__)('Clear Media')))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPanelColorGradientSettings, { __experimentalHasMultipleOrigins: true, __experimentalIsRenderedInSidebar: true, - title: Object(external_wp_i18n_["__"])('Overlay'), + title: (0,external_wp_i18n_namespaceObject.__)('Overlay'), initialOpen: true, settings: [{ colorValue: overlayColor.color, gradientValue, onColorChange: setOverlayColor, onGradientChange: setGradient, - label: Object(external_wp_i18n_["__"])('Color') + label: (0,external_wp_i18n_namespaceObject.__)('Color') }] - }, Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], { - label: Object(external_wp_i18n_["__"])('Opacity'), + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Opacity'), value: dimRatio, onChange: newDimRation => setAttributes({ dimRatio: newDimRation @@ -7878,11 +7829,11 @@ function CoverEdit(_ref5) { max: 100, step: 10, required: true - }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], { + }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { __experimentalGroup: "dimensions" - }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!minHeight, - label: Object(external_wp_i18n_["__"])('Minimum height'), + label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), onDeselect: () => setAttributes({ minHeight: undefined, minHeightUnit: undefined @@ -7893,7 +7844,7 @@ function CoverEdit(_ref5) { }), isShownByDefault: true, panelId: clientId - }, Object(external_wp_element_["createElement"])(CoverHeightInput, { + }, (0,external_wp_element_namespaceObject.createElement)(CoverHeightInput, { value: temporaryMinHeight || minHeight, unit: minHeightUnit, onChange: newMinHeight => setAttributes({ @@ -7903,16 +7854,16 @@ function CoverEdit(_ref5) { minHeightUnit: nextUnit }) })))); - const ref = Object(external_wp_element_["useRef"])(); - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks. - const hasFontSizes = !!((_useSetting = Object(external_wp_blockEditor_["useSetting"])('typography.fontSizes')) !== null && _useSetting !== void 0 && _useSetting.length); + const hasFontSizes = !!((_useSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fontSizes')) !== null && _useSetting !== void 0 && _useSetting.length); const innerBlocksTemplate = getInnerBlocksTemplate({ fontSize: hasFontSizes ? 'large' : undefined }); - const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])({ + const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ className: 'wp-block-cover__inner-container' }, { template: innerBlocksTemplate, @@ -7922,23 +7873,23 @@ function CoverEdit(_ref5) { }); if (!hasInnerBlocks && !hasBackground) { - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, controls, Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, blockProps, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, { className: classnames_default()('is-placeholder', blockProps.className) - }), Object(external_wp_element_["createElement"])(CoverPlaceholder, { + }), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, { noticeUI: noticeUI, onSelectMedia: onSelectMedia, noticeOperations: noticeOperations, style: { minHeight: temporaryMinHeight || minHeightWithUnit || undefined } - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-cover__placeholder-background-options" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ColorPalette"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, { disableCustomColors: true, value: overlayColor.color, onChange: setOverlayColor, clearable: false - }))), Object(external_wp_element_["createElement"])(ResizableCover, { + }))), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, { className: "block-library-cover__resize-container", onResizeStart: () => { setAttributes({ @@ -7966,16 +7917,16 @@ function CoverEdit(_ref5) { 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, controls, Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, blockProps, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, { className: classnames_default()(classes, blockProps.className), style: { ...style, ...blockProps.style }, "data-url": url - }), Object(external_wp_element_["createElement"])(BoxControlVisualizer, { + }), (0,external_wp_element_namespaceObject.createElement)(BoxControlVisualizer, { values: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$spaci = styleAttribute.spacing) === null || _styleAttribute$spaci === void 0 ? void 0 : _styleAttribute$spaci.padding, showValues: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$visua = styleAttribute.visualizers) === null || _styleAttribute$visua === void 0 ? void 0 : _styleAttribute$visua.padding - }), Object(external_wp_element_["createElement"])(ResizableCover, { + }), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, { className: "block-library-cover__resize-container", onResizeStart: () => { setAttributes({ @@ -7992,7 +7943,7 @@ function CoverEdit(_ref5) { setTemporaryMinHeight(null); }, showHandle: isSelected - }), Object(external_wp_element_["createElement"])("span", { + }), (0,external_wp_element_namespaceObject.createElement)("span", { "aria-hidden": "true", className: classnames_default()(dimRatioToClass(dimRatio), { [overlayColor.class]: overlayColor.class @@ -8005,13 +7956,13 @@ function CoverEdit(_ref5) { backgroundImage: gradientValue, ...bgStyle } - }), url && isImageBackground && isImgElement && Object(external_wp_element_["createElement"])("img", { + }), url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)("img", { ref: isDarkElement, className: "wp-block-cover__image-background", alt: alt, src: url, style: mediaStyle - }), url && isVideoBackground && Object(external_wp_element_["createElement"])("video", { + }), url && isVideoBackground && (0,external_wp_element_namespaceObject.createElement)("video", { ref: isDarkElement, className: "wp-block-cover__video-background", autoPlay: true, @@ -8019,28 +7970,28 @@ function CoverEdit(_ref5) { loop: true, src: url, style: mediaStyle - }), isUploadingMedia && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), Object(external_wp_element_["createElement"])(CoverPlaceholder, { + }), isUploadingMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, { disableMediaButtons: true, noticeUI: noticeUI, onSelectMedia: onSelectMedia, noticeOperations: noticeOperations - }), Object(external_wp_element_["createElement"])("div", innerBlocksProps))); + }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps))); } -/* harmony default export */ var cover_edit = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withDispatch"])(dispatch => { +/* harmony default export */ var cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withDispatch)(dispatch => { const { toggleSelection, __unstableMarkNextChangeAsNotPersistent - } = dispatch(external_wp_blockEditor_["store"]); + } = dispatch(external_wp_blockEditor_namespaceObject.store); return { toggleSelection, markNextChangeAsNotPersistent: __unstableMarkNextChangeAsNotPersistent }; -}), Object(external_wp_blockEditor_["withColors"])({ +}), (0,external_wp_blockEditor_namespaceObject.withColors)({ overlayColor: 'background-color' -}), external_wp_components_["withNotices"], external_wp_compose_["withInstanceId"]])(CoverEdit)); +}), external_wp_components_namespaceObject.withNotices, external_wp_compose_namespaceObject.withInstanceId])(CoverEdit)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js /** @@ -8079,9 +8030,9 @@ function cover_save_save(_ref) { minHeight: minHeightProp, minHeightUnit } = attributes; - const overlayColorClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayColor); + const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); - const gradientClass = Object(external_wp_blockEditor_["__experimentalGetGradientClass"])(gradient); + const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; @@ -8102,10 +8053,10 @@ function cover_save_save(_ref) { 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); - return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style - }), Object(external_wp_element_["createElement"])("span", { + }), (0,external_wp_element_namespaceObject.createElement)("span", { "aria-hidden": "true", className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, { 'has-background-dim': dimRatio !== undefined, @@ -8113,7 +8064,7 @@ function cover_save_save(_ref) { [gradientClass]: !url && gradientClass }), style: bgStyle - }), isImageBackground && isImgElement && url && Object(external_wp_element_["createElement"])("img", { + }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", { className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, @@ -8122,7 +8073,7 @@ function cover_save_save(_ref) { }, "data-object-fit": "cover", "data-object-position": objectPosition - }), isVideoBackground && url && Object(external_wp_element_["createElement"])("video", { + }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", { className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, @@ -8134,12 +8085,12 @@ function cover_save_save(_ref) { }, "data-object-fit": "cover", "data-object-position": objectPosition - }), Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useInnerBlocksProps"].save({ + }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }))); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js /** * WordPress dependencies */ @@ -8165,7 +8116,7 @@ const cover_transforms_transforms = { anchor, style } = _ref; - return Object(external_wp_blocks_["createBlock"])('core/cover', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { dimRatio: 50, url, alt, @@ -8177,7 +8128,7 @@ const cover_transforms_transforms = { duotone: style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone } } - }, [Object(external_wp_blocks_["createBlock"])('core/paragraph', { + }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: caption, fontSize: 'large' })]); @@ -8193,14 +8144,14 @@ const cover_transforms_transforms = { id, anchor } = _ref2; - return Object(external_wp_blocks_["createBlock"])('core/cover', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { dimRatio: 50, url: src, align, id, backgroundType: VIDEO_BACKGROUND_TYPE, anchor - }, [Object(external_wp_blocks_["createBlock"])('core/paragraph', { + }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: caption, fontSize: 'large' })]); @@ -8236,7 +8187,7 @@ const cover_transforms_transforms = { gradient, style } = _ref4; - return Object(external_wp_blocks_["createBlock"])('core/cover', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { align, anchor, overlayColor: backgroundColor, @@ -8279,7 +8230,7 @@ const cover_transforms_transforms = { anchor, style } = _ref6; - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { caption: title, url, alt, @@ -8322,7 +8273,7 @@ const cover_transforms_transforms = { id, anchor } = _ref8; - return Object(external_wp_blocks_["createBlock"])('core/video', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { caption: title, src: url, id, @@ -8334,7 +8285,7 @@ const cover_transforms_transforms = { }; /* harmony default export */ var cover_transforms = (cover_transforms_transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js /** * WordPress dependencies */ @@ -8456,7 +8407,7 @@ const cover_settings = { name: 'core/paragraph', attributes: { customFontSize: 48, - content: Object(external_wp_i18n_["__"])('Snow Patrol'), + content: (0,external_wp_i18n_namespaceObject.__)('Snow Patrol'), align: 'center' } }] @@ -8467,10 +8418,29 @@ const cover_settings = { deprecated: cover_deprecated }; -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js + 1 modules -var library_edit = __webpack_require__("B9Az"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js + +/** + * WordPress dependencies + */ + +const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z" +})); +/* harmony default export */ var library_pencil = (pencil); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js +/** + * Internal dependencies + */ + +/* harmony default export */ var library_edit = (library_pencil); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js /** @@ -8482,7 +8452,7 @@ var library_edit = __webpack_require__("B9Az"); function getResponsiveHelp(checked) { - return checked ? Object(external_wp_i18n_["__"])('This embed will preserve its aspect ratio when the browser is resized.') : Object(external_wp_i18n_["__"])('This embed may not preserve its aspect ratio when the browser is resized.'); + return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.'); } const EmbedControls = _ref => { @@ -8494,16 +8464,16 @@ const EmbedControls = _ref => { toggleResponsive, switchBackToURLInput } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, showEditButton && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, showEditButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { className: "components-toolbar__control", - label: Object(external_wp_i18n_["__"])('Edit URL'), - icon: library_edit["a" /* default */], + label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'), + icon: library_edit, onClick: switchBackToURLInput - }))), themeSupportsResponsive && blockSupportsResponsive && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Media settings'), + }))), themeSupportsResponsive && blockSupportsResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Media settings'), className: "blocks-responsive" - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Resize for smaller devices'), + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'), checked: allowResponsive, help: getResponsiveHelp, onChange: toggleResponsive @@ -8512,161 +8482,161 @@ const EmbedControls = _ref => { /* harmony default export */ var embed_controls = (EmbedControls); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js /** * WordPress dependencies */ -const embedContentIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedContentIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.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-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z" })); -const embedAudioIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedAudioIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.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-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z" })); -const embedPhotoIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedPhotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.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-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" })); -const embedVideoIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedVideoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.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-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z" })); const embedTwitterIcon = { foreground: '#1da1f2', - src: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" - }, Object(external_wp_element_["createElement"])(external_wp_components_["G"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z" }))) }; const embedYouTubeIcon = { foreground: '#ff0000', - src: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" })) }; const embedFacebookIcon = { foreground: '#3b5998', - src: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z" })) }; -const embedInstagramIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedInstagramIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["G"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z" }))); const embedWordPressIcon = { foreground: '#0073AA', - src: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" - }, Object(external_wp_element_["createElement"])(external_wp_components_["G"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z" }))) }; const embedSpotifyIcon = { foreground: '#1db954', - src: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325" })) }; -const embedFlickrIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedFlickrIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z" })); const embedVimeoIcon = { foreground: '#1ab7ea', - src: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" - }, Object(external_wp_element_["createElement"])(external_wp_components_["G"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z" }))) }; -const embedRedditIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedRedditIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M22 11.816c0-1.256-1.02-2.277-2.277-2.277-.593 0-1.122.24-1.526.613-1.48-.965-3.455-1.594-5.647-1.69l1.17-3.702 3.18.75c.01 1.027.847 1.86 1.877 1.86 1.035 0 1.877-.84 1.877-1.877 0-1.035-.842-1.877-1.877-1.877-.77 0-1.43.466-1.72 1.13L13.55 3.92c-.204-.047-.4.067-.46.26l-1.35 4.27c-2.317.037-4.412.67-5.97 1.67-.402-.355-.917-.58-1.493-.58C3.02 9.54 2 10.56 2 11.815c0 .814.433 1.523 1.078 1.925-.037.222-.06.445-.06.673 0 3.292 4.01 5.97 8.94 5.97s8.94-2.678 8.94-5.97c0-.214-.02-.424-.052-.632.687-.39 1.154-1.12 1.154-1.964zm-3.224-7.422c.606 0 1.1.493 1.1 1.1s-.493 1.1-1.1 1.1-1.1-.494-1.1-1.1.493-1.1 1.1-1.1zm-16 7.422c0-.827.673-1.5 1.5-1.5.313 0 .598.103.838.27-.85.675-1.477 1.478-1.812 2.36-.32-.274-.525-.676-.525-1.13zm9.183 7.79c-4.502 0-8.165-2.33-8.165-5.193S7.457 9.22 11.96 9.22s8.163 2.33 8.163 5.193-3.663 5.193-8.164 5.193zM20.635 13c-.326-.89-.948-1.7-1.797-2.383.247-.186.55-.3.882-.3.827 0 1.5.672 1.5 1.5 0 .482-.23.91-.586 1.184zm-11.64 1.704c-.76 0-1.397-.616-1.397-1.376 0-.76.636-1.397 1.396-1.397.76 0 1.376.638 1.376 1.398 0 .76-.616 1.376-1.376 1.376zm7.405-1.376c0 .76-.615 1.376-1.375 1.376s-1.4-.616-1.4-1.376c0-.76.64-1.397 1.4-1.397.76 0 1.376.638 1.376 1.398zm-1.17 3.38c.15.152.15.398 0 .55-.675.674-1.728 1.002-3.22 1.002l-.01-.002-.012.002c-1.492 0-2.544-.328-3.218-1.002-.152-.152-.152-.398 0-.55.152-.152.4-.15.55 0 .52.52 1.394.775 2.67.775l.01.002.01-.002c1.276 0 2.15-.253 2.67-.775.15-.152.398-.152.55 0z" })); const embedTumblrIcon = { foreground: '#35465c', - src: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z" })) }; -const embedAmazonIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedAmazonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z" })); -const embedAnimotoIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedAnimotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z", fill: "#4bc7ee" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z", fill: "#d4cdcb" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z", fill: "#c3d82e" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z", fill: "#e4ecb0" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z", fill: "#209dbd" -}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z", fill: "#7cb3c9" })); -const embedDailymotionIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedDailymotionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z", fill: "#333436" })); -const embedPinterestIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedPinterestIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" })); -const embedWolframIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { +const embedWolframIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 44 44" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z" })); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js /** @@ -8675,13 +8645,13 @@ const embedWolframIcon = Object(external_wp_element_["createElement"])(external_ -const EmbedLoading = () => Object(external_wp_element_["createElement"])("div", { +const EmbedLoading = () => (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-embed is-loading" -}, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Embedding…'))); +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Embedding…'))); /* harmony default export */ var embed_loading = (EmbedLoading); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js /** @@ -8702,46 +8672,46 @@ const EmbedPlaceholder = _ref => { fallback, tryAgain } = _ref; - return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], { - icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: icon, showColors: true }), label: label, className: "wp-block-embed", - instructions: Object(external_wp_i18n_["__"])('Paste a link to the content you want to display on your site.') - }, Object(external_wp_element_["createElement"])("form", { + instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.') + }, (0,external_wp_element_namespaceObject.createElement)("form", { onSubmit: onSubmit - }, Object(external_wp_element_["createElement"])("input", { + }, (0,external_wp_element_namespaceObject.createElement)("input", { type: "url", value: value || '', className: "components-placeholder__input", "aria-label": label, - placeholder: Object(external_wp_i18n_["__"])('Enter URL to embed here…'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'), onChange: onChange - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit" - }, Object(external_wp_i18n_["_x"])('Embed', 'button label'))), Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label'))), (0,external_wp_element_namespaceObject.createElement)("div", { className: "components-placeholder__learn-more" - }, Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { - href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/embeds/') - }, Object(external_wp_i18n_["__"])('Learn more about embeds'))), cannotEmbed && Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { + href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/embeds/') + }, (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds'))), cannotEmbed && (0,external_wp_element_namespaceObject.createElement)("div", { className: "components-placeholder__error" - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "components-placeholder__instructions" - }, Object(external_wp_i18n_["__"])('Sorry, this content could not be embedded.')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + }, (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { variant: "secondary", onClick: tryAgain - }, Object(external_wp_i18n_["_x"])('Try again', 'button label')), ' ', Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + }, (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { variant: "secondary", onClick: fallback - }, Object(external_wp_i18n_["_x"])('Convert to link', 'button label')))); + }, (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label')))); }; /* harmony default export */ var embed_placeholder = (EmbedPlaceholder); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js @@ -8762,8 +8732,8 @@ function WpEmbedPreview(_ref) { let { html } = _ref; - const ref = Object(external_wp_element_["useRef"])(); - const props = Object(external_wp_element_["useMemo"])(() => { + const ref = (0,external_wp_element_namespaceObject.useRef)(); + const props = (0,external_wp_element_namespaceObject.useMemo)(() => { const doc = new window.DOMParser().parseFromString(html, 'text/html'); const iframe = doc.querySelector('iframe'); const iframeProps = {}; @@ -8778,7 +8748,7 @@ function WpEmbedPreview(_ref) { }); return iframeProps; }, [html]); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { const { ownerDocument } = ref.current; @@ -8822,15 +8792,15 @@ function WpEmbedPreview(_ref) { defaultView.removeEventListener('message', resizeWPembeds); }; }, []); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-embed__wrapper" - }, Object(external_wp_element_["createElement"])("iframe", Object(esm_extends["a" /* default */])({ - ref: Object(external_wp_compose_["useMergeRefs"])([ref, Object(external_wp_compose_["useFocusableIframe"])()]), + }, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({ + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]), title: props.title }, props))); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js /** @@ -8857,7 +8827,7 @@ function WpEmbedPreview(_ref) { -class embed_preview_EmbedPreview extends external_wp_element_["Component"] { +class EmbedPreview extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.hideOverlay = this.hideOverlay.bind(this); @@ -8913,63 +8883,63 @@ class embed_preview_EmbedPreview extends external_wp_element_["Component"] { const html = 'photo' === type ? getPhotoHtml(preview) : preview.html; const parsedHost = new URL(url).host.split('.'); const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.'); - const iframeTitle = Object(external_wp_i18n_["sprintf"])( // translators: %s: host providing embed content e.g: www.youtube.com - Object(external_wp_i18n_["__"])('Embedded content from %s'), parsedHostBaseUrl); + const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com + (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl); const sandboxClassnames = dedupe_default()(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality // as far as the user is concerned. We're just catching the first click so that // the block can be selected without interacting with the embed preview that the overlay covers. /* eslint-disable jsx-a11y/no-static-element-interactions */ - const embedWrapper = 'wp-embed' === type ? Object(external_wp_element_["createElement"])(WpEmbedPreview, { + const embedWrapper = 'wp-embed' === type ? (0,external_wp_element_namespaceObject.createElement)(WpEmbedPreview, { html: html - }) : Object(external_wp_element_["createElement"])("div", { + }) : (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-embed__wrapper" - }, Object(external_wp_element_["createElement"])(external_wp_components_["SandBox"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, { html: html, scripts: scripts, title: iframeTitle, type: sandboxClassnames, onFocus: this.hideOverlay - }), !interactive && Object(external_wp_element_["createElement"])("div", { + }), !interactive && (0,external_wp_element_namespaceObject.createElement)("div", { className: "block-library-embed__interactive-overlay", onMouseUp: this.hideOverlay })); /* eslint-enable jsx-a11y/no-static-element-interactions */ - return Object(external_wp_element_["createElement"])("figure", { + return (0,external_wp_element_namespaceObject.createElement)("figure", { className: dedupe_default()(className, 'wp-block-embed', { 'is-type-video': 'video' === type }) - }, previewable ? embedWrapper : Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], { - icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { + }, previewable ? embedWrapper : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: icon, showColors: true }), label: label - }, Object(external_wp_element_["createElement"])("p", { + }, (0,external_wp_element_namespaceObject.createElement)("p", { className: "components-placeholder__error" - }, Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("a", { href: url - }, url)), Object(external_wp_element_["createElement"])("p", { + }, url)), (0,external_wp_element_namespaceObject.createElement)("p", { className: "components-placeholder__error" - }, Object(external_wp_i18n_["sprintf"])( + }, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: host providing embed content e.g: www.youtube.com */ - Object(external_wp_i18n_["__"])("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl))), (!external_wp_blockEditor_["RichText"].isEmpty(caption) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { + (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl))), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "figcaption", - placeholder: Object(external_wp_i18n_["__"])('Add caption'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'), value: caption, onChange: onCaptionChange, inlineToolbar: true, - __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph')) + __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')) })); } } -/* harmony default export */ var embed_preview = (embed_preview_EmbedPreview); +/* harmony default export */ var embed_preview = (EmbedPreview); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js /** @@ -9013,24 +8983,24 @@ const EmbedEdit = props => { onFocus } = props; const defaultEmbedInfo = { - title: Object(external_wp_i18n_["_x"])('Embed', 'block title'), + title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'), icon: embedContentIcon }; const { icon, title } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo; - const [url, setURL] = Object(external_wp_element_["useState"])(attributesUrl); - const [isEditingURL, setIsEditingURL] = Object(external_wp_element_["useState"])(false); + const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl); + const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); const { invalidateResolution - } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { preview, fetching, themeSupportsResponsive, cannotEmbed - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _embedPreview$data; const { @@ -9038,7 +9008,7 @@ const EmbedEdit = props => { isPreviewEmbedFallback, isRequestingEmbedPreview, getThemeSupports - } = select(external_wp_coreData_["store"]); + } = select(external_wp_coreData_namespaceObject.store); if (!attributesUrl) { return { @@ -9092,7 +9062,7 @@ const EmbedEdit = props => { }); }; - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!(preview !== null && preview !== void 0 && preview.html) || !cannotEmbed || fetching) { return; } // At this stage, we're not fetching the preview and know it can't be embedded, @@ -9107,7 +9077,7 @@ const EmbedEdit = props => { }); }, [preview === null || preview === void 0 ? void 0 : preview.html, attributesUrl]); // Handle incoming preview - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { if (preview && !isEditingURL) { // Even though we set attributes that get derived from the preview, // we don't access them directly because for the initial render, @@ -9128,19 +9098,19 @@ const EmbedEdit = props => { } } }, [preview, isEditingURL]); - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); if (fetching) { - return Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], blockProps, Object(external_wp_element_["createElement"])(embed_loading, null)); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_loading, null)); } // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists - const label = Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button. + const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button. const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL; if (showEmbedPlaceholder) { - return Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], blockProps, Object(external_wp_element_["createElement"])(embed_placeholder, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_placeholder, { icon: icon, label: label, onFocus: onFocus, @@ -9157,7 +9127,7 @@ const EmbedEdit = props => { value: url, cannotEmbed: cannotEmbed, onChange: event => setURL(event.target.value), - fallback: () => util_fallback(url, onReplace), + fallback: () => fallback(url, onReplace), tryAgain: () => { invalidateResolution('getEmbedPreview', [url]); } @@ -9179,14 +9149,14 @@ const EmbedEdit = props => { className: classFromPreview } = getMergedAttributes(); const className = classnames_default()(classFromPreview, props.className); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(embed_controls, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(embed_controls, { showEditButton: preview && !cannotEmbed, themeSupportsResponsive: themeSupportsResponsive, blockSupportsResponsive: responsive, allowResponsive: allowResponsive, toggleResponsive: toggleResponsive, switchBackToURLInput: () => setIsEditingURL(true) - }), Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], blockProps, Object(external_wp_element_["createElement"])(embed_preview, { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_preview, { preview: preview, previewable: previewable, className: className, @@ -9205,7 +9175,7 @@ const EmbedEdit = props => { /* harmony default export */ var embed_edit = (EmbedEdit); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js /** @@ -9237,19 +9207,19 @@ function embed_save_save(_ref) { [`is-provider-${providerNameSlug}`]: providerNameSlug, [`wp-block-embed-${providerNameSlug}`]: providerNameSlug }); - return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className - }), Object(external_wp_element_["createElement"])("div", { + }), (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-embed__wrapper" }, `\n${url}\n` /* URL needs to be on its own line. */ - ), !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + ), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js /** * WordPress dependencies */ @@ -9315,7 +9285,7 @@ const embed_transforms_transforms = { return node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && ((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : (_node$textContent$mat = _node$textContent.match(/https/gi)) === null || _node$textContent$mat === void 0 ? void 0 : _node$textContent$mat.length) === 1; }, transform: node => { - return Object(external_wp_blocks_["createBlock"])(EMBED_BLOCK, { + return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, { url: node.textContent.trim() }); } @@ -9340,7 +9310,7 @@ const embed_transforms_transforms = { value += `
${caption}`; } - return Object(external_wp_blocks_["createBlock"])('core/paragraph', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: value }); } @@ -9348,7 +9318,7 @@ const embed_transforms_transforms = { }; /* harmony default export */ var embed_transforms = (embed_transforms_transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js /** * WordPress dependencies */ @@ -9366,12 +9336,12 @@ const embed_transforms_transforms = { * @type {WPBlockVariation[]} */ -const embed_variations_variations = [{ +const variations_variations = [{ name: 'twitter', title: 'Twitter', icon: embedTwitterIcon, - keywords: ['tweet', Object(external_wp_i18n_["__"])('social')], - description: Object(external_wp_i18n_["__"])('Embed a tweet.'), + keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'), patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i], attributes: { providerNameSlug: 'twitter', @@ -9381,8 +9351,8 @@ const embed_variations_variations = [{ name: 'youtube', title: 'YouTube', icon: embedYouTubeIcon, - keywords: [Object(external_wp_i18n_["__"])('music'), Object(external_wp_i18n_["__"])('video')], - description: Object(external_wp_i18n_["__"])('Embed a YouTube video.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'), patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i], attributes: { providerNameSlug: 'youtube', @@ -9394,8 +9364,8 @@ const embed_variations_variations = [{ name: 'facebook', title: 'Facebook', icon: embedFacebookIcon, - keywords: [Object(external_wp_i18n_["__"])('social')], - description: Object(external_wp_i18n_["__"])('Embed a Facebook post.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'), scope: ['block'], patterns: [], attributes: { @@ -9409,8 +9379,8 @@ const embed_variations_variations = [{ name: 'instagram', title: 'Instagram', icon: embedInstagramIcon, - keywords: [Object(external_wp_i18n_["__"])('image'), Object(external_wp_i18n_["__"])('social')], - description: Object(external_wp_i18n_["__"])('Embed an Instagram post.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'), scope: ['block'], patterns: [], attributes: { @@ -9421,8 +9391,8 @@ const embed_variations_variations = [{ name: 'wordpress', title: 'WordPress', icon: embedWordPressIcon, - keywords: [Object(external_wp_i18n_["__"])('post'), Object(external_wp_i18n_["__"])('blog')], - description: Object(external_wp_i18n_["__"])('Embed a WordPress post.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'), attributes: { providerNameSlug: 'wordpress' } @@ -9430,8 +9400,8 @@ const embed_variations_variations = [{ name: 'soundcloud', title: 'SoundCloud', icon: embedAudioIcon, - keywords: [Object(external_wp_i18n_["__"])('music'), Object(external_wp_i18n_["__"])('audio')], - description: Object(external_wp_i18n_["__"])('Embed SoundCloud content.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'), patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i], attributes: { providerNameSlug: 'soundcloud', @@ -9441,8 +9411,8 @@ const embed_variations_variations = [{ name: 'spotify', title: 'Spotify', icon: embedSpotifyIcon, - keywords: [Object(external_wp_i18n_["__"])('music'), Object(external_wp_i18n_["__"])('audio')], - description: Object(external_wp_i18n_["__"])('Embed Spotify content.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'), patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i], attributes: { providerNameSlug: 'spotify', @@ -9452,8 +9422,8 @@ const embed_variations_variations = [{ name: 'flickr', title: 'Flickr', icon: embedFlickrIcon, - keywords: [Object(external_wp_i18n_["__"])('image')], - description: Object(external_wp_i18n_["__"])('Embed Flickr content.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('image')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'), patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i], attributes: { providerNameSlug: 'flickr', @@ -9463,8 +9433,8 @@ const embed_variations_variations = [{ name: 'vimeo', title: 'Vimeo', icon: embedVimeoIcon, - keywords: [Object(external_wp_i18n_["__"])('video')], - description: Object(external_wp_i18n_["__"])('Embed a Vimeo video.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'), patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i], attributes: { providerNameSlug: 'vimeo', @@ -9474,7 +9444,7 @@ const embed_variations_variations = [{ name: 'animoto', title: 'Animoto', icon: embedAnimotoIcon, - description: Object(external_wp_i18n_["__"])('Embed an Animoto video.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'), patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i], attributes: { providerNameSlug: 'animoto', @@ -9484,7 +9454,7 @@ const embed_variations_variations = [{ name: 'cloudup', title: 'Cloudup', icon: embedContentIcon, - description: Object(external_wp_i18n_["__"])('Embed Cloudup content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'), patterns: [/^https?:\/\/cloudup\.com\/.+/i], attributes: { providerNameSlug: 'cloudup', @@ -9495,7 +9465,7 @@ const embed_variations_variations = [{ name: 'collegehumor', title: 'CollegeHumor', icon: embedVideoIcon, - description: Object(external_wp_i18n_["__"])('Embed CollegeHumor content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'), scope: ['block'], patterns: [], attributes: { @@ -9506,8 +9476,8 @@ const embed_variations_variations = [{ name: 'crowdsignal', title: 'Crowdsignal', icon: embedContentIcon, - keywords: ['polldaddy', Object(external_wp_i18n_["__"])('survey')], - description: Object(external_wp_i18n_["__"])('Embed Crowdsignal (formerly Polldaddy) content.'), + keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'), patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i], attributes: { providerNameSlug: 'crowdsignal', @@ -9517,8 +9487,8 @@ const embed_variations_variations = [{ name: 'dailymotion', title: 'Dailymotion', icon: embedDailymotionIcon, - keywords: [Object(external_wp_i18n_["__"])('video')], - description: Object(external_wp_i18n_["__"])('Embed a Dailymotion video.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'), patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i], attributes: { providerNameSlug: 'dailymotion', @@ -9528,7 +9498,7 @@ const embed_variations_variations = [{ name: 'imgur', title: 'Imgur', icon: embedPhotoIcon, - description: Object(external_wp_i18n_["__"])('Embed Imgur content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'), patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i], attributes: { providerNameSlug: 'imgur', @@ -9538,7 +9508,7 @@ const embed_variations_variations = [{ name: 'issuu', title: 'Issuu', icon: embedContentIcon, - description: Object(external_wp_i18n_["__"])('Embed Issuu content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'), patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i], attributes: { providerNameSlug: 'issuu', @@ -9548,7 +9518,7 @@ const embed_variations_variations = [{ name: 'kickstarter', title: 'Kickstarter', icon: embedContentIcon, - description: Object(external_wp_i18n_["__"])('Embed Kickstarter content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'), patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i], attributes: { providerNameSlug: 'kickstarter', @@ -9558,8 +9528,8 @@ const embed_variations_variations = [{ name: 'mixcloud', title: 'Mixcloud', icon: embedAudioIcon, - keywords: [Object(external_wp_i18n_["__"])('music'), Object(external_wp_i18n_["__"])('audio')], - description: Object(external_wp_i18n_["__"])('Embed Mixcloud content.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'), patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i], attributes: { providerNameSlug: 'mixcloud', @@ -9569,7 +9539,7 @@ const embed_variations_variations = [{ name: 'reddit', title: 'Reddit', icon: embedRedditIcon, - description: Object(external_wp_i18n_["__"])('Embed a Reddit thread.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'), patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i], attributes: { providerNameSlug: 'reddit', @@ -9579,7 +9549,7 @@ const embed_variations_variations = [{ name: 'reverbnation', title: 'ReverbNation', icon: embedAudioIcon, - description: Object(external_wp_i18n_["__"])('Embed ReverbNation content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'), patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i], attributes: { providerNameSlug: 'reverbnation', @@ -9589,7 +9559,7 @@ const embed_variations_variations = [{ name: 'screencast', title: 'Screencast', icon: embedVideoIcon, - description: Object(external_wp_i18n_["__"])('Embed Screencast content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'), patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i], attributes: { providerNameSlug: 'screencast', @@ -9599,7 +9569,7 @@ const embed_variations_variations = [{ name: 'scribd', title: 'Scribd', icon: embedContentIcon, - description: Object(external_wp_i18n_["__"])('Embed Scribd content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'), patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i], attributes: { providerNameSlug: 'scribd', @@ -9609,7 +9579,7 @@ const embed_variations_variations = [{ name: 'slideshare', title: 'Slideshare', icon: embedContentIcon, - description: Object(external_wp_i18n_["__"])('Embed Slideshare content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Slideshare content.'), patterns: [/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i], attributes: { providerNameSlug: 'slideshare', @@ -9619,7 +9589,7 @@ const embed_variations_variations = [{ name: 'smugmug', title: 'SmugMug', icon: embedPhotoIcon, - description: Object(external_wp_i18n_["__"])('Embed SmugMug content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'), patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i], attributes: { providerNameSlug: 'smugmug', @@ -9630,7 +9600,7 @@ const embed_variations_variations = [{ name: 'speaker-deck', title: 'Speaker Deck', icon: embedContentIcon, - description: Object(external_wp_i18n_["__"])('Embed Speaker Deck content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'), patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i], attributes: { providerNameSlug: 'speaker-deck', @@ -9640,8 +9610,8 @@ const embed_variations_variations = [{ name: 'tiktok', title: 'TikTok', icon: embedVideoIcon, - keywords: [Object(external_wp_i18n_["__"])('video')], - description: Object(external_wp_i18n_["__"])('Embed a TikTok video.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'), patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i], attributes: { providerNameSlug: 'tiktok', @@ -9651,7 +9621,7 @@ const embed_variations_variations = [{ name: 'ted', title: 'TED', icon: embedVideoIcon, - description: Object(external_wp_i18n_["__"])('Embed a TED video.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'), patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i], attributes: { providerNameSlug: 'ted', @@ -9661,8 +9631,8 @@ const embed_variations_variations = [{ name: 'tumblr', title: 'Tumblr', icon: embedTumblrIcon, - keywords: [Object(external_wp_i18n_["__"])('social')], - description: Object(external_wp_i18n_["__"])('Embed a Tumblr post.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'), patterns: [/^https?:\/\/(www\.)?tumblr\.com\/.+/i], attributes: { providerNameSlug: 'tumblr', @@ -9672,8 +9642,8 @@ const embed_variations_variations = [{ name: 'videopress', title: 'VideoPress', icon: embedVideoIcon, - keywords: [Object(external_wp_i18n_["__"])('video')], - description: Object(external_wp_i18n_["__"])('Embed a VideoPress video.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'), patterns: [/^https?:\/\/videopress\.com\/.+/i], attributes: { providerNameSlug: 'videopress', @@ -9683,7 +9653,7 @@ const embed_variations_variations = [{ name: 'wordpress-tv', title: 'WordPress.tv', icon: embedVideoIcon, - description: Object(external_wp_i18n_["__"])('Embed a WordPress.tv video.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'), patterns: [/^https?:\/\/wordpress\.tv\/.+/i], attributes: { providerNameSlug: 'wordpress-tv', @@ -9693,8 +9663,8 @@ const embed_variations_variations = [{ name: 'amazon-kindle', title: 'Amazon Kindle', icon: embedAmazonIcon, - keywords: [Object(external_wp_i18n_["__"])('ebook')], - description: Object(external_wp_i18n_["__"])('Embed Amazon Kindle content.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'), patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i], attributes: { providerNameSlug: 'amazon-kindle' @@ -9703,8 +9673,8 @@ const embed_variations_variations = [{ name: 'pinterest', title: 'Pinterest', icon: embedPinterestIcon, - keywords: [Object(external_wp_i18n_["__"])('social'), Object(external_wp_i18n_["__"])('bookmark')], - description: Object(external_wp_i18n_["__"])('Embed Pinterest pins, boards, and profiles.'), + keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')], + description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'), patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i], attributes: { providerNameSlug: 'pinterest' @@ -9713,7 +9683,7 @@ const embed_variations_variations = [{ name: 'wolfram-cloud', title: 'Wolfram Cloud', icon: embedWolframIcon, - description: Object(external_wp_i18n_["__"])('Embed Wolfram Cloud notebook content.'), + description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram Cloud notebook content.'), patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i], attributes: { providerNameSlug: 'wolfram-cloud', @@ -9726,14 +9696,14 @@ const embed_variations_variations = [{ * Block by providing its attributes. */ -embed_variations_variations.forEach(variation => { +variations_variations.forEach(variation => { if (variation.isActive) return; variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug; }); -/* harmony default export */ var embed_variations = (embed_variations_variations); +/* harmony default export */ var embed_variations = (variations_variations); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js /** @@ -9814,11 +9784,11 @@ const embed_deprecated_deprecated = [{ [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug }); - return Object(external_wp_element_["createElement"])("figure", { + return (0,external_wp_element_namespaceObject.createElement)("figure", { className: embedClassName }, `\n${url}\n` /* URL needs to be on its own line. */ - , !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + , !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })); @@ -9827,7 +9797,7 @@ const embed_deprecated_deprecated = [{ }]; /* harmony default export */ var embed_deprecated = (embed_deprecated_deprecated); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js /** * Internal dependencies */ @@ -9891,22 +9861,22 @@ const embed_settings = { deprecated: embed_deprecated }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js /** * WordPress dependencies */ -const file_file = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const file = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z" })); -/* harmony default export */ var library_file = (file_file); +/* harmony default export */ var library_file = (file); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js /** @@ -9976,10 +9946,10 @@ const file_deprecated_deprecated = [{ displayPreview, previewHeight } = attributes; - const pdfEmbedLabel = external_wp_blockEditor_["RichText"].isEmpty(fileName) ? Object(external_wp_i18n_["__"])('PDF embed') : Object(external_wp_i18n_["sprintf"])( + const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ - Object(external_wp_i18n_["__"])('Embed of %s.'), fileName); - return href && Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save(), displayPreview && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("object", { + (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); + return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", @@ -9988,17 +9958,17 @@ const file_deprecated_deprecated = [{ height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel - })), !external_wp_blockEditor_["RichText"].isEmpty(fileName) && Object(external_wp_element_["createElement"])("a", { + })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_wp_element_namespaceObject.createElement)("a", { href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName - })), showDownloadButton && Object(external_wp_element_["createElement"])("a", { + })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", { href: href, className: "wp-block-file__button", download: true - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }))); } @@ -10006,10 +9976,9 @@ const file_deprecated_deprecated = [{ }]; /* harmony default export */ var file_deprecated = (file_deprecated_deprecated); -// EXTERNAL MODULE: external ["wp","notices"] -var external_wp_notices_ = __webpack_require__("onLe"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js +;// CONCATENATED MODULE: external ["wp","notices"] +var external_wp_notices_namespaceObject = window["wp"]["notices"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js /** @@ -10043,53 +10012,53 @@ function FileBlockInspector(_ref) { } = hrefs; let linkDestinationOptions = [{ value: href, - label: Object(external_wp_i18n_["__"])('URL') + label: (0,external_wp_i18n_namespaceObject.__)('URL') }]; if (attachmentPage) { linkDestinationOptions = [{ value: href, - label: Object(external_wp_i18n_["__"])('Media file') + label: (0,external_wp_i18n_namespaceObject.__)('Media file') }, { value: attachmentPage, - label: Object(external_wp_i18n_["__"])('Attachment page') + label: (0,external_wp_i18n_namespaceObject.__)('Attachment page') }]; } - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, href.endsWith('.pdf') && Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('PDF settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Show inline embed'), - help: displayPreview ? Object(external_wp_i18n_["__"])("Note: Most phone and tablet browsers won't display embedded PDFs.") : null, + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, href.endsWith('.pdf') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('PDF settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'), + help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null, checked: !!displayPreview, onChange: changeDisplayPreview - }), displayPreview && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], { - label: Object(external_wp_i18n_["__"])('Height in pixels'), + }), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'), min: MIN_PREVIEW_HEIGHT, max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight), value: previewHeight, onChange: changePreviewHeight - })), Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Text link settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["__"])('Link to'), + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Text link settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Link to'), value: textLinkHref, options: linkDestinationOptions, onChange: changeLinkDestinationOption - }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Open in new tab'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), checked: openInNewWindow, onChange: changeOpenInNewWindow - })), Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Download button settings') - }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Show download button'), + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Download button settings') + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Show download button'), checked: showDownloadButton, onChange: changeShowDownloadButton })))); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js /** * Uses a combination of user agent matching and feature detection to determine whether * the current browser supports rendering PDFs inline. @@ -10153,7 +10122,7 @@ const hidePdfEmbedsOnUnsupportedBrowsers = () => { } }; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js /** @@ -10190,18 +10159,18 @@ function ClipboardToolbarButton(_ref) { } = _ref; const { createNotice - } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]); - const ref = Object(external_wp_compose_["useCopyToClipboard"])(text, () => { - createNotice('info', Object(external_wp_i18n_["__"])('Copied URL to clipboard.'), { + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => { + createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), { isDismissible: true, type: 'snackbar' }); }); - return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { className: "components-clipboard-toolbar-button", ref: ref, disabled: disabled - }, Object(external_wp_i18n_["__"])('Copy URL')); + }, (0,external_wp_i18n_namespaceObject.__)('Copy URL')); } function FileEdit(_ref2) { @@ -10224,21 +10193,21 @@ function FileEdit(_ref2) { displayPreview, previewHeight } = attributes; - const [hasError, setHasError] = Object(external_wp_element_["useState"])(false); + const [hasError, setHasError] = (0,external_wp_element_namespaceObject.useState)(false); const { media, mediaUpload - } = Object(external_wp_data_["useSelect"])(select => ({ - media: id === undefined ? undefined : select(external_wp_coreData_["store"]).getMedia(id), - mediaUpload: select(external_wp_blockEditor_["store"]).getSettings().mediaUpload + } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ + media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id), + mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload }), [id]); const { toggleSelection - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); - Object(external_wp_element_["useEffect"])(() => { + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + (0,external_wp_element_namespaceObject.useEffect)(() => { // Upload a file drag-and-dropped into the editor - if (Object(external_wp_blob_["isBlobURL"])(href)) { - const file = Object(external_wp_blob_["getBlobByURL"])(href); + if ((0,external_wp_blob_namespaceObject.isBlobURL)(href)) { + const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(href); mediaUpload({ filesList: [file], onFileChange: _ref3 => { @@ -10250,14 +10219,14 @@ function FileEdit(_ref2) { noticeOperations.createErrorNotice(message); } }); - Object(external_wp_blob_["revokeBlobURL"])(href); + (0,external_wp_blob_namespaceObject.revokeBlobURL)(href); } if (downloadButtonText === undefined) { - changeDownloadButtonText(Object(external_wp_i18n_["_x"])('Download', 'button label')); + changeDownloadButtonText((0,external_wp_i18n_namespaceObject._x)('Download', 'button label')); } }, []); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { // Add a unique fileId to each file block setAttributes({ fileId: `wp-block-file--media-${clientId}` @@ -10333,23 +10302,23 @@ function FileEdit(_ref2) { } const attachmentPage = media && media.link; - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ - className: classnames_default()(Object(external_wp_blob_["isBlobURL"])(href) && Object(external_wp_components_["__unstableGetAnimateClassName"])({ + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ + className: classnames_default()((0,external_wp_blob_namespaceObject.isBlobURL)(href) && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({ type: 'loading' }), { - 'is-transient': Object(external_wp_blob_["isBlobURL"])(href) + 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(href) }) }); const displayPreviewInEditor = browserSupportsPdfs() && displayPreview; if (!href || hasError) { - return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], { - icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { + return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { + icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_file }), labels: { - title: Object(external_wp_i18n_["__"])('File'), - instructions: Object(external_wp_i18n_["__"])('Upload a file or pick one from your media library.') + title: (0,external_wp_i18n_namespaceObject.__)('File'), + instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a file or pick one from your media library.') }, onSelect: onSelectFile, notices: noticeUI, @@ -10358,7 +10327,7 @@ function FileEdit(_ref2) { })); } - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(FileBlockInspector, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(FileBlockInspector, { hrefs: { href, textLinkHref, @@ -10373,18 +10342,18 @@ function FileEdit(_ref2) { changeDisplayPreview, previewHeight, changePreviewHeight - }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaReplaceFlow"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: href, accept: "*", onSelect: onSelectFile, onError: onUploadError - }), Object(external_wp_element_["createElement"])(ClipboardToolbarButton, { + }), (0,external_wp_element_namespaceObject.createElement)(ClipboardToolbarButton, { text: href, - disabled: Object(external_wp_blob_["isBlobURL"])(href) - })), Object(external_wp_element_["createElement"])("div", blockProps, displayPreviewInEditor && Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], { + disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href) + })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayPreviewInEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { size: { height: previewHeight }, @@ -10405,41 +10374,41 @@ function FileEdit(_ref2) { onResizeStart: () => toggleSelection(false), onResizeStop: handleOnResizeStop, showHandle: isSelected - }, Object(external_wp_element_["createElement"])("object", { + }, (0,external_wp_element_namespaceObject.createElement)("object", { className: "wp-block-file__preview", data: href, type: "application/pdf", - "aria-label": Object(external_wp_i18n_["__"])('Embed of the selected PDF file.') - }), !isSelected && Object(external_wp_element_["createElement"])("div", { + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.') + }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-file__preview-overlay" - })), Object(external_wp_element_["createElement"])("div", { + })), (0,external_wp_element_namespaceObject.createElement)("div", { className: 'wp-block-file__content-wrapper' - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "a", value: fileName, - placeholder: Object(external_wp_i18n_["__"])('Write file name…'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'), withoutInteractiveFormatting: true, onChange: text => setAttributes({ fileName: text }), href: textLinkHref - }), showDownloadButton && Object(external_wp_element_["createElement"])("div", { + }), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("div", { className: 'wp-block-file__button-richtext-wrapper' - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "div" // must be block-level or else cursor disappears , - "aria-label": Object(external_wp_i18n_["__"])('Download button text'), + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'), className: 'wp-block-file__button', value: downloadButtonText, withoutInteractiveFormatting: true, - placeholder: Object(external_wp_i18n_["__"])('Add text…'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'), onChange: text => changeDownloadButtonText(text) }))))); } -/* harmony default export */ var file_edit = (Object(external_wp_components_["withNotices"])(FileEdit)); +/* harmony default export */ var file_edit = ((0,external_wp_components_namespaceObject.withNotices)(FileEdit)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js /** @@ -10462,10 +10431,10 @@ function file_save_save(_ref) { displayPreview, previewHeight } = attributes; - const pdfEmbedLabel = external_wp_blockEditor_["RichText"].isEmpty(fileName) ? Object(external_wp_i18n_["__"])('PDF embed') : Object(external_wp_i18n_["sprintf"])( + const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ - Object(external_wp_i18n_["__"])('Embed of %s.'), fileName); - return href && Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save(), displayPreview && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("object", { + (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); + return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", @@ -10474,27 +10443,26 @@ function file_save_save(_ref) { height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel - })), !external_wp_blockEditor_["RichText"].isEmpty(fileName) && Object(external_wp_element_["createElement"])("a", { + })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_wp_element_namespaceObject.createElement)("a", { id: fileId, href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName - })), showDownloadButton && Object(external_wp_element_["createElement"])("a", { + })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", { href: href, className: "wp-block-file__button", download: true, "aria-describedby": fileId - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }))); } -// EXTERNAL MODULE: external ["wp","url"] -var external_wp_url_ = __webpack_require__("Mmq9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js +;// CONCATENATED MODULE: external ["wp","url"] +var external_wp_url_namespaceObject = window["wp"]["url"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js /** * External dependencies */ @@ -10522,9 +10490,9 @@ const file_transforms_transforms = { transform: files => { const blocks = []; files.forEach(file => { - const blobURL = Object(external_wp_blob_["createBlobURL"])(file); // File will be uploaded in componentDidMount() + const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount() - blocks.push(Object(external_wp_blocks_["createBlock"])('core/file', { + blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: blobURL, fileName: file.name, textLinkHref: blobURL @@ -10536,7 +10504,7 @@ const file_transforms_transforms = { type: 'block', blocks: ['core/audio'], transform: attributes => { - return Object(external_wp_blocks_["createBlock"])('core/file', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.src, fileName: attributes.caption, textLinkHref: attributes.src, @@ -10548,7 +10516,7 @@ const file_transforms_transforms = { type: 'block', blocks: ['core/video'], transform: attributes => { - return Object(external_wp_blocks_["createBlock"])('core/file', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.src, fileName: attributes.caption, textLinkHref: attributes.src, @@ -10560,9 +10528,9 @@ const file_transforms_transforms = { type: 'block', blocks: ['core/image'], transform: attributes => { - return Object(external_wp_blocks_["createBlock"])('core/file', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.url, - fileName: attributes.caption || Object(external_wp_url_["getFilename"])(attributes.url), + fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url), textLinkHref: attributes.url, id: attributes.id, anchor: attributes.anchor @@ -10583,12 +10551,12 @@ const file_transforms_transforms = { const { getMedia - } = Object(external_wp_data_["select"])(external_wp_coreData_["store"]); + } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); - return !!media && Object(external_lodash_["includes"])(media.mime_type, 'audio'); + return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'audio'); }, transform: attributes => { - return Object(external_wp_blocks_["createBlock"])('core/audio', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { src: attributes.href, caption: attributes.fileName, id: attributes.id, @@ -10609,12 +10577,12 @@ const file_transforms_transforms = { const { getMedia - } = Object(external_wp_data_["select"])(external_wp_coreData_["store"]); + } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); - return !!media && Object(external_lodash_["includes"])(media.mime_type, 'video'); + return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'video'); }, transform: attributes => { - return Object(external_wp_blocks_["createBlock"])('core/video', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { src: attributes.href, caption: attributes.fileName, id: attributes.id, @@ -10635,12 +10603,12 @@ const file_transforms_transforms = { const { getMedia - } = Object(external_wp_data_["select"])(external_wp_coreData_["store"]); + } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); - return !!media && Object(external_lodash_["includes"])(media.mime_type, 'image'); + return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'image'); }, transform: attributes => { - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { url: attributes.href, caption: attributes.fileName, id: attributes.id, @@ -10651,7 +10619,7 @@ const file_transforms_transforms = { }; /* harmony default export */ var file_transforms = (file_transforms_transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js /** * WordPress dependencies */ @@ -10737,7 +10705,7 @@ const file_settings = { example: { attributes: { href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg', - fileName: Object(external_wp_i18n_["_x"])('Armstrong_Small_Step', 'Name of the file') + fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file') } }, transforms: file_transforms, @@ -10746,29 +10714,29 @@ const file_settings = { save: file_save_save }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js /** * WordPress dependencies */ -const gallery = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const gallery = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z" })); /* harmony default export */ var library_gallery = (gallery); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js const LINK_DESTINATION_NONE = 'none'; const LINK_DESTINATION_MEDIA = 'media'; const LINK_DESTINATION_ATTACHMENT = 'attachment'; const LINK_DESTINATION_MEDIA_WP_CORE = 'file'; const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post'; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js /** * External dependencies */ @@ -10778,9 +10746,9 @@ function defaultColumnsNumber(imageCount) { } const pickRelevantMediaFiles = function (image) { let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large'; - const imageProps = Object(external_lodash_["pick"])(image, ['alt', 'id', 'link', 'caption']); - imageProps.url = Object(external_lodash_["get"])(image, ['sizes', sizeSlug, 'url']) || Object(external_lodash_["get"])(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url; - const fullUrl = Object(external_lodash_["get"])(image, ['sizes', 'full', 'url']) || Object(external_lodash_["get"])(image, ['media_details', 'sizes', 'full', 'source_url']); + const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']); + imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url; + const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']); if (fullUrl) { imageProps.fullUrl = fullUrl; @@ -10803,7 +10771,7 @@ function isGalleryV2Enabled() { return true; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js /** @@ -10904,7 +10872,7 @@ function runV2Migration(attributes) { const imageBlocks = attributes.images.map(image => { return getImageBlock(image, attributes.sizeSlug, linkTo); }); - return [{ ...Object(external_lodash_["omit"])(attributes, ['images', 'ids']), + return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['images', 'ids']), linkTo, allowResize: false }, imageBlocks]; @@ -10922,7 +10890,7 @@ function runV2Migration(attributes) { function getImageBlock(image, sizeSlug, linkTo) { - return Object(external_wp_blocks_["createBlock"])('core/image', { ...(image.id && { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { ...(image.id && { id: parseInt(image.id) }), url: image.url, @@ -11024,9 +10992,9 @@ const deprecated_v6 = { linkTo } = attributes; const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`; - return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className - }), Object(external_wp_element_["createElement"])("ul", { + }), (0,external_wp_element_namespaceObject.createElement)("ul", { className: "blocks-gallery-grid" }, images.map(image => { let href; @@ -11041,7 +11009,7 @@ const deprecated_v6 = { break; } - const img = Object(external_wp_element_["createElement"])("img", { + const img = (0,external_wp_element_namespaceObject.createElement)("img", { src: image.url, alt: image.alt, "data-id": image.id, @@ -11049,17 +11017,17 @@ const deprecated_v6 = { "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: image.id || image.url, className: "blocks-gallery-item" - }, Object(external_wp_element_["createElement"])("figure", null, href ? Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href - }, img) : img, !external_wp_blockEditor_["RichText"].isEmpty(image.caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-item__caption", value: image.caption }))); - })), !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption @@ -11193,9 +11161,9 @@ const deprecated_v5 = { caption, linkTo } = attributes; - return Object(external_wp_element_["createElement"])("figure", { + return (0,external_wp_element_namespaceObject.createElement)("figure", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}` - }, Object(external_wp_element_["createElement"])("ul", { + }, (0,external_wp_element_namespaceObject.createElement)("ul", { className: "blocks-gallery-grid" }, images.map(image => { let href; @@ -11210,7 +11178,7 @@ const deprecated_v5 = { break; } - const img = Object(external_wp_element_["createElement"])("img", { + const img = (0,external_wp_element_namespaceObject.createElement)("img", { src: image.url, alt: image.alt, "data-id": image.id, @@ -11218,17 +11186,17 @@ const deprecated_v5 = { "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: image.id || image.url, className: "blocks-gallery-item" - }, Object(external_wp_element_["createElement"])("figure", null, href ? Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href - }, img) : img, !external_wp_blockEditor_["RichText"].isEmpty(image.caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-item__caption", value: image.caption }))); - })), !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption @@ -11315,7 +11283,7 @@ const deprecated_v4 = { } return { ...attributes, - ids: Object(external_lodash_["map"])(attributes.ids, id => { + ids: (0,external_lodash_namespaceObject.map)(attributes.ids, id => { const parsedId = parseInt(id, 10); return Number.isInteger(parsedId) ? parsedId : null; }) @@ -11333,9 +11301,9 @@ const deprecated_v4 = { caption, linkTo } = attributes; - return Object(external_wp_element_["createElement"])("figure", { + return (0,external_wp_element_namespaceObject.createElement)("figure", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}` - }, Object(external_wp_element_["createElement"])("ul", { + }, (0,external_wp_element_namespaceObject.createElement)("ul", { className: "blocks-gallery-grid" }, images.map(image => { let href; @@ -11350,7 +11318,7 @@ const deprecated_v4 = { break; } - const img = Object(external_wp_element_["createElement"])("img", { + const img = (0,external_wp_element_namespaceObject.createElement)("img", { src: image.url, alt: image.alt, "data-id": image.id, @@ -11358,17 +11326,17 @@ const deprecated_v4 = { "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: image.id || image.url, className: "blocks-gallery-item" - }, Object(external_wp_element_["createElement"])("figure", null, href ? Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href - }, img) : img, !external_wp_blockEditor_["RichText"].isEmpty(image.caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-item__caption", value: image.caption }))); - })), !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption @@ -11447,7 +11415,7 @@ const deprecated_v3 = { imageCrop, linkTo } = attributes; - return Object(external_wp_element_["createElement"])("ul", { + return (0,external_wp_element_namespaceObject.createElement)("ul", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}` }, images.map(image => { let href; @@ -11462,7 +11430,7 @@ const deprecated_v3 = { break; } - const img = Object(external_wp_element_["createElement"])("img", { + const img = (0,external_wp_element_namespaceObject.createElement)("img", { src: image.url, alt: image.alt, "data-id": image.id, @@ -11470,12 +11438,12 @@ const deprecated_v3 = { "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: image.id || image.url, className: "blocks-gallery-item" - }, Object(external_wp_element_["createElement"])("figure", null, href ? Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href - }, img) : img, image.caption && image.caption.length > 0 && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: image.caption }))); @@ -11545,7 +11513,7 @@ const deprecated_v2 = { images, ids } = _ref7; - return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || Object(external_lodash_["some"])(images, (id, index) => { + return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || (0,external_lodash_namespaceObject.some)(images, (id, index) => { if (!id && ids[index] !== null) { return true; } @@ -11560,7 +11528,7 @@ const deprecated_v2 = { } return { ...attributes, - ids: Object(external_lodash_["map"])(attributes.images, _ref8 => { + ids: (0,external_lodash_namespaceObject.map)(attributes.images, _ref8 => { let { id } = _ref8; @@ -11588,7 +11556,7 @@ const deprecated_v2 = { imageCrop, linkTo } = attributes; - return Object(external_wp_element_["createElement"])("ul", { + return (0,external_wp_element_namespaceObject.createElement)("ul", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}` }, images.map(image => { let href; @@ -11603,19 +11571,19 @@ const deprecated_v2 = { break; } - const img = Object(external_wp_element_["createElement"])("img", { + const img = (0,external_wp_element_namespaceObject.createElement)("img", { src: image.url, alt: image.alt, "data-id": image.id, "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: image.id || image.url, className: "blocks-gallery-item" - }, Object(external_wp_element_["createElement"])("figure", null, href ? Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href - }, img) : img, image.caption && image.caption.length > 0 && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: image.caption }))); @@ -11681,7 +11649,7 @@ const deprecated_v1 = { alignnone: align === 'none', 'is-cropped': imageCrop }); - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: className }, images.map(image => { let href; @@ -11696,15 +11664,15 @@ const deprecated_v1 = { break; } - const img = Object(external_wp_element_["createElement"])("img", { + const img = (0,external_wp_element_namespaceObject.createElement)("img", { src: image.url, alt: image.alt, "data-id": image.id }); - return Object(external_wp_element_["createElement"])("figure", { + return (0,external_wp_element_namespaceObject.createElement)("figure", { key: image.id || image.url, className: "blocks-gallery-image" - }, href ? Object(external_wp_element_["createElement"])("a", { + }, href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href }, img) : img); })); @@ -11721,10 +11689,9 @@ const deprecated_v1 = { }; /* harmony default export */ var gallery_deprecated = ([deprecated_v6, deprecated_v5, deprecated_v4, deprecated_v3, deprecated_v2, deprecated_v1]); -// EXTERNAL MODULE: external ["wp","viewport"] -var external_wp_viewport_ = __webpack_require__("KEfo"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js +;// CONCATENATED MODULE: external ["wp","viewport"] +var external_wp_viewport_namespaceObject = window["wp"]["viewport"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js /** @@ -11732,11 +11699,11 @@ var external_wp_viewport_ = __webpack_require__("KEfo"); */ -const sharedIcon = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { +const sharedIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_gallery }); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js const MIN_SIZE = 20; const constants_LINK_DESTINATION_NONE = 'none'; const constants_LINK_DESTINATION_MEDIA = 'media'; @@ -11746,7 +11713,7 @@ const constants_NEW_TAB_REL = ['noreferrer', 'noopener']; const constants_ALLOWED_MEDIA_TYPES = ['image']; const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/utils.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/utils.js /** * Internal dependencies */ @@ -11790,7 +11757,7 @@ function utils_getHrefAndDestination(image, destination) { return {}; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/utils.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/utils.js /** * External dependencies */ @@ -11803,9 +11770,9 @@ function utils_getHrefAndDestination(image, destination) { function removeNewTabRel(currentRel) { let newRel = currentRel; - if (currentRel !== undefined && !Object(external_lodash_["isEmpty"])(newRel)) { - if (!Object(external_lodash_["isEmpty"])(newRel)) { - Object(external_lodash_["each"])(constants_NEW_TAB_REL, relVal => { + if (currentRel !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(newRel)) { + if (!(0,external_lodash_namespaceObject.isEmpty)(newRel)) { + (0,external_lodash_namespaceObject.each)(constants_NEW_TAB_REL, relVal => { const regExp = new RegExp('\\b' + relVal + '\\b', 'gi'); newRel = newRel.replace(regExp, ''); }); // Only trim if NEW_TAB_REL values was replaced. @@ -11814,7 +11781,7 @@ function removeNewTabRel(currentRel) { newRel = newRel.trim(); } - if (Object(external_lodash_["isEmpty"])(newRel)) { + if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) { newRel = undefined; } } @@ -11858,7 +11825,7 @@ function getUpdatedLinkTargetSettings(value, _ref) { */ function getImageSizeAttributes(image, size) { - const url = Object(external_lodash_["get"])(image, ['media_details', 'sizes', size, 'source_url']); + const url = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']); if (url) { return { @@ -11872,7 +11839,7 @@ function getImageSizeAttributes(image, size) { return {}; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js @@ -11890,7 +11857,7 @@ function getImageSizeAttributes(image, size) { -const gallery_allowedBlocks = ['core/image']; +const allowedBlocks = ['core/image']; const Gallery = props => { const { attributes, @@ -11909,8 +11876,8 @@ const Gallery = props => { const { children, ...innerBlocksProps - } = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, { - allowedBlocks: gallery_allowedBlocks, + } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { + allowedBlocks, orientation: 'horizontal', renderAppender: false, __experimentalLayout: { @@ -11918,7 +11885,7 @@ const Gallery = props => { alignments: [] } }); - const [captionFocused, setCaptionFocused] = Object(external_wp_element_["useState"])(false); + const [captionFocused, setCaptionFocused] = (0,external_wp_element_namespaceObject.useState)(false); function onFocusCaption() { if (!captionFocused) { @@ -11932,35 +11899,35 @@ const Gallery = props => { } } - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected) { setCaptionFocused(false); } }, [isSelected]); - return Object(external_wp_element_["createElement"])("figure", Object(esm_extends["a" /* default */])({}, innerBlocksProps, { + return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, innerBlocksProps, { className: classnames_default()(blockProps.className, 'blocks-gallery-grid', { [`align${align}`]: align, [`columns-${columns}`]: columns !== undefined, [`columns-default`]: columns === undefined, 'is-cropped': imageCrop }) - }), children, Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], { + }), children, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { className: "blocks-gallery-media-placeholder-wrapper", onClick: removeCaptionFocus - }, mediaPlaceholder), Object(external_wp_element_["createElement"])(RichTextVisibilityHelper, { - isHidden: !isSelected && external_wp_blockEditor_["RichText"].isEmpty(caption), + }, mediaPlaceholder), (0,external_wp_element_namespaceObject.createElement)(RichTextVisibilityHelper, { + isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption), captionFocused: captionFocused, onFocusCaption: onFocusCaption, tagName: "figcaption", className: "blocks-gallery-caption", - "aria-label": Object(external_wp_i18n_["__"])('Gallery caption text'), - placeholder: Object(external_wp_i18n_["__"])('Write gallery caption…'), + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'), value: caption, onChange: value => setAttributes({ caption: value }), inlineToolbar: true, - __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph')) + __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')) })); }; @@ -11978,12 +11945,12 @@ function RichTextVisibilityHelper(_ref) { } = _ref; if (isHidden) { - return Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], Object(esm_extends["a" /* default */])({ - as: external_wp_blockEditor_["RichText"] + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({ + as: external_wp_blockEditor_namespaceObject.RichText }, richTextProps)); } - return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({ + return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({ ref: captionRef, value: value, placeholder: placeholder, @@ -11996,7 +11963,7 @@ function RichTextVisibilityHelper(_ref) { /* harmony default export */ var gallery_gallery = (Gallery); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js /** * External dependencies */ @@ -12018,7 +11985,7 @@ function RichTextVisibilityHelper(_ref) { */ function useImageSizes(images, isSelected, getSettings) { - return Object(external_wp_element_["useMemo"])(() => getImageSizing(), [images, isSelected]); + return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]); function getImageSizing() { if (!images || images.length === 0) { @@ -12037,8 +12004,8 @@ function useImageSizes(images, isSelected, getSettings) { } const sizes = imageSizes.reduce((currentSizes, size) => { - const defaultUrl = Object(external_lodash_["get"])(img, ['sizes', size.slug, 'url']); - const mediaDetailsUrl = Object(external_lodash_["get"])(img, ['media_details', 'sizes', size.slug, 'source_url']); + const defaultUrl = (0,external_lodash_namespaceObject.get)(img, ['sizes', size.slug, 'url']); + const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(img, ['media_details', 'sizes', size.slug, 'source_url']); return { ...currentSizes, [size.slug]: defaultUrl || mediaDetailsUrl }; @@ -12053,7 +12020,7 @@ function useImageSizes(images, isSelected, getSettings) { let { slug } = _ref; - return Object(external_lodash_["some"])(resizedImages, sizes => sizes[slug]); + return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]); }).map(_ref2 => { let { name, @@ -12067,7 +12034,7 @@ function useImageSizes(images, isSelected, getSettings) { } } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-short-code-transform.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-short-code-transform.js /** * External dependencies */ @@ -12088,12 +12055,12 @@ function useImageSizes(images, isSelected, getSettings) { */ function useShortCodeTransform(shortCodeTransforms) { - const newImageData = Object(external_wp_data_["useSelect"])(select => { + const newImageData = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!shortCodeTransforms || shortCodeTransforms.length === 0) { return; } - const getMedia = select(external_wp_coreData_["store"]).getMedia; + const getMedia = select(external_wp_coreData_namespaceObject.store).getMedia; return shortCodeTransforms.map(image => { const imageData = getMedia(image.id); @@ -12116,12 +12083,12 @@ function useShortCodeTransform(shortCodeTransforms) { return; } - if (Object(external_lodash_["every"])(newImageData, img => img && img.url)) { + if ((0,external_lodash_namespaceObject.every)(newImageData, img => img && img.url)) { return newImageData; } } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js /** * WordPress dependencies */ @@ -12138,8 +12105,8 @@ function useShortCodeTransform(shortCodeTransforms) { */ function useGetNewImages(images, imageData) { - const [currentImages, setCurrentImages] = Object(external_wp_element_["useState"])([]); - return Object(external_wp_element_["useMemo"])(() => getNewImages(), [images, imageData]); + const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]); + return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]); function getNewImages() { let imagesUpdated = false; // First lets check if any images have been deleted. @@ -12172,7 +12139,7 @@ function useGetNewImages(images, imageData) { } } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js /** * WordPress dependencies */ @@ -12189,8 +12156,8 @@ function useGetNewImages(images, imageData) { */ function useGetMedia(innerBlockImages) { - const [currentImageMedia, setCurrentImageMedia] = Object(external_wp_element_["useState"])([]); - const imageMedia = Object(external_wp_data_["useSelect"])(select => { + const [currentImageMedia, setCurrentImageMedia] = (0,external_wp_element_namespaceObject.useState)([]); + const imageMedia = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!(innerBlockImages !== null && innerBlockImages !== void 0 && innerBlockImages.length)) { return currentImageMedia; } @@ -12201,7 +12168,7 @@ function useGetMedia(innerBlockImages) { return currentImageMedia; } - return select(external_wp_coreData_["store"]).getMediaItems({ + return select(external_wp_coreData_namespaceObject.store).getMediaItems({ include: imageIds.join(','), per_page: -1 }); @@ -12215,7 +12182,7 @@ function useGetMedia(innerBlockImages) { return currentImageMedia; } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit.js @@ -12256,17 +12223,17 @@ function useGetMedia(innerBlockImages) { const MAX_COLUMNS = 8; const linkOptions = [{ value: LINK_DESTINATION_ATTACHMENT, - label: Object(external_wp_i18n_["__"])('Attachment Page') + label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page') }, { value: LINK_DESTINATION_MEDIA, - label: Object(external_wp_i18n_["__"])('Media File') + label: (0,external_wp_i18n_namespaceObject.__)('Media File') }, { value: LINK_DESTINATION_NONE, - label: Object(external_wp_i18n_["_x"])('None', 'Media item link option') + label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option') }]; const edit_ALLOWED_MEDIA_TYPES = ['image']; -const PLACEHOLDER_TEXT = external_wp_element_["Platform"].isNative ? Object(external_wp_i18n_["__"])('ADD MEDIA') : Object(external_wp_i18n_["__"])('Drag images, upload new ones or select files from your library.'); -const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_["Platform"].isNative ? { +const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA') : (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'); +const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? { type: 'stepper' } : {}; @@ -12293,31 +12260,31 @@ function GalleryEdit(props) { __unstableMarkNextChangeAsNotPersistent, replaceInnerBlocks, updateBlockAttributes - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { createSuccessNotice - } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { getBlock, getSettings, preferredStyle - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _preferredStyleVariat; - const settings = select(external_wp_blockEditor_["store"]).getSettings(); + const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); const preferredStyleVariations = settings.__experimentalPreferredStyleVariations; return { - getBlock: select(external_wp_blockEditor_["store"]).getBlock, - getSettings: select(external_wp_blockEditor_["store"]).getSettings, + getBlock: select(external_wp_blockEditor_namespaceObject.store).getBlock, + getSettings: select(external_wp_blockEditor_namespaceObject.store).getSettings, preferredStyle: preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat['core/image'] }; }, []); - const innerBlockImages = Object(external_wp_data_["useSelect"])(select => { + const innerBlockImages = (0,external_wp_data_namespaceObject.useSelect)(select => { var _select$getBlock; - return (_select$getBlock = select(external_wp_blockEditor_["store"]).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.innerBlocks; + return (_select$getBlock = select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.innerBlocks; }, [clientId]); - const images = Object(external_wp_element_["useMemo"])(() => innerBlockImages === null || innerBlockImages === void 0 ? void 0 : innerBlockImages.map(block => ({ + const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages === null || innerBlockImages === void 0 ? void 0 : innerBlockImages.map(block => ({ clientId: block.clientId, id: block.attributes.id, url: block.attributes.url, @@ -12326,7 +12293,7 @@ function GalleryEdit(props) { })), [innerBlockImages]); const imageData = useGetMedia(innerBlockImages); const newImages = useGetNewImages(images, imageData); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { newImages === null || newImages === void 0 ? void 0 : newImages.forEach(newImage => { updateBlockAttributes(newImage.clientId, { ...buildImageAttributes(newImage.attributes), id: newImage.id, @@ -12335,7 +12302,7 @@ function GalleryEdit(props) { }); }, [newImages]); const shortCodeImages = useShortCodeTransform(shortCodeTransforms); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!shortCodeTransforms || !shortCodeImages) { return; } @@ -12360,7 +12327,7 @@ function GalleryEdit(props) { */ function buildImageAttributes(imageAttributes) { - const image = imageAttributes.id ? Object(external_lodash_["find"])(imageData, { + const image = imageAttributes.id ? (0,external_lodash_namespaceObject.find)(imageData, { id: imageAttributes.id }) : null; let newClassName; @@ -12394,7 +12361,7 @@ function GalleryEdit(props) { const imageArray = newFileUploads ? Array.from(selectedImages).map(file => { if (!file.url) { return pickRelevantMediaFiles({ - url: Object(external_wp_blob_["createBlobURL"])(file) + url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); } @@ -12403,7 +12370,7 @@ function GalleryEdit(props) { if (!imageArray.every(isValidFileType)) { noticeOperations.removeAllNotices(); - noticeOperations.createErrorNotice(Object(external_wp_i18n_["__"])('If uploading to a gallery all files need to be image formats'), { + noticeOperations.createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), { id: 'gallery-upload-invalid-file' }); } @@ -12411,7 +12378,7 @@ function GalleryEdit(props) { const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => { if (!file.url) { return pickRelevantMediaFiles({ - url: Object(external_wp_blob_["createBlobURL"])(file) + url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); } @@ -12424,14 +12391,14 @@ function GalleryEdit(props) { const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages; const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id)); const newBlocks = newImageList.map(image => { - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { id: image.id, url: image.url, caption: image.caption, alt: image.alt }); }); - replaceInnerBlocks(clientId, Object(external_lodash_["concat"])(existingImageBlocks, newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id])); + replaceInnerBlocks(clientId, (0,external_lodash_namespaceObject.concat)(existingImageBlocks, newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id])); } function onUploadError(message) { @@ -12447,16 +12414,16 @@ function GalleryEdit(props) { const blocks = []; getBlock(clientId).innerBlocks.forEach(block => { blocks.push(block.clientId); - const image = block.attributes.id ? Object(external_lodash_["find"])(imageData, { + const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, { id: block.attributes.id }) : null; changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value); }); updateBlockAttributes(blocks, changedAttributes, true); const linkToText = [...linkOptions].find(linkType => linkType.value === value); - createSuccessNotice(Object(external_wp_i18n_["sprintf"])( + createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: image size settings */ - Object(external_wp_i18n_["__"])('All gallery image links updated to: %s'), linkToText.label), { + (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.label), { id: 'gallery-attributes-linkTo', type: 'snackbar' }); @@ -12475,7 +12442,7 @@ function GalleryEdit(props) { } function getImageCropHelp(checked) { - return checked ? Object(external_wp_i18n_["__"])('Thumbnails are cropped to align.') : Object(external_wp_i18n_["__"])('Thumbnails are not cropped.'); + return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.'); } function toggleOpenInNewTab(openInNewTab) { @@ -12490,7 +12457,7 @@ function GalleryEdit(props) { changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes); }); updateBlockAttributes(blocks, changedAttributes, true); - const noticeText = openInNewTab ? Object(external_wp_i18n_["__"])('All gallery images updated to open in new tab') : Object(external_wp_i18n_["__"])('All gallery images updated to not open in new tab'); + const noticeText = openInNewTab ? (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to open in new tab') : (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to not open in new tab'); createSuccessNotice(noticeText, { id: 'gallery-attributes-openInNewTab', type: 'snackbar' @@ -12505,22 +12472,22 @@ function GalleryEdit(props) { const blocks = []; getBlock(clientId).innerBlocks.forEach(block => { blocks.push(block.clientId); - const image = block.attributes.id ? Object(external_lodash_["find"])(imageData, { + const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, { id: block.attributes.id }) : null; changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug); }); updateBlockAttributes(blocks, changedAttributes, true); const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug); - createSuccessNotice(Object(external_wp_i18n_["sprintf"])( + createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: image size settings */ - Object(external_wp_i18n_["__"])('All gallery image sizes updated to: %s'), imageSize.label), { + (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), { id: 'gallery-attributes-sizeSlug', type: 'snackbar' }); } - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php if (!linkTo) { var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3; @@ -12539,14 +12506,14 @@ function GalleryEdit(props) { return !img.id && ((_img$url = img.url) === null || _img$url === void 0 ? void 0 : _img$url.indexOf('blob:')) === 0; }); - const mediaPlaceholder = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], { + const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { addToGallery: hasImageIds, handleUpload: false, isAppender: hasImages, disableMediaButtons: hasImages && !isSelected || imagesUploading, icon: !hasImages && sharedIcon, labels: { - title: !hasImages && Object(external_wp_i18n_["__"])('Gallery'), + title: !hasImages && (0,external_wp_i18n_namespaceObject.__)('Gallery'), instructions: !hasImages && PLACEHOLDER_TEXT }, onSelect: updateImages, @@ -12557,51 +12524,51 @@ function GalleryEdit(props) { onError: onUploadError, notices: hasImages ? undefined : noticeUI }); - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classnames_default()(className, 'has-nested-images') }); if (!hasImages) { - return Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], blockProps, mediaPlaceholder); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder); } const hasLinkTo = linkTo && linkTo !== 'none'; - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Gallery settings') - }, images.length > 1 && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], Object(esm_extends["a" /* default */])({ - label: Object(external_wp_i18n_["__"])('Columns'), + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings') + }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({ + label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: columns ? columns : defaultColumnsNumber(images.length), onChange: setColumnsNumber, min: 1, max: Math.min(MAX_COLUMNS, images.length) }, MOBILE_CONTROL_PROPS_RANGE_CONTROL, { required: true - })), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Crop images'), + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Crop images'), checked: !!imageCrop, onChange: toggleImageCrop, help: getImageCropHelp - }), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["__"])('Link to'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Link to'), value: linkTo, onChange: setLinkTo, options: linkOptions, hideCancelButton: true - }), hasLinkTo && Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Open in new tab'), + }), hasLinkTo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), checked: linkTarget === '_blank', onChange: toggleOpenInNewTab - }), (imageSizeOptions === null || imageSizeOptions === void 0 ? void 0 : imageSizeOptions.length) > 0 && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["__"])('Image size'), + }), (imageSizeOptions === null || imageSizeOptions === void 0 ? void 0 : imageSizeOptions.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Image size'), value: sizeSlug, options: imageSizeOptions, onChange: updateImagesSize, hideCancelButton: true - }), external_wp_element_["Platform"].isWeb && !imageSizeOptions && hasImageIds && Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], { + }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { className: 'gallery-image-sizes' - }, Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"].VisualLabel, null, Object(external_wp_i18n_["__"])('Image size')), Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image size')), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { className: 'gallery-image-sizes__loading' - }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), Object(external_wp_i18n_["__"])('Loading options…'))))), noticeUI, Object(external_wp_element_["createElement"])(gallery_gallery, Object(esm_extends["a" /* default */])({}, props, { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_i18n_namespaceObject.__)('Loading options…'))))), noticeUI, (0,external_wp_element_namespaceObject.createElement)(gallery_gallery, _extends({}, props, { images: images, mediaPlaceholder: mediaPlaceholder, blockProps: blockProps, @@ -12609,20 +12576,20 @@ function GalleryEdit(props) { }))); } -/* harmony default export */ var gallery_edit = (Object(external_wp_compose_["compose"])([external_wp_components_["withNotices"], Object(external_wp_viewport_["withViewportMatch"])({ +/* harmony default export */ var gallery_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({ isNarrow: '< small' })])(GalleryEdit)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/shared.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/shared.js /** * External dependencies */ const shared_pickRelevantMediaFiles = function (image) { let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large'; - const imageProps = Object(external_lodash_["pick"])(image, ['alt', 'id', 'link', 'caption']); - imageProps.url = Object(external_lodash_["get"])(image, ['sizes', sizeSlug, 'url']) || Object(external_lodash_["get"])(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url; - const fullUrl = Object(external_lodash_["get"])(image, ['sizes', 'full', 'url']) || Object(external_lodash_["get"])(image, ['media_details', 'sizes', 'full', 'source_url']); + const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']); + imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url; + const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']); if (fullUrl) { imageProps.fullUrl = fullUrl; @@ -12631,36 +12598,72 @@ const shared_pickRelevantMediaFiles = function (image) { return imageProps; }; -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js /** * WordPress dependencies */ -const image_image = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +const image_image = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" })); /* harmony default export */ var library_image = (image_image); -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js -var chevron_left = __webpack_require__("2gm7"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js -var chevron_right = __webpack_require__("1iEr"); -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js -var close_small = __webpack_require__("bWcr"); +/** + * WordPress dependencies + */ -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/constants.js +const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" +})); +/* harmony default export */ var chevron_left = (chevronLeft); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js + + +/** + * WordPress dependencies + */ + +const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var chevron_right = (chevronRight); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js + + +/** + * WordPress dependencies + */ + +const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(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 */ var close_small = (closeSmall); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/constants.js const v1_constants_LINK_DESTINATION_NONE = 'none'; const v1_constants_LINK_DESTINATION_MEDIA = 'file'; const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post'; -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery-image.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery-image.js /** @@ -12689,9 +12692,9 @@ const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post'; -const isTemporaryImage = (id, url) => !id && Object(external_wp_blob_["isBlobURL"])(url); +const isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); -class gallery_image_GalleryImage extends external_wp_element_["Component"] { +class GalleryImage extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.onSelectImage = this.onSelectImage.bind(this); @@ -12716,7 +12719,7 @@ class gallery_image_GalleryImage extends external_wp_element_["Component"] { } onRemoveImage(event) { - if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_wp_keycodes_["BACKSPACE"], external_wp_keycodes_["DELETE"]].indexOf(event.keyCode) !== -1) { + if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].indexOf(event.keyCode) !== -1) { event.preventDefault(); this.props.onRemove(); } @@ -12768,14 +12771,14 @@ class gallery_image_GalleryImage extends external_wp_element_["Component"] { if (isTemporaryImage(id, url)) { if (alt) { - mediaAttributes = Object(external_lodash_["omit"])(mediaAttributes, ['alt']); + mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['alt']); } } // If a caption text was meanwhile written by the user, // make sure the text is not overwritten by empty captions. - if (caption && !Object(external_lodash_["get"])(mediaAttributes, ['caption'])) { - mediaAttributes = Object(external_lodash_["omit"])(mediaAttributes, ['caption']); + if (caption && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) { + mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']); } setAttributes(mediaAttributes); @@ -12837,7 +12840,7 @@ class gallery_image_GalleryImage extends external_wp_element_["Component"] { // direct image selection and unfocus caption fields. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ - Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("img", { + (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", { src: url, alt: alt, "data-id": id, @@ -12845,23 +12848,23 @@ class gallery_image_GalleryImage extends external_wp_element_["Component"] { tabIndex: "0", "aria-label": ariaLabel, ref: this.bindContainer - }), Object(external_wp_blob_["isBlobURL"])(url) && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)) + }), (0,external_wp_blob_namespaceObject.isBlobURL)(url) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)) /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */ ; const className = classnames_default()({ 'is-selected': isSelected, - 'is-transient': Object(external_wp_blob_["isBlobURL"])(url) + 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(url) }); return (// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions - Object(external_wp_element_["createElement"])("figure", { + (0,external_wp_element_namespaceObject.createElement)("figure", { className: className, onClick: this.onSelectImage, onFocus: this.onSelectImage - }, !isEditing && (href ? Object(external_wp_element_["createElement"])("a", { + }, !isEditing && (href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href - }, img) : img), isEditing && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], { + }, img) : img), isEditing && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { labels: { - title: Object(external_wp_i18n_["__"])('Edit gallery image') + title: (0,external_wp_i18n_namespaceObject.__)('Edit gallery image') }, icon: library_image, onSelect: this.onSelectImageFromLibrary, @@ -12872,36 +12875,36 @@ class gallery_image_GalleryImage extends external_wp_element_["Component"] { id, src: url } - }), Object(external_wp_element_["createElement"])(external_wp_components_["ButtonGroup"], { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { className: "block-library-gallery-item__inline-menu is-left" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: chevron_left["a" /* default */], + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: chevron_left, onClick: isFirstItem ? undefined : onMoveBackward, - label: Object(external_wp_i18n_["__"])('Move image backward'), + label: (0,external_wp_i18n_namespaceObject.__)('Move image backward'), "aria-disabled": isFirstItem, disabled: !isSelected - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: chevron_right["a" /* default */], + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: chevron_right, onClick: isLastItem ? undefined : onMoveForward, - label: Object(external_wp_i18n_["__"])('Move image forward'), + label: (0,external_wp_i18n_namespaceObject.__)('Move image forward'), "aria-disabled": isLastItem, disabled: !isSelected - })), Object(external_wp_element_["createElement"])(external_wp_components_["ButtonGroup"], { + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { className: "block-library-gallery-item__inline-menu is-right" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: library_edit["a" /* default */], + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: library_edit, onClick: this.onEdit, - label: Object(external_wp_i18n_["__"])('Replace image'), + label: (0,external_wp_i18n_namespaceObject.__)('Replace image'), disabled: !isSelected - }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: close_small["a" /* default */], + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + icon: close_small, onClick: onRemove, - label: Object(external_wp_i18n_["__"])('Remove image'), + label: (0,external_wp_i18n_namespaceObject.__)('Remove image'), disabled: !isSelected - })), !isEditing && (isSelected || caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { + })), !isEditing && (isSelected || caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "figcaption", - "aria-label": Object(external_wp_i18n_["__"])('Image caption text'), - placeholder: isSelected ? Object(external_wp_i18n_["__"])('Add caption') : null, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'), + placeholder: isSelected ? (0,external_wp_i18n_namespaceObject.__)('Add caption') : null, value: caption, onChange: newCaption => setAttributes({ caption: newCaption @@ -12913,26 +12916,26 @@ class gallery_image_GalleryImage extends external_wp_element_["Component"] { } -/* harmony default export */ var gallery_image = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, ownProps) => { +/* harmony default export */ var gallery_image = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => { const { getMedia - } = select(external_wp_coreData_["store"]); + } = select(external_wp_coreData_namespaceObject.store); const { id } = ownProps; return { image: id ? getMedia(parseInt(id, 10)) : null }; -}), Object(external_wp_data_["withDispatch"])(dispatch => { +}), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { const { __unstableMarkNextChangeAsNotPersistent - } = dispatch(external_wp_blockEditor_["store"]); + } = dispatch(external_wp_blockEditor_namespaceObject.store); return { __unstableMarkNextChangeAsNotPersistent }; -})])(gallery_image_GalleryImage)); +})])(GalleryImage)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery.js @@ -12977,22 +12980,22 @@ const gallery_Gallery = props => { imageCrop, images } = attributes; - return Object(external_wp_element_["createElement"])("figure", Object(esm_extends["a" /* default */])({}, blockProps, { + return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, blockProps, { className: classnames_default()(blockProps.className, { [`align${align}`]: align, [`columns-${columns}`]: columns, 'is-cropped': imageCrop }) - }), Object(external_wp_element_["createElement"])("ul", { + }), (0,external_wp_element_namespaceObject.createElement)("ul", { className: "blocks-gallery-grid" }, images.map((img, index) => { - const ariaLabel = Object(external_wp_i18n_["sprintf"])( + const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: the order number of the image. 2: the total number of images. */ - Object(external_wp_i18n_["__"])('image %1$d of %2$d in gallery'), index + 1, images.length); - return Object(external_wp_element_["createElement"])("li", { + (0,external_wp_i18n_namespaceObject.__)('image %1$d of %2$d in gallery'), index + 1, images.length); + return (0,external_wp_element_namespaceObject.createElement)("li", { className: "blocks-gallery-item", key: img.id ? `${img.id}-${index}` : img.url - }, Object(external_wp_element_["createElement"])(gallery_image, { + }, (0,external_wp_element_namespaceObject.createElement)(gallery_image, { url: img.url, alt: img.alt, id: img.id, @@ -13009,18 +13012,18 @@ const gallery_Gallery = props => { "aria-label": ariaLabel, sizeSlug: attributes.sizeSlug })); - })), mediaPlaceholder, Object(external_wp_element_["createElement"])(gallery_RichTextVisibilityHelper, { - isHidden: !isSelected && external_wp_blockEditor_["RichText"].isEmpty(caption), + })), mediaPlaceholder, (0,external_wp_element_namespaceObject.createElement)(gallery_RichTextVisibilityHelper, { + isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption), tagName: "figcaption", className: "blocks-gallery-caption", - "aria-label": Object(external_wp_i18n_["__"])('Gallery caption text'), - placeholder: Object(external_wp_i18n_["__"])('Write gallery caption…'), + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'), value: caption, onChange: value => setAttributes({ caption: value }), inlineToolbar: true, - __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph')) + __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')) })); }; @@ -13029,14 +13032,14 @@ function gallery_RichTextVisibilityHelper(_ref) { isHidden, ...richTextProps } = _ref; - return isHidden ? Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], Object(esm_extends["a" /* default */])({ - as: external_wp_blockEditor_["RichText"] - }, richTextProps)) : Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], richTextProps); + return isHidden ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({ + as: external_wp_blockEditor_namespaceObject.RichText + }, richTextProps)) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, richTextProps); } /* harmony default export */ var v1_gallery = (gallery_Gallery); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/edit.js @@ -13070,20 +13073,20 @@ function gallery_RichTextVisibilityHelper(_ref) { const edit_MAX_COLUMNS = 8; const edit_linkOptions = [{ value: v1_constants_LINK_DESTINATION_ATTACHMENT, - label: Object(external_wp_i18n_["__"])('Attachment Page') + label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page') }, { value: v1_constants_LINK_DESTINATION_MEDIA, - label: Object(external_wp_i18n_["__"])('Media File') + label: (0,external_wp_i18n_namespaceObject.__)('Media File') }, { value: v1_constants_LINK_DESTINATION_NONE, - label: Object(external_wp_i18n_["__"])('None') + label: (0,external_wp_i18n_namespaceObject.__)('None') }]; const v1_edit_ALLOWED_MEDIA_TYPES = ['image']; -const edit_PLACEHOLDER_TEXT = external_wp_element_["Platform"].select({ - web: Object(external_wp_i18n_["__"])('Drag images, upload new ones or select files from your library.'), - native: Object(external_wp_i18n_["__"])('ADD MEDIA') +const edit_PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.select({ + web: (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'), + native: (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA') }); -const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_["Platform"].select({ +const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.select({ web: {}, native: { type: 'stepper' @@ -13106,36 +13109,36 @@ function edit_GalleryEdit(props) { linkTo, sizeSlug } = attributes; - const [selectedImage, setSelectedImage] = Object(external_wp_element_["useState"])(); - const [attachmentCaptions, setAttachmentCaptions] = Object(external_wp_element_["useState"])(); + const [selectedImage, setSelectedImage] = (0,external_wp_element_namespaceObject.useState)(); + const [attachmentCaptions, setAttachmentCaptions] = (0,external_wp_element_namespaceObject.useState)(); const { __unstableMarkNextChangeAsNotPersistent - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { imageSizes, mediaUpload, getMedia, wasBlockJustInserted - } = Object(external_wp_data_["useSelect"])(select => { - const settings = select(external_wp_blockEditor_["store"]).getSettings(); + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); return { imageSizes: settings.imageSizes, mediaUpload: settings.mediaUpload, - getMedia: select(external_wp_coreData_["store"]).getMedia, - wasBlockJustInserted: select(external_wp_blockEditor_["store"]).wasBlockJustInserted(clientId, 'inserter_menu') + getMedia: select(external_wp_coreData_namespaceObject.store).getMedia, + wasBlockJustInserted: select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu') }; }); - const resizedImages = Object(external_wp_element_["useMemo"])(() => { + const resizedImages = (0,external_wp_element_namespaceObject.useMemo)(() => { if (isSelected) { - return Object(external_lodash_["reduce"])(attributes.ids, (currentResizedImages, id) => { + return (0,external_lodash_namespaceObject.reduce)(attributes.ids, (currentResizedImages, id) => { if (!id) { return currentResizedImages; } const image = getMedia(id); - const sizes = Object(external_lodash_["reduce"])(imageSizes, (currentSizes, size) => { - const defaultUrl = Object(external_lodash_["get"])(image, ['sizes', size.slug, 'url']); - const mediaDetailsUrl = Object(external_lodash_["get"])(image, ['media_details', 'sizes', size.slug, 'source_url']); + const sizes = (0,external_lodash_namespaceObject.reduce)(imageSizes, (currentSizes, size) => { + const defaultUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', size.slug, 'url']); + const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size.slug, 'source_url']); return { ...currentSizes, [size.slug]: defaultUrl || mediaDetailsUrl }; @@ -13162,7 +13165,7 @@ function edit_GalleryEdit(props) { newAttrs = { ...newAttrs, // Unlike images[ n ].id which is a string, always ensure the // ids array contains numbers as per its attribute type. - ids: Object(external_lodash_["map"])(newAttrs.images, _ref => { + ids: (0,external_lodash_namespaceObject.map)(newAttrs.images, _ref => { let { id } = _ref; @@ -13218,7 +13221,7 @@ function edit_GalleryEdit(props) { function onRemoveImage(index) { return () => { - const newImages = Object(external_lodash_["filter"])(images, (img, i) => index !== i); + const newImages = (0,external_lodash_namespaceObject.filter)(images, (img, i) => index !== i); setSelectedImage(); setAttributes({ images: newImages, @@ -13231,8 +13234,8 @@ function edit_GalleryEdit(props) { // The image id in both the images and attachmentCaptions arrays is a // string, so ensure comparison works correctly by converting the // newImage.id to a string. - const newImageId = Object(external_lodash_["toString"])(newImage.id); - const currentImage = Object(external_lodash_["find"])(images, { + const newImageId = (0,external_lodash_namespaceObject.toString)(newImage.id); + const currentImage = (0,external_lodash_namespaceObject.find)(images, { id: newImageId }); const currentImageCaption = currentImage ? currentImage.caption : newImage.caption; @@ -13241,7 +13244,7 @@ function edit_GalleryEdit(props) { return currentImageCaption; } - const attachment = Object(external_lodash_["find"])(attachmentCaptions, { + const attachment = (0,external_lodash_namespaceObject.find)(attachmentCaptions, { id: newImageId }); // if the attachment caption is updated @@ -13256,7 +13259,7 @@ function edit_GalleryEdit(props) { setAttachmentCaptions(newImages.map(newImage => ({ // Store the attachmentCaption id as a string for consistency // with the type of the id in the images attribute. - id: Object(external_lodash_["toString"])(newImage.id), + id: (0,external_lodash_namespaceObject.toString)(newImage.id), caption: newImage.caption }))); setAttributes({ @@ -13265,7 +13268,7 @@ function edit_GalleryEdit(props) { // The id value is stored in a data attribute, so when the // block is parsed it's converted to a string. Converting // to a string here ensures it's type is consistent. - id: Object(external_lodash_["toString"])(newImage.id) + id: (0,external_lodash_namespaceObject.toString)(newImage.id) })), columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns }); @@ -13295,7 +13298,7 @@ function edit_GalleryEdit(props) { } function getImageCropHelp(checked) { - return checked ? Object(external_wp_i18n_["__"])('Thumbnails are cropped to align.') : Object(external_wp_i18n_["__"])('Thumbnails are not cropped.'); + return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.'); } function setImageAttributes(index, newAttributes) { @@ -13311,11 +13314,11 @@ function edit_GalleryEdit(props) { } function getImagesSizeOptions() { - return Object(external_lodash_["map"])(Object(external_lodash_["filter"])(imageSizes, _ref2 => { + return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => { let { slug } = _ref2; - return Object(external_lodash_["some"])(resizedImages, sizes => sizes[slug]); + return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]); }), _ref3 => { let { name, @@ -13329,12 +13332,12 @@ function edit_GalleryEdit(props) { } function updateImagesSize(newSizeSlug) { - const updatedImages = Object(external_lodash_["map"])(images, image => { + const updatedImages = (0,external_lodash_namespaceObject.map)(images, image => { if (!image.id) { return image; } - const url = Object(external_lodash_["get"])(resizedImages, [parseInt(image.id, 10), newSizeSlug]); + const url = (0,external_lodash_namespaceObject.get)(resizedImages, [parseInt(image.id, 10), newSizeSlug]); return { ...image, ...(url && { url @@ -13347,24 +13350,24 @@ function edit_GalleryEdit(props) { }); } - Object(external_wp_element_["useEffect"])(() => { - if (external_wp_element_["Platform"].OS === 'web' && images && images.length > 0 && Object(external_lodash_["every"])(images, _ref4 => { + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (external_wp_element_namespaceObject.Platform.OS === 'web' && images && images.length > 0 && (0,external_lodash_namespaceObject.every)(images, _ref4 => { let { url } = _ref4; - return Object(external_wp_blob_["isBlobURL"])(url); + return (0,external_wp_blob_namespaceObject.isBlobURL)(url); })) { - const filesList = Object(external_lodash_["map"])(images, _ref5 => { + const filesList = (0,external_lodash_namespaceObject.map)(images, _ref5 => { let { url } = _ref5; - return Object(external_wp_blob_["getBlobByURL"])(url); + return (0,external_wp_blob_namespaceObject.getBlobByURL)(url); }); - Object(external_lodash_["forEach"])(images, _ref6 => { + (0,external_lodash_namespaceObject.forEach)(images, _ref6 => { let { url } = _ref6; - return Object(external_wp_blob_["revokeBlobURL"])(url); + return (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); }); mediaUpload({ filesList, @@ -13373,13 +13376,13 @@ function edit_GalleryEdit(props) { }); } }, []); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { // Deselect images when deselecting the block if (!isSelected) { setSelectedImage(); } }, [isSelected]); - Object(external_wp_element_["useEffect"])(() => { + (0,external_wp_element_namespaceObject.useEffect)(() => { // linkTo attribute must be saved so blocks don't break when changing // image_default_link_type in options.php if (!linkTo) { @@ -13394,13 +13397,13 @@ function edit_GalleryEdit(props) { }, [linkTo]); const hasImages = !!images.length; const hasImageIds = hasImages && images.some(image => !!image.id); - const mediaPlaceholder = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], { + const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { addToGallery: hasImageIds, isAppender: hasImages, disableMediaButtons: hasImages && !isSelected, icon: !hasImages && sharedIcon, labels: { - title: !hasImages && Object(external_wp_i18n_["__"])('Gallery'), + title: !hasImages && (0,external_wp_i18n_namespaceObject.__)('Gallery'), instructions: !hasImages && edit_PLACEHOLDER_TEXT }, onSelect: onSelectImages, @@ -13413,42 +13416,42 @@ function edit_GalleryEdit(props) { onFocus: onFocus, autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted }); - const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); if (!hasImages) { - return Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], blockProps, mediaPlaceholder); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder); } const imageSizeOptions = getImagesSizeOptions(); - const shouldShowSizeOptions = hasImages && !Object(external_lodash_["isEmpty"])(imageSizeOptions); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: Object(external_wp_i18n_["__"])('Gallery settings') - }, images.length > 1 && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], Object(esm_extends["a" /* default */])({ - label: Object(external_wp_i18n_["__"])('Columns'), + const shouldShowSizeOptions = hasImages && !(0,external_lodash_namespaceObject.isEmpty)(imageSizeOptions); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings') + }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({ + label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: columns, onChange: setColumnsNumber, min: 1, max: Math.min(edit_MAX_COLUMNS, images.length) }, edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL, { required: true - })), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { - label: Object(external_wp_i18n_["__"])('Crop images'), + })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Crop images'), checked: !!imageCrop, onChange: toggleImageCrop, help: getImageCropHelp - }), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["__"])('Link to'), + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Link to'), value: linkTo, onChange: setLinkTo, options: edit_linkOptions, hideCancelButton: true - }), shouldShowSizeOptions && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["__"])('Image size'), + }), shouldShowSizeOptions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Image size'), value: sizeSlug, options: imageSizeOptions, onChange: updateImagesSize, hideCancelButton: true - }))), noticeUI, Object(external_wp_element_["createElement"])(v1_gallery, Object(esm_extends["a" /* default */])({}, props, { + }))), noticeUI, (0,external_wp_element_namespaceObject.createElement)(v1_gallery, _extends({}, props, { selectedImage: selectedImage, mediaPlaceholder: mediaPlaceholder, onMoveBackward: onMoveBackward, @@ -13463,11 +13466,11 @@ function edit_GalleryEdit(props) { }))); } -/* harmony default export */ var v1_edit = (Object(external_wp_compose_["compose"])([external_wp_components_["withNotices"], Object(external_wp_viewport_["withViewportMatch"])({ +/* harmony default export */ var v1_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({ isNarrow: '< small' })])(edit_GalleryEdit)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit-wrapper.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit-wrapper.js /** @@ -13490,15 +13493,15 @@ function edit_GalleryEdit(props) { function GalleryEditWrapper(props) { if (!isGalleryV2Enabled()) { - return Object(external_wp_element_["createElement"])(v1_edit, props); + return (0,external_wp_element_namespaceObject.createElement)(v1_edit, props); } - return Object(external_wp_element_["createElement"])(gallery_edit, props); + return (0,external_wp_element_namespaceObject.createElement)(gallery_edit, props); } -/* harmony default export */ var edit_wrapper = (Object(external_wp_compose_["compose"])([external_wp_components_["withNotices"]])(GalleryEditWrapper)); +/* harmony default export */ var edit_wrapper = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices])(GalleryEditWrapper)); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/save.js /** @@ -13523,9 +13526,9 @@ function saveV1(_ref) { linkTo } = attributes; const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`; - return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save({ + return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({ className - }), Object(external_wp_element_["createElement"])("ul", { + }), (0,external_wp_element_namespaceObject.createElement)("ul", { className: "blocks-gallery-grid" }, images.map(image => { let href; @@ -13540,7 +13543,7 @@ function saveV1(_ref) { break; } - const img = Object(external_wp_element_["createElement"])("img", { + const img = (0,external_wp_element_namespaceObject.createElement)("img", { src: image.url, alt: image.alt, "data-id": image.id, @@ -13548,24 +13551,24 @@ function saveV1(_ref) { "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); - return Object(external_wp_element_["createElement"])("li", { + return (0,external_wp_element_namespaceObject.createElement)("li", { key: image.id || image.url, className: "blocks-gallery-item" - }, Object(external_wp_element_["createElement"])("figure", null, href ? Object(external_wp_element_["createElement"])("a", { + }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", { href: href - }, img) : img, !external_wp_blockEditor_["RichText"].isEmpty(image.caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-item__caption", value: image.caption }))); - })), !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/save.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/save.js /** @@ -13604,21 +13607,20 @@ function saveWithInnerBlocks(_ref) { [`columns-default`]: columns === undefined, 'is-cropped': imageCrop }); - const blockProps = external_wp_blockEditor_["useBlockProps"].save({ + const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }); - const innerBlocksProps = external_wp_blockEditor_["useInnerBlocksProps"].save(blockProps); - return Object(external_wp_element_["createElement"])("figure", innerBlocksProps, innerBlocksProps.children, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { + const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); + return (0,external_wp_element_namespaceObject.createElement)("figure", innerBlocksProps, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption })); } -// EXTERNAL MODULE: external ["wp","hooks"] -var external_wp_hooks_ = __webpack_require__("g56x"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js +;// CONCATENATED MODULE: external ["wp","hooks"] +var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js /** * External dependencies */ @@ -13671,7 +13673,7 @@ function updateThirdPartyTransformToGallery(block) { id, alt } = _ref; - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { url, id: id ? parseInt(id, 10) : null, alt, @@ -13687,7 +13689,7 @@ function updateThirdPartyTransformToGallery(block) { return block; } -Object(external_wp_hooks_["addFilter"])('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery); /** * Third party block plugins don't have an easy way to detect if the * innerBlocks version of the Gallery is running when they run a @@ -13740,7 +13742,7 @@ function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) { return toBlock; } -Object(external_wp_hooks_["addFilter"])('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery); +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery); const gallery_transforms_transforms = { from: [{ type: 'block', @@ -13753,9 +13755,9 @@ const gallery_transforms_transforms = { sizeSlug } = attributes[0]; // Loop through all the images and check if they have the same align and size. - align = Object(external_lodash_["every"])(attributes, ['align', align]) ? align : undefined; - sizeSlug = Object(external_lodash_["every"])(attributes, ['sizeSlug', sizeSlug]) ? sizeSlug : undefined; - const validImages = Object(external_lodash_["filter"])(attributes, _ref4 => { + align = (0,external_lodash_namespaceObject.every)(attributes, ['align', align]) ? align : undefined; + sizeSlug = (0,external_lodash_namespaceObject.every)(attributes, ['sizeSlug', sizeSlug]) ? sizeSlug : undefined; + const validImages = (0,external_lodash_namespaceObject.filter)(attributes, _ref4 => { let { url } = _ref4; @@ -13764,15 +13766,15 @@ const gallery_transforms_transforms = { if (isGalleryV2Enabled()) { const innerBlocks = validImages.map(image => { - return Object(external_wp_blocks_["createBlock"])('core/image', image); + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image); }); - return Object(external_wp_blocks_["createBlock"])('core/gallery', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { align, sizeSlug }, innerBlocks); } - return Object(external_wp_blocks_["createBlock"])('core/gallery', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { images: validImages.map(_ref5 => { let { id, @@ -13781,7 +13783,7 @@ const gallery_transforms_transforms = { caption } = _ref5; return { - id: Object(external_lodash_["toString"])(id), + id: (0,external_lodash_namespaceObject.toString)(id), url, alt, caption @@ -13812,7 +13814,7 @@ const gallery_transforms_transforms = { if (!isGalleryV2Enabled()) { return parseShortcodeIds(ids).map(id => ({ - id: Object(external_lodash_["toString"])(id) + id: (0,external_lodash_namespaceObject.toString)(id) })); } } @@ -13911,20 +13913,20 @@ const gallery_transforms_transforms = { priority: 1, isMatch(files) { - return files.length !== 1 && Object(external_lodash_["every"])(files, file => file.type.indexOf('image/') === 0); + return files.length !== 1 && (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0); }, transform(files) { if (isGalleryV2Enabled()) { - const innerBlocks = files.map(file => Object(external_wp_blocks_["createBlock"])('core/image', { - url: Object(external_wp_blob_["createBlobURL"])(file) + const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { + url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) })); - return Object(external_wp_blocks_["createBlock"])('core/gallery', {}, innerBlocks); + return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks); } - const block = Object(external_wp_blocks_["createBlock"])('core/gallery', { + const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { images: files.map(file => pickRelevantMediaFiles({ - url: Object(external_wp_blob_["createBlobURL"])(file) + url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) })) }); return block; @@ -13957,7 +13959,7 @@ const gallery_transforms_transforms = { linkTarget } } = _ref14; - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { id, url, alt, @@ -13971,7 +13973,7 @@ const gallery_transforms_transforms = { }); } - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { align }); } @@ -13983,7 +13985,7 @@ const gallery_transforms_transforms = { alt, caption } = _ref15; - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { id: ids[index], url, alt, @@ -13994,7 +13996,7 @@ const gallery_transforms_transforms = { }); } - return Object(external_wp_blocks_["createBlock"])('core/image', { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { align }); } @@ -14002,7 +14004,7 @@ const gallery_transforms_transforms = { }; /* harmony default export */ var gallery_transforms = (gallery_transforms_transforms); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/index.js /** * WordPress dependencies */ @@ -14155,10 +14157,22 @@ const gallery_settings = { deprecated: gallery_deprecated }; -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js -var library_group = __webpack_require__("u6za"); +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/deprecated.js + +/** + * WordPress dependencies + */ + +const group = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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" +})); +/* harmony default export */ var library_group = (group); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/deprecated.js /** @@ -14195,7 +14209,7 @@ const migrateAttributes = attributes => { style.color.background = attributes.customBackgroundColor; } - return { ...Object(external_lodash_["omit"])(attributes, ['customTextColor', 'customBackgroundColor']), + return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']), style }; }; @@ -14233,9 +14247,9 @@ const group_deprecated_deprecated = [// Version of the block with the double div const { tagName: Tag } = attributes; - return Object(external_wp_element_["createElement"])(Tag, external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-group__inner-container" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); } }, // Version of the block without global styles support @@ -14271,8 +14285,8 @@ const group_deprecated_deprecated = [// Version of the block with the double div textColor, customTextColor } = attributes; - const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); - const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); + const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); + const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = classnames_default()(backgroundClass, textClass, { 'has-text-color': textColor || customTextColor, 'has-background': backgroundColor || customBackgroundColor @@ -14281,12 +14295,12 @@ const group_deprecated_deprecated = [// Version of the block with the double div backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: className, style: styles - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-group__inner-container" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); } }, // Version of the group block with a bug that made text color class not applied. @@ -14322,8 +14336,8 @@ const group_deprecated_deprecated = [// Version of the block with the double div textColor, customTextColor } = attributes; - const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); - const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); + const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); + const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = classnames_default()(backgroundClass, { 'has-text-color': textColor || customTextColor, 'has-background': backgroundColor || customBackgroundColor @@ -14332,12 +14346,12 @@ const group_deprecated_deprecated = [// Version of the block with the double div backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: className, style: styles - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "wp-block-group__inner-container" - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null))); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); } }, // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`. @@ -14365,23 +14379,23 @@ const group_deprecated_deprecated = [// Version of the block with the double div backgroundColor, customBackgroundColor } = attributes; - const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); + const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const className = classnames_default()(backgroundClass, { 'has-background': backgroundColor || customBackgroundColor }); const styles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor }; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: className, style: styles - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)); + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); } }]; /* harmony default export */ var group_deprecated = (group_deprecated_deprecated); -// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/edit.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/edit.js /** @@ -14392,12 +14406,12 @@ const group_deprecated_deprecated = [// Version of the block with the double div const htmlElementMessages = { - header: Object(external_wp_i18n_["__"])('The
element should represent introductory content, typically a group of introductory or navigational aids.'), - main: Object(external_wp_i18n_["__"])('The
element should be used for the primary content of your document only. '), - section: Object(external_wp_i18n_["__"])("The
element should represent a standalone portion of the document that can't be better represented by another element."), - article: Object(external_wp_i18n_["__"])('The
element should represent a self contained, syndicatable portion of the document.'), - aside: Object(external_wp_i18n_["__"])("The